The 64th Gamer

:MinecraftCobblestone: Pneumagination World Gen

Today was work on the world generation! This is just the first pass where I’m just getting chunks to work with standard voxel blocks. Everything here though is rendered at 4x scale to the grid. Chunks are 128x128x128 meters, but in the game you’ll be able to shift Brushes by half meters, so each vertex has a 256x256x256 position stored. I think 128 block height might be cutting it a bit close even without an extensive underground. Probably gonna let the Y axis have an extra byte to make it 256 height limit.

So the next generation step would be generating a surface layer on top of this 4x scaled generation made of pre-made assets to fit each scenario of neighboring blocks. This means one 4^3 meter surface section is an 8^3 positional grid for any number of brush shapes. Technically since flat surfaces will need either 0.5m or 1m of surface (havent decided), I have more like 7^3 to work with and 6^3 when there’s blocks on both sides of an axis. As long as those edges and corners end with the correct surface height though the middle I can go wild with any type of curve or random jagged edges. I could even made multiple prefabs to randomly select.

I’m likely gonna hold off on that though and just get the chunk meshes working better, saving, being edited, getting multithreaded support, ect. Once again I don’t wanna go crazy on optimization but its probably best I get basic world editing features working before I try improving terrain feel.

One worry is introducing materials. Because optimization is an important step to consider, I have no clue what I’m gonna do about the previous idea of every brush face having (potentially) up to 4 paint layers. Because each chunk has to be one single mesh, material variants just divide the mesh up further and further until performance is really bad. A way I might have to implement it is with vertex colors, but I’ll need to look into if I can have more than one color at a time. If not, I’ll have to divide the vertex color value into 3 channels in the shader. I don’t like that this value will be duplicated across each vertex- but I guess that means I could add “gradient coloring” or something if I wanted?

Here’s what the rendering looked like at the start. There were lots and lots of messups but I’m glad I got the voxels figured out by the end of the day. Godot is being frustrating with a few things but generally its mostly the same workflow that I just have to get used to new API calls for.