4
\$\begingroup\$

I need terrain generation for a planet. The planet will be divided up into several hundred hexes, and I need it to be realistic and based on weights. I have dabbled in terrain generation before, but nothing like this. So I figure it would be a good idea to ask the community for answers, recommended articles or the like.

By realistic, I mean not just random hexes, but continent shaped things with a few islands. More desert around the equator and more ice around the poles.

I also have two weights I need to base it around: ice percentage and water percentage. That means that around XX% of the planet will need to be water.

Does anyone have any advice or places to start? Generating arbitrary terrain is easy, but something a bit more "organic" like this seems rather difficult.

It also needs to be seamless. Should be obvious since it's a planet, but no harm in pointing it out.

\$\endgroup\$
1

1 Answer 1

7
\$\begingroup\$

As with most terrain generation, noise functions are your friend - Perlin and/or simplex noise in particular. I've implemented some planetary terrain generation algorithms and although they are in 2d, the resulting height / "texture" map could be projected to a sphere rather easily. I assume conversion to hex format is not an issue either.

My technique has been creating multiple noise layers, e.g. temperature and humidity. Temperature is fused with a latitude coordinate, in order to make the equator more hot and poles cold, while the noise makes sure it's not a simple gradient. The final terrain type is selected by rules like "if hot and not humid then pick desert". You can see my JavaScript implementation of this here: https://github.com/tapio/infiniverse/blob/master/js/universe/planet-aerial.js

As for the water percentage, you can just adjust the water level height as noise functions tend to have a constant average. Another option is to apply an exponent filter (useful also when generating clouds, see my implementation here).

Another way to generate spherical terrain that came into mind (haven't tested) is to use 3d noise and sample it from a surface of a sphere, using the resulting value as the ground height at that point. You can then weight that according to amount of water on planet and the latitude coordinate.

I'll end with a link to one practical implementation of 3d planetary terrain generation: http://libnoise.sourceforge.net/tutorials/tutorial8.html

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .