Mod feedback, and slight modding assistance required

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 :expressionless:, 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.

Working model of a tree

1 Like

Maybe you can find some clues on world generation by looking into the “Microworld-Mod” available on GitHub?

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).

1 Like

Biomes and seasons (and some elemental planes) will eventually be in the game.

It looks like you can currently set up some objects through .json files, but the actual generation is done in lua.

If I remember correctly, I asked @RepeatPan this question a while ago, and he said that some of it was done in the C++ engine. It may have been decoupled since then, I don’t know.

1 Like

@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. :sweat_smile:

I don’t think you will have access to the game engine (C++), so this is actually bad news.

2 Likes

@Arctus98 As long as you know, it’s all good.

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?

3 Likes

I swear there’s a tutorial for trees, and there’s definitely one for clusters like flowers and silkweed, somewhere on this Discourse.

1 Like

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.

6 Likes