Designing an appealing and huge game world from scratch will take even really fast designers a looooong time: valuable time that can be spent in better ways. This is where generated content comes in handy. With the push of a button a designer can create a whole world (oceans, land, forests, deserts, mountains, cities, … ) in an instant. So this is what we decided to do for our game … and here is how we got to the finish line:
On the bumpy road to an actual working map generator we decided to split all map generation tasks into small modules: heightmap generator, water generator, forest generator, desert generator, and so on. In the map-generator GUI the designer can put these modules into a task list and define the order in which they are executed. Each module also has parameters that affect the characteristics of the generated map. Even though it is supposed to be a random map generator it is especially important to have deterministic behavior. Consequently, each module that actually generates content has at least a “seed” parameter for the random number generator. With the same seed the generator will create the same results every time. Changing the seeds will create a different map.

In the little animation above you can see the output of some of the modules.
Heightmap Generator
At first we create a heightmap. We use Perlin noise since it is built into the AS3 BitmapData class and it is amazingly fast. In the beginning we experimented with our own implementation of the diamond-square algorithm, but it was way too slow.
Water Fill
In the next step we apply water to the world. We simply declare everything below a certain height level as being under water.
Mountains
By looking for local peaks we detect mountains and flag the areas accordingly.
Humidity Map
By defining a water contingent that grows over water and decreases over land we can flag dry and wet zones on the continents. To make things easier we define our whole world as a west-wind zone. The centers of most bigger continents will be dry (yellow), coast regions will be mostly humid (green) and continental areas lying east of a big stretch of water will be very humid (dark green).
Climate Zones
Next we define climate zones in the world: tropical areas, temperate zones and polar regions. With this information we can easily place polar caps in the world.
Forest Generator
Using the information from the climate zones and the humidity map makes it possible to place different types of forests into the world. Jungle (purple) will be found in the hot and wet regions around the equator, while coniferous forests will be found close to the polar caps.
Desert Generator
The desert generator also uses the information from the humidity map to detect dry regions and place desert areas into them.
Well, now you had a look at some of the modules in our map generator. They are not only capable of creating earth-like maps (like the small sample map above) but also completely different maps by changing the parameters: a lake landscape, a waste land, a desert or whatever our games may need. With this we are able to quickly create new game content of any size for the players to explore.
Cheers,
Manuel
Popularity: 62% [?]

4 comments
Wintermute says:
July 15, 2010 at 11:30 am (UTC 1 )
I have a question : how would the water contingent used for the humidity map work ?
Manuel says:
July 15, 2010 at 11:55 am (UTC 1 )
Hi Wintermute,
I used a very simple algorithm that goes somewhat like this (pseudo code, no warrenties the sample values will work):
Wintermute says:
July 29, 2010 at 12:41 pm (UTC 1 )
Thankyou for your answer.
You said “The centers of most bigger continents will be dry (yellow), coast regions will be mostly humid (green) and continental areas lying east of a big stretch of water will be very humid (dark green).”
But if I understand the algorithm, it would create a map where continental areas lying west of water would be very dry.
sarokcat says:
August 17, 2010 at 12:26 am (UTC 1 )
where can i download this to look at?