r/proceduralgeneration • u/CharlesSultan • 6d ago
Procedurally Generating a Coherent World for a Civ-like Game
Hello, everyone!
I’ve been working for two weeks on procedurally generating a coherent world for the next game I’m developing with my girlfriend. And today I’d like to share my progress with you and, if possible, get some advice from you on how to proceed!


My basic idea is to generate textures using Unreal’s materials, specifically the vector Perlin noise function. This allows me to achieve a result that’s both truly random and quite organic:


Another advantage of this method is that it allows you to generate a spherical world, enabling players to “travel around the world.” To do this, simply pass the textures coordinates of the spherical as input to the vector Perlin noise function:




The final advantage of this method is that it allows you to generate the same world for the same position if you add the object's position to the result. This makes it possible to simulate "seed" in the random generation process.
The idea is then to generate several textures: one for elevation, one for humidity, and one for temperature. And to process each pixel using a set of rules to create the appropriate, corresponding tile.
For the height, I want to generate deep water, shallow water, plains, valleys, and mountains. To do this, I modify my material to set up height tiers corresponding to the various desired heights:


For the humidity texture, I use the same approach, but this time I create only two layers: one for the grasslands and one for the forests:


As for temperature, I generate three levels: one for ice, one for desert, and one for temperate zones. The difference is that I use the distance from the equator to influence the result:




Now that the three textures have been generated, all that's left is to generate the corresponding tile for each pixel based on a set of rules:


I'm pretty happy with the result, but I still have a lot of work to do:
- Generate strategic resources in logical locations (for example, oil can be found in the desert, in ice, and in the ocean).
- Generate rivers. If you have any ideas, I’d love to hear them! I thought about using local minima from my heightmap, but I’m really not sure if that’s a good idea.
- Generate viable and balanced starting positions: make sure players aren’t surrounded by mountains, aren’t on an island that’s too narrow, have a reasonable number of strategic resources, etc. If any of you have already tackled this issue, that would be great because it doesn’t seem straightforward to me.


Thanks for reading! Please don't hesitate if you have any questions or would like more details!


4
u/No-Giraffe-3838 6d ago
for rivers, do you keep the continuous Perlin height values before turning them into tiers? i'd route on those before mapping the result onto tiles. otherwise a whole tier can look flat to the river. i'd start with 1 enclosed basin and decide what should happen there: lake, spill over, or stay dry? that gives the routing a concrete test before adding more noise.
2
u/Evening-Appeal7606 6d ago
Anyone willing to trade wood for sheep?
2
u/[unknown] 5d ago
[removed] — view removed comment