I'm looking for any literature on 2D random map generation!

Started by
9 comments, last by Player_0 18 years, 1 month ago
Hello, I'm a beginning developer trying to make a 2d tile based game where the world is randomly generated. In trying to figure out the best way to do this I thought I should ask on here for any tutorials, documents, or anything else people might know of. My general train of thought has been to first figure out where to place big blobs of greens, browns and whites then to fill them in with grass/forests, desert, and mountains. The second stage would be to figure out how to place the tiles and where. Then on another level I want to procedurally place towns and cities on the world and individual buildings within the towns. I remember reading something on using noise to do all of this but I can't figure out how. Any help is appreciated!
Advertisement
Googling for random 2d landscapes article seems to be a good start. A lot of these seems to generate 3D landscapes, but I guess the algorithms will be useful for 2d landscapes as well.

I've never worked a lot with this kind of stuff, so a googling string is all I can offer at the moment [smile].
[s]--------------------------------------------------------[/s]chromecode.com - software with source code
Also try googling "random level generation". Sorry, no linky, I'm lazy. Seems to hit more 2d stuff.
I found a nice site here with some tutorials:

http://members.gamedev.net/vertexnormal/articles.html

Can't find much else though.
I'm a novice at this so this might not be quite right but...
What I was thinking was that you could give values to each tile, like water, elevation, temperature, ...
And for each tile type you would have ranges of these variables that matched, like mountains would need lots of elevation, hills would need a bit less...
So you could generate a map of these values, and manipulate them as you wanted.
You could make it colder in the extreme north and south and warmer in the middle of your map, or whatever. Then you would need to process it randomly somehow, adding a random amount to each tile, or maybe spreading an increase over an area, so it is more concentrated in the center, and less at the edges.
Google for 'Perlin noise.' You can use it to quickly create a 2D height-map. If your game has height for ground(like the first two Populouses), then it should be perfect. Even if not, you could test to see if the values are above X height and if so make them land, otherwise, its water.

Won't generate Diablo-style dungeons, but it will create good-looking landscapes.
This is old, but you might find it fairly entertaining, and fairly usefull if you are a beginner. Note that i made this over three years ago when i was a C++ n00b, so no fair criticising the code:

http://www.leiavoia.net/axis/pages/desdoc/map/blotchmaker.shtml
http://www.leiavoia.net/axis/pages/desdoc/map/blotchmaker3.shtml
Quote:Original post by leiavoia
This is old, but you might find it fairly entertaining, and fairly usefull if you are a beginner. Note that i made this over three years ago when i was a C++ n00b, so no fair criticising the code:

http://www.leiavoia.net/axis/pages/desdoc/map/blotchmaker.shtml
http://www.leiavoia.net/axis/pages/desdoc/map/blotchmaker3.shtml


Neither of those links seem to work. 404.
http://www.leiavoia.net/axis/pages/desdoc/map/blotchmaker.shtml
http://www.leiavoia.net/axis/pages/desdoc/map/blotchmaker3.shtml
[s]--------------------------------------------------------[/s]chromecode.com - software with source code
At GDC 2000, Gus Smedstad described how the Heroes of Might and Magic III random map generator works in detail. I can't find it online, but the paper might be in the proceedings.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!

This topic is closed to new replies.

Advertisement