3

Is anyone able to recommend a generator, algorithm or any other easy way of generating a bunch of random landmasses to make up a planet.

The idea is that i will be able to project this onto a circle (my game is 2d) and rotate it so it is a vectorish world map kind of thing.

Also as this is a aesthetic part of the game im not too worried if the planet doesn't have regular features like landmasses at the poles ect.

The language i am using is python but if anyone has a generator with an api i can access im happy to go along that kind of path

2
  • Are you using any particular library to provide the drawing canvas?
    – phooji
    Mar 30, 2011 at 2:06
  • Yea i am currently using pyglet but i am more trying to solve the generating the land masses part of the problem
    – Hugoagogo
    Mar 30, 2011 at 2:13

3 Answers 3

1

Algorithm to generate natural looking terrains http://en.wikipedia.org/wiki/Perlin_noise Google will give you plenty of implementation for it. It gives you an heighfield, so a threshold to classify a point as either land or water gives you land masses.

If you need the land masses as polygons, you can run the marching square algorithm to get the polygon from the pixel map http://en.wikipedia.org/wiki/Marching_squares

2
  • This is more suited to generating a height map than polygons
    – Hugoagogo
    Mar 30, 2011 at 2:23
  • From the height map, you can get polygons, this is the marching square purpose. Although it sounds complex, a heightmap gives you great control on the kind of land masses you generate : big continents or not, many islands or not, smooth or very rought coasts, etc Achieving this level of control might be harder to get by working directly with polygons.
    – Monkey
    Mar 30, 2011 at 8:45
0

You could use http://pypi.python.org/pypi/noise/ and then apply a smoothing and/or power filter and finally a thresholding function.

Also, do you want vector output or bitmap output?

EDIT: Please delete, I didn't read the "polygon" in the headline.

0

You could try the Random midpoint displacement method to first generate the vertex map, then transfer it to spherical coordinates to make it into a ball.

2
  • I understand the basis of the random midpoint thing but im not sure how i would go about using it to generate an entire map as opposed to a single continent
    – Hugoagogo
    Mar 30, 2011 at 3:23
  • my idea is that you should have a mask describing the continents that you would apply to the generated landmass map
    – P2bM
    Mar 30, 2011 at 3:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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