Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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.

share|improve this question
    
You can start with the many questions in the procedural-generation tag, such as Huge procedurally generated 'wilderness' worlds –  Jonathan Hobbs Jun 20 '12 at 10:37
add comment

1 Answer

up vote 5 down vote accepted

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.