what technics and math involved in making randomly generated worlds in video games? like space engine for example?

576 views

what technics and math involved in making randomly generated worlds in video games? like space engine for example?

In: Mathematics

3 Answers

Anonymous 0 Comments

It typically starts with a seed value which feeds a pseudo-random number generator in software. Those numbers are then used in the auto-generation process. Typically you’ll have sets of tables with all the different options, sometimes weighted depending on surrounding placements.

For example, if making a world with different terrain, you might have a table with all the surface types such as dirt, rock, sand, snow, water, etc. Given a random number between 0 and 100, the table might say that if between 0-40, it’s dirt, 41-80, it’s rock, 81-100 is sand.

Now, you will likely have multiple passes, and each pass may affect different aspects of the world. Often you want to have the world feel more organic, grouping lots of regions together of similar types to create the feeling of biomes or climate regions. In which case you might weight tables to rely on previous passes or on neighboring decisions. Or you might make multiple passes to smooth out outliers, replacing them with whatever is the dominant neighboring feature. Or you might even open up some of the variables to the user, so if they want to make a very random world, there’s some value which will reduce the affect neighboring terrain has on the table weights.

You are viewing 1 out of 3 answers, click here to view all answers.