Open-source fractal maps [closed]
Asked Answered
O

6

5

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.

Orphaorphan answered 1/10, 2008 at 11:40 Comment(0)
C
9

Fracplanet may be of use.

Compulsive answered 1/10, 2008 at 11:48 Comment(0)
S
4

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.

Scop answered 1/10, 2008 at 12:1 Comment(0)
F
1

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.

Fremitus answered 1/10, 2008 at 20:15 Comment(0)
R
1

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.

Roach answered 23/1, 2009 at 17:53 Comment(0)
M
0

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

Marjoram answered 3/11, 2008 at 14:29 Comment(0)
C
0

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.

Caliper answered 7/8, 2009 at 22:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.