Firstly, can someone explain to me where the terrain generation files are located, and if possible, a quick crash course into editing them? I can’t quite seem to pinpoint them at the moment. Also, anyone’s got an example for a functioning override?
Secondly, I recently thought of redoing the forest generation, so that I can introduce some basic biomes into the mix. First step is more types of trees (and by extension, wood and items). I find that the basic blocky trees kinda make the world seem too… blocky , and it kinda limits the ways in which I can expand the terrain generation. What do you guys think about this? I have attached a pic showing the direction in which this is heading.
Would be nice to see a worker next to the tree, to compare how the sizes and shapes are fitting together. Personally I like variety but also like the blocky look of Stonehearth, so if that is a rather big tree it might work (for me).
@voxel_pirate, the tree size is still undecided. I just replaced one of the medium oak models with that, and the size in that test run came out to be the same as the surrounding medium oak trees. I was aiming for/inspired by the forests in cube world. I also planned to change the generation of the land as well, though I have no idea how to put my thoughts into code yet.
Currently I don’t plan to add a proper biome setup, as I am still new to the whole modding scene. I am just planning to add tree generation, and I remember finding the soil coloring as well while hunting around the code. After that, if biome implementation is still far off, I might add actual variations in wood as well.
@Tuhalu, I am aware of that. I am doing this to help me become familiar with coding. Also, feedback to mods that we can use would give the developers a better view of what we would life to see in the game, more so than simple suggestions.
@coasterspaul, ah, I don’t know if that is good news or bad. Another language to learn.
Looking around in the stonehearth mod, it looks like you’ll want to go into services/server/world_generation/ to get the code that builds the world out. Landscaper.luac looks like the specific file that handles all the trees, bushes and water features.
I’m not sure where else you’d have to poke around to build out a whole new tree type. Maybe look at @Relyss’s candyland mod for some hints about how things work there?
Nope. Microworld uses absolutely zero world generation code. Well, at least none of the terrain generator. It’s just slapping a bunch of blocks into the world.
If we talk about the way the whole terrain is handled, then yes, that’s mostly C++.
If we talk about the way the terrain is generated however, as in, “where should a hill be, where a lake, where do I put my trees” kind of thing, then that’s completely in lua. It’s however not pretty and extremely difficult to understand… It’s using lots of filters and blueprints and mathematical noise and flattening and what not.
So depending on what you want to do, it’s very easy, or very hard. Jelly used to have an simple JSON interface for adding (or overriding) vegetation and the like, which has since been deprecated because it requires a major overhaul with the recent addition of water. On top of that it looks like the whole terrain thing is moving away from the landscaper onto a scenario based approach, which is entirely different.
All in all, world generation is a huge construction site (and a bit of a patchwork). There’s absolutely zero interfaces for everything - if you wish to change something, you’ll likely have to override everything which means lots and lots of work when a patch hits, especially one changing the terrain generation.
I would personally advise against major changes in the terrain department - but it depends on what you want to do. Adding new trees could be easy enough (by taking a look at the way boulders are spawned, as static (?) scenario). Coloring soil and all that however is somewhat “deep” into the whole thing.