Realistic procedural generating worlds

Hi, I would like to know if there is any tutorial on how to generate procedural terrains in runtime that looks realistic. I am interesting for things that look like the Vilheim

Hello!

Sebastian Lague has a great collection of procedural generation tutorials. You can find his channel here: https://www.youtube.com/channel/UCmtyQOKKmrMVaKuRXz02jbQ

Also take a general look around google for proc gen unity. There are loads of useful tutorials and blogs on it.

It’s not unity specific, but if you are okay with converting code from pseudo code then this is one of my favorites: Polygonal Map Generation for Games (stanford.edu) It uses cellular automata to generate islands.

Unfortunately I haven’t gotten to playing Valheim yet, but based on my understanding you can use various of these techniques and noise generation to create what you are looking for.

1 Like

I did not play Valheim, but im pretty sure it uses Marching Cubes, Dual Contouring, Dual Marching Cubes, or any other similar variation of these algorithms for its terrain. Even if not, those would be what to look into. For starters, i would recommend Marching Cubes.

Be aware that procedural generation is a highly advanced topic. One of the few ones where you wont get around a ton of complex optimizations either - at least if we are talking about voxel based procedural generation. Since i have no idea abotu your programming background, i would only recommend tackling the problem if you feel very confident / fluent in the lanuage of your choice (here, C#) and dont mind digging deeper into a topic. You also wont get around multithreading, and complexity does not end there.

You can get away with a lot less work, if you dont need overhangs or tunnels / caves. In that case simple heightmap terrain is enough, which is orders of magnitude easier to achieve.

The above is as far as the “visualization” part goes anyways. How to generate realistic worlds, biomes, river systems, forests, landscapes, item placement and so on and so forth, are all separate topics yet again.

3 Likes

And since Valheim is also good looking you will additionally need strong shader knowledge. Sunlight, rain, water, mist.

I agree with Yoreki that this is a highly complex topic. And that you must ask for it indicates that you have not enough background knowledge to tackle it (no offense). If you are really interested start with simple procedural mesh generation tutorials and work up from there. CatlikeCoding has some good tutorials on this topic. But be aware this will not be a convenient ride ;). There are also some procedural terrain generators on the Asset Store. Maybe they serve your needs already with alot less work?

The last time I played Valheim couldn’t make overhangs or caves, so the terrain is heightmap based, which is much easier to implement than 3D voxel terrain. I think good lighting is difficult in procedural games because practically no GI is possible here.

That definitely shifts the focus towards the visual side of things then. I found a video of someone building an underground house, so since i never played the game i assumed it would be voxel based.
I looked up how it was done, and it appears the player in question dug below a rock, with rocks being partially destructible, giving the impression that he actually dug a cave.

Guys I know that its a complex topic, I want to take it a personal project for the next months. Generate realistic 3d enviroments. I know about 3d mesh generation, landscapes etc I lack knowledge around shaders, grass, rocks and trees placement. I jst dont find like one topic that talks about these things

Almost everything that makes the a scene “look real” has to do with lighting… lighting lighting lighting. And also lighting, global illumination, sky reflections, lighting… Not only that but lighting is critical.

Nothing about being procedurally generated gets you out of that. Lighting is still 100% critical to realism.

So unless and until you have a comprehensive post-generation lighting solution you can apply at runtime, don’t bother going beyond a certain fidelity because it just won’t ever rise about 10-20% “realistic.”

That’s just the reality of lighting. Ask any 3D modeler. That’s why realistic scenes are all baked.

3 Likes

I very much agree with you on this one, lighting is that important that a dev team like the Zelda BOTW one decided to low the quality of a lot of assets and textures just to implement a global illumination in the game and invest most of the hardware budget on lighting techniques. And that’s why the game looks so good.