ubc-minetest-classroom / minetest_classroom

Repo for Mintest Classroom game
GNU General Public License v3.0
10 stars 6 forks source link

Generate realms using specified biomes (integrate with world generator) #15

Closed lukasgolson closed 2 years ago

pauldpickell commented 2 years ago

Would be cool to integrate mapgen/biomes with real world data like digital elevation models and LiDAR data. This could actually be a very fundamental feature for simulating forest processes like growth, structure, disturbance, planning, etc. Being able to plug in our own species and 3D models/schematics would be very useful. I imagine having a GUI where the user can select many attributes of a forest (height +/- some variation, species composition, age, etc) and then generate a classroom realm with the desired forest type. Could be really cool if it was integrated with real world terrain data since then you could take the actual terrain and put any kind of forest on top to visualize the difference.

pauldpickell commented 2 years ago

@lukasdragon from idea card:

BEC Zonal site influence over game mechanics

pauldpickell commented 2 years ago

I think for the purpose of MC generally, we just need to support mapgens on realm creation. For our specific use of MC, it would be nice to have support for the BEC zones. Is it possible to implement BEC zones by simply reconfiguring the existing mapgens (e.g., v5, v6, v7, etc)?

Need to brainstorm more how each of these interact and integrate with MC:

lukasgolson commented 2 years ago

Doing some preliminary research on how map-gens work in Minetest, I've come to the impression that using the built in mapgens, as I had previously imagined to be simple, might not work for our use-cases.

A map-gen is defined world-wide, and are not as configurable as we would like or need. As example, they largely operate on the assumption of a global sea level (e.g., sea is at 0); do not (out of the box) generate realistic / plausible terrain; and cannot be enabled or disabled per mapblock. While V7 might be customizable enough for a map-wide classroom, it becomes complicated when we take into consideration the realm system.

As an alternative, and as recommended by the Minetest core developers, we can look into extending the singlenode generator in a lua mod. For an example, see the Islands mod: https://github.com/TheTermos/islands. This would give us ultimate control over generation while remaining relatively performant.

That said, if after testing, we are not satisfied with the performance of the terrain gen, we might be able to create a C++ server mod for terrain generation.

lukasgolson commented 2 years ago

Looking at how others have solved this issue, here is a mod that, on first inspection, (I think) emulates the built-in generators in lua: https://github.com/ShadMOrdre/mg_earth

pauldpickell commented 2 years ago

This seems like an elegant solution for the problem of generating biomes with Lua instead of the built-in biomes of the minetest engine. However, this mod does not have an API, so it would be some work to integrate this.

Reading more about the mod, it sounds like most extant bugs are wide area issues that might not really have much impact on generating relatively small realms that probably contain a single biome. Could we use this as a basis to extent this Lua map gen to include forest-specific settings (species composition, height, density, etc)?

lukasgolson commented 2 years ago

I haven't looked at mg_earth enough to say anything definitive about difficulty, but the license and general code structure means that we should be able to work with it as a good platform to extend the Lua map gen. Once that's been done, we will be able to gauge the difficulty of adding forest-specific features. I'll be able to give a better update on this once I've started working with the mod more.

All-in-all, the worst-case scenario for us would also be the most flexible. While most technically challenging, we always have the option to create our own terrain generation platform. I think this would be a poor option considering the scope of the project, but it's an option nevertheless.