[Mod] Mapgen from geographical data [geo-mapgen] (Biomes!)

User avatar
Gael de Sailly
Member
Posts: 845
Joined: Sun Jan 26, 2014 17:01
GitHub: gaelysam
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly gaelysam
Location: Voiron, France

Re: [Mod] Mapgen from geographical data [geo-mapgen] (Biomes!)

by Gael de Sailly » Post

ShadMOrdre wrote:
Mon Oct 05, 2020 18:52
You can use the minetest.get_biome_data function to obtain registered biome data within lua mapgens.

You will need to provide the functionality that converts the biome data, (ie, stone, dirt, temp/humidity values.), into the mapgen on_generated call, that maps the tempurature / humidity values to the registered biomes.
Okay thank you, wasn't aware of this one (and also some other biome functions). This partly solves the problem, I'll see how I can implement a biomegen for Lua mapgens, it's probably gonna be easier than I thought.
Last edited by Gael de Sailly on Thu Oct 15, 2020 21:03, edited 1 time in total.
Just realize how bored we would be if the world was perfect.

ShadMOrdre
Member
Posts: 1118
Joined: Mon Dec 29, 2014 08:07
Location: USA

Re: [Mod] Mapgen from geographical data [geo-mapgen] (Biomes!)

by ShadMOrdre » Post

Gael,

I should clarify that minetest.get_biome_data returns three values, temp, humidity, and biome content id. It is a very slow function.

What I did mean by the last post was that registered biomes can still be accessed, as long as one can derive the temp/humidity point for that biome. I wrote a specialized function that I referred to in the last post that uses the registered biome data to actually generate the biome. My function depends on the fact that there are 5 temp points and 5 humidity points, for a total of 25 biomes. There are other biomes also defined, within the temp / humid points for ocean, underground, mountain. I use ores, (dirt/grass nodes spawned within the biome defined dirt/grass) to create the ecosystems.

Shad

beesinmymouth13
New member
Posts: 7
Joined: Mon Oct 03, 2022 09:10

Re: [Mod] Mapgen from geographical data [geo-mapgen] (Biomes!)

by beesinmymouth13 » Post

Hello! This is such a cool idea! It’s exactly what I have been looking for. I am trying to use this to generate a world for a university senior design project I am involved in. I’ll make sure to give you credit! Unfortunately, I can’t seem to get this to work. I follow all the steps exactly and they appear to complete successfully, but when I open the world... there is no world. I am falling into the void forever. Can someone help me find what I am doing wrong?

To make sure I know what is going on, I read the Worlds and Database Backends portion of the wiki. One potential thing I think may be causing the problem is my Minetest version. You say to use version 0.5.0-dev, but I cannot find this version. The only 0.x version listed on the page where I downloaded Minetest is 0.4.16, and then it jumps straight to 5.x.x. And when I look at the Minetest changelog, there is no record of a 0.5.0? It goes straight from 0.4.16 to 5.0.0 there too?

Maybe the world is generating normally and successfully, just not right under the player's feet? It's there, just out of my render distance? If so, how would I know what coordinates it is at, so I know where to teleport?

Here's a short video (about 5 min) of me using the tool on a Ubuntu VM (since my computer is Windows but I know this tool runs best on Linux) Could someone help me see where I am going wrong?
https://youtu.be/NUE-QRV2OzE

Unfortunately in that video I forgot to capture the terminal output as I was opening the world, so here is a video showing the terminal as I open the world for the 3rd time:
https://youtu.be/mVS7k4mIiFw

Thank you all so much! This is a incredible community, and Gael de Sailly, you are an absolute genius.

Helpful links to the articles I read:
Where I downloaded Minetest (not the main Minetest page because I need a old version): https://launchpad.net/~minetestdevs/+ar ... ntu/stable
Wiki - Worlds: https://wiki.minetest.net/Worlds
Wiki - Database backends: https://wiki.minetest.net/Database_backends
Wiki - Changelog: https://dev.minetest.net/Changelog#0.4. ... eleased.29

User avatar
Gael de Sailly
Member
Posts: 845
Joined: Sun Jan 26, 2014 17:01
GitHub: gaelysam
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly gaelysam
Location: Voiron, France

Re: [Mod] Mapgen from geographical data [geo-mapgen] (Biomes!)

by Gael de Sailly » Post

Hi and thank you for your interest!
I've not been active on this project for years so I'm not surprised that it fails to work with latest Minetest version.
For the 0.5.0 thing, in fact 0.5.0 has been renamed 5.0 during the development phase so you won't find anything labeled 0.5.0-dev.
I'll watch your videos and try to solve this when I have the time (i'm travelling right now). You can remind me in some days if I forget.
Just realize how bored we would be if the world was perfect.

beesinmymouth13
New member
Posts: 7
Joined: Mon Oct 03, 2022 09:10

Re: [Mod] Mapgen from geographical data [geo-mapgen] (Biomes!)

by beesinmymouth13 » Post

Got an great update and two more questions for you if you don't mind:

There's actually no problem, everything works perfect still. Turns out the world generation starts at (0,0,0), but that is not necessarily where the player spawns. Teleporting to (0,0,0) fixed the problem. So I suppose my video will just be a alright tutorial on how to get everything started from scratch!

And the question: in the image_convert.py GUI, what does "tile size" mean? What does that change? If I have a .tif file with 1m resolution, I'll set the "vertical scale" option to 1m to make everything proportional, but do I need to change tile size or else something gets messed up? The README says "In the database, the image is cut into squares with a fixed size (by default 80 px) to make data searching faster. Changing this size may have an impact on performance.". So, sounds like it just affects the speed at which the map is generated? I can leave it alone for any map and it won't mess anything up?

When making the above 1m world, if I select to generate water in place, I get a segfault at the "[rivers] Calculating water quantity" portion of execution. There's not a ton of water in this map - for reference, this is a map of the area around Lake Red Rock, Iowa, USA, about ~450 km square in total. Do you know how I might avoid this segfault? Would tweaking the settings of the water generation help? I could also try loading the rivers from a file instead, but I don't know what type of file I need or what the data would be called (bathemetry maybe?).

Thank you for all your help!

beesinmymouth13
New member
Posts: 7
Joined: Mon Oct 03, 2022 09:10

Re: [Mod] Mapgen from geographical data [geo-mapgen] (Biomes!)

by beesinmymouth13 » Post

Sorry to bother y'all again! Does anyone still have this file they could send me? I'm working on making land cover work now. I thought it would be easiest to use the MODIS-based Global Land Cover listed in the instructions, since the legend is already written for it. However, the link to the land cover image doesn't seem to work anymore? Does anyone please happen to have the MODIS land cover image laying around still? I would be very grateful if anyone could send me it! It would be a wonderful help to our senior design project. :D
The link I'm talking about is the second one in the sentence I've generated a worldwide map using NOAA Global DEM for elevation, and MODIS-based Global Land Cover for land cover data in the initial post.

I can foresee a few potential snags:
[*] The global world Gael made has a resolution of 2km horizontally, and 200m vertically. My world uses a 1m horizontal resolution DEM file, and I set vertical resolution to 1m as well. Do I need to do anything special to make the MODIS land cover image still work with my world even though the resolutions are different? It's fine if the borders between two types of land cover get inaccurate while converting from 2km to 1m, I just need it to work at all ;)
Maybe I could try to extrapolate the MODIS land cover file - maybe there's software to turn a single point representing 2km square into 2000x2000 identical points representing 1m square each, I just don't know what it would be called. So my forests would have all straight edges, but whatever, if it works it works!

[*] The MODIS land cover image is global, but my elevation image is only for a small section of the state of Iowa, USA. Can geo-mapgen just pull the relevant part out of the land cover image file, or do I need to make sure the land cover image and the elevation image are for the exact same areas of land with the same boundaries? If so, what software do I need to do that? I've heard of something called ArcGIS, is that the right thing?

Thank you all for all your help! You are invaluable. Thank you so much.

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests