Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Random terrain generation

Tags:

java

How can I make a terrain generator that makes more realistic terrain? My current generator makes this type of terrain:

enter image description here

how can I make it make more real terrain, like lakes and rivers?

like image 923
Jack Patrick Avatar asked Dec 21 '11 16:12

Jack Patrick


People also ask

What is the difference between random and procedural generation?

But the key difference is that randomly generated content is based on hard values and rules without any further input or control from the game while procedural lets the game create content.

How does terrain generation work?

Minecraft terrain, like most 3D terrain in video games, is entirely based on noise. When you begin the game, a random 64 bit number called a Seed is generated (or chosen by the player), and this seed is used to generated the world.

How is No Man's Sky generated?

No Man's Sky is a game built on procedural generation; that is, each planet, creature, ship, multi-tool and other items are created procedurally using algorithms in the game itself, rendering diversity through each item created.


1 Answers

Basically you define and apply a set of filters on your generated terrain.

I can't go into full detail but I'll provide some hints for you to google:

  1. voronoi diagrams
  2. erosion filters
  3. perturbation
  4. ...

For rivers you could create a voronoi diagram that has thin dark lines between the light cells. You could have some gradient from dark to light for smooth transitions. Then you mulitply that diagram with your generated terrain effectively lowering hight along those lines. Together with the irregular shape of your terrain you could get some non-straight "proto"-rivers.

Next you could apply an erosion filter that simulates rain, water flow and erosion to get more realistic and smooth rivers and lakes.

This should get you started.

For more information pay VTerrain.org a visit, for example this page: http://vterrain.org/Elevation/Artificial/, or this for water simulation (hydrogeology): http://vterrain.org/Water/index.html#Hydrogeology

like image 101
Thomas Avatar answered Oct 22 '22 20:10

Thomas