-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose MapgenBasic::generateBiomes() to lua #8329
Comments
We already have |
Feature creep: include an altitude adjustment parameter. It could be handy for Multimap for obvious reasons, but even my own lua mapgen of floating islands was coded to use the biomes from ground level to avoid all the islands ending up in an alpine biome, so both my use cases would have benefited from a parameter like this. A workaround if there's no altitude adjustment parameter could be to edit the biome table before calling generateBiomes(), then restore it immediately after, but that assumes no concurrent chunk gen. |
Could it be this way?
That said, I haven't looked in details into the code and I have no idea how this could be achieved, or not. Just proposing. |
There's a related issue where biomemaps currently aren't ever calculated in chunks that the C++ mapgen doesn't create stone/water in, and a generateBiomes() lua function would necessarily solve that too. |
I'm very interested in this feature, and I've started thinking about it and coding some stuff. This is going to be part of my projects for the second covid lockdown! After looking closely at the code, I can imagine several strategies:
What do you think about this? |
Treer,
Please no =) In the past i went in this direction twice and both times later realised it was a mistake and had to revert it. Gael-de-Sailly,
I think this is low priority and probably not worth doing, as Lua mapgens that generate terrain usually want to generate caves too. Caves are basic terrain and the point of Lua mapgens is to have the freedom and flexibility to generate terrain how it wants.
I am not sure this is worth the effort. Those functions currently do not function with the biomemap, but are meant to be used in a different and specifically designed way. I have no objections to a simple-as-possible It seems to me that Lua mapgens usually want to have as much freedom as possible to do stuff different to the engine, with simple and limited-capability helper functions like 'generate decos/ores/biomes' optionally added. So to be clear, i support the simple initial request, but not your suggesitons. |
The thing is, for what I've seen, there doesn't seem to be an easy way to achieve this initial request, without, in one way or the other, building specifically a whole If we do this effort to expose Generating custom terrain while using the standard biome system can be wanted to test original mapgen concepts that can't be reproduced using standard mapgens, but to keep them compatible with mods that register biomes, plants, etc. |
I started coding again in this direction and today I got something that works on my lua_generate_biomes branch. I tested it on a modified version of Paramat's I tried to stick to the lightest possible changes but I still had to tweak some class definitions a bit. My approach creates a temporary instance of There are still some things that need to be changed or tested before opening a PR but I will surely do it. I'd already be interested to know whether you like the concept or not. |
Issue type
Summary
MapgenBasic::generateBiomes()
is a c++ function in Minetest that transforms the current chunk from being made only of stone into being made out of all the nodes of the applicable biomes for the area, with blending between biomes etc.Making this function available to lua would speed up lua mapgens and make them interoperate more fully with the game and other loaded mods
Your lua mapgen need write only stone, water, and riverwater to the VoxelManip , then after you call generateBiomes(), the chunk is quickly transformed into one made out of layers of dirt, sand, riverbed silt, desert stone, snow, custom nodes etc, as defined by the biomes registered by the game and other loaded mods.
I also want this feature as I think it's necessary if multi_map is to be compatible with normal Minetest mods like aotearoa.
@paramat - on this topic you said "no idea if problematic or not, i just have to work out how to do it"... feel free to note any thoughts here - then if it ends up gets shelved for more important work, I or someone else could eventually make an attempt at coding it.
The text was updated successfully, but these errors were encountered: