views:

1006

answers:

8

I'm interested in creating a game that uses fractal maps for more realistic geography. However, the only fractal map programs I have found are Windows-only, for example Fractal Mapper. Needless to say, they are also not open-sourced.

Are there any open-sourced fractal map creators available, preferably in Python or C/C++? Ideally I would like something that can be "plugged into" a program, rather then being standalone.

+7  A: 

Fracplanet may be of use.

nosklo
A: 

Have you already tried to search for fractals on sf.net?

Prog
Yes, but most of the programs are simple fractal generators/viewers or not useful for map making.
crystalattice
+4  A: 

Basic terrain generation involves creating a height map (an image) and rendering it using the pixel colour as height. So you may find image or texture generation code useful. This is a good tutorial.

Liam
+1  A: 

For the terrain aspect take a look at libnoise. It's packaged for Debian, and has excellent documentation with a chapter on terrain generation with example C++ code.

Of course there's a lot more to "maps" than slapping some colours on a height field (for example Fracplanet adds rivers and lakes). And the sort of terrain you get from these methods isn't actually that realistic; continents don't generally ramp up from the coast into a rocky hinterland, so maybe simulating continental drift and mountain building and erosion processes would help (alternatively, fake it). And then if you want vegetation, or the artefacts of lifeforms (roads and towns, say) to populate your map you might want to look at cellular automata or other "artificial life" tools. Finally, the Virtual Terrain Project is well worth a browse for more links and ideas.

timday
A: 

If you want truely realistic geography, you could use NASA's SRTM dataset, perhaps combined with OpenStreetMap features. :-)

rjmunro
+1  A: 

I'd highly recommend purchasing a copy of

Texturing & Modeling: A Procedural Approach

I see it's now in it's third edition (I only have the second) but it's packed full of useful articles about the use of procedural texturing including several chapters on their use in fractal terrains. It starts out with extensive discussion of noise algorithms too - so you have everything from the basics upwards. The authors include Musgrave, Perlin and Worley, so you really can't do better.

Cruachan
A: 

A very simple implementation would be to use the midpoint displacement fractal, http://en.wikipedia.org/wiki/Diamond-square_algorithm, or the somewhat more complicated Diamond-Squares algorithm. http://www.gameprogrammer.com/fractal.html#diamond

These are similar algorithms to the "Difference cloud" in Photoshop.

Paxinum