R
R
Robotex2013-03-03 18:08:43
Game development
Robotex, 2013-03-03 18:08:43

Planet surface generator (map generator)?

Good afternoon.
For my toy, the idea arose to make a random generation of planetary surfaces (2D). We have the percentage of elements that make up the planet, based on which we calculate the percentage of elements on the surface of the planet. Each element corresponds to a certain color (for example: water - 70%, blue or white at the poles; soils - 20%, green; sandstones - 10%, yellow; silicon compounds - 10%, dark brown or black). Accordingly, you need to generate a map of the planet, consisting of the specified colored areas of the specified area (they may not necessarily be in the same place - there must be oceans, continents, seas). How can the map be generated? What are the algorithms?
Since the toy is 2D, the rotation of the planet will be carried out in this way: a circle will move along the generated rectangular map, the area inside which will be the displayed surface of the planet. Is this the best way or are there better ones? What map projection should be used in this case and how to take this into account when generating?

Answer the question

In order to leave comments, you need to log in

6 answer(s)
A
Aquahawk, 2014-04-02
@Aquahawk

en.wikipedia.org/wiki/Perlin_noise
Super cool stuff for this

V
vldkr, 2013-03-03
@vldkr

If you plan to make the poles uninhabited, then the Mercator projection is best .
The main disadvantage of the projection is that the map is strongly deformed towards the pole. The positive features are such that, firstly, the projection is conformal; secondly, the deformations are proportional (the circle on the equator remains a circle closer to the pole)

V
vldkr, 2013-03-03
@vldkr

Delicious XKCD comic in the subject. In general, the best map is a globe.

O
orangeflute, 2013-03-03
@orangeflute

Use Procedural Content Generation Algorithms. Here you can read about them.

A
Alexander Yudaev, 2013-03-03
@oYASo

You can also look at the libnoise library .

R
Robotex, 2013-03-04
@Robotex

But what if we just generate random numbers (say, from 1 to 100) and, depending on the percentage of the color, put one or another pixel on the map? Those. randomly scatter everything.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question