This last week or so I’ve been working on bringing over some procedural world generation code to Godot that I’d experimented with in Unity a little while back. The ultimate goal being to make a kind of procedurally generated Oblivion type open world RPG, with an art style somewhere between A Link to the Past and the DS era Pokémon games. Oh, and with the Minecraft drop-in multiplayer server structure, but let’s not get ahead of ourselves.
I had some worries over how mesh generation and multi-step world gen would perform in GDScript, and had considered implementing it in C++, but I decided to just do the easy thing for now, and if I run into performance issues down the line then take another look at it.
Fortunately though it seems to run pretty nicely for now, and to be honest if I’m only doing the world gen once when a new world is started and not making an infinite world, sitting to wait for a minute while the world is created shouldn’t be too huge a deal.
So for now I have a 64 by 64 tile chunk getting generated on each thread in a 16 by 16 chunk world, which is likely to be way bigger than the game will need, especially early on when the content isn’t all there yet, but it’s nice to know that it’s running nicely with all that there.
Biome generation is (as far as I can tell) handled in a similar way to Minecraft, with three OpenSimplexNoise maps (will be changed to FastNoiseLite in Godot 4) giving me height, temperature, and humidity for a given tile, which I then use to determine a biome.
The biomes are probably a little small right now, but it’s kinda hard to tell until I can walk around the world with a character and experience it for myself. That’s a simple numbers tweak anyway so no worries there.
It’s been a little bit of a fight, with me still lacking a lot of Godot experience, and to be honest never really having to deal with vertices and uvs and normals before, but I’m learning and I’m happy with how I’m progressing.
One thing I can’t deal with is the heat here right now. It’s getting pretty sweaty and some days I’m having trouble focussing, so maybe it’s time to get the AC ready. I’ve been resisting using it as long as I can, I know it’s only going to make dealing with the August heat more difficult the earlier I start relying on it.
My next step is to pretty the tiles up a bit and get more of that ALttP feel to it.
For now though, I’ll leave you with a cool bug I ran into. Here I was iterating through the heightmap, and accidentally set tiles on the Z axis to read heights on the X axis!