Temple of The Roguelike Forums

Development => Programming => Topic started by: f1gm3nt3d on March 24, 2010, 03:34:07 PM

Title: Maps and how they are born.
Post by: f1gm3nt3d on March 24, 2010, 03:34:07 PM
So for the past year or so I've been hammering on an RL library for C# and developing a few RL's along with it. I'm at the stage where I want to start adding code to generate my maps. For the most part I have the dungeon type maps pretty much nailed down the way I want but I'm having difficulty with world maps. Now, only one of the games I've been working on has a world map, it's a zomband/doomRL type one set in the modern day so world map is pretty much the only map. I've already got a decent solution for generating buildings on a provided map. My question though is more general. How do you generate a large world map consistently? Something like generate a larger map where each cell is say a 100x100 submap, but how do you generate for something like say a coastline going from cell 3,4 to cell 3,5 on the larger map so that it "seams" correctly in the submap?  With some sort of fractal algorithm? Does anyone have any links to articles? My google-fu isn't up to snuff for finding them and I can't seem to wrap my head around it. Any ideas, pokes, prods, or finger wagging welcome. Thanks. :D
Title: Re: Maps and how they are born.
Post by: Z on March 24, 2010, 06:55:13 PM
try this (http://en.wikipedia.org/wiki/Diamond-square_algorithm)

You can do global and local generation separately quite easily.
Title: Re: Maps and how they are born.
Post by: Ex on March 24, 2010, 10:25:30 PM
Yeah, normally people use fractal based heightmaps that are converted into terrain. Such an algorithm is fairly simple to implement, and I believe there are a few good examples at roguebasin. Essentially, you generate a fractal heightmap and then decide what ranges of the map will be what type of terrain. Maybe below a certain number is ocean, and above a certain number is mountain, and inbetween there are all sorts of land types like forest and desert.
Title: Re: Maps and how they are born.
Post by: guest509 on March 25, 2010, 01:48:15 AM
  Yeah. Isn't that what Slashy used to make the Overworld for ZeldaRL?
Title: Re: Maps and how they are born.
Post by: f1gm3nt3d on March 26, 2010, 07:06:13 PM
Thanks for the replies and great starting points. Back to the anvil I go!
Title: Re: Maps and how they are born.
Post by: Etinarg on March 28, 2010, 04:16:58 PM
I have once set up a small collection of ideas in my library how to generate several types of maps:

http://www.funkelwerk.de/library/index.php?n=Library.Maps