views:

29

answers:

1

I'm not sure if "traditional" random noise-based height-map generation is what I need, because what I want to end up with is a very simple map consisting of two types of region.

The end result I want is some very simple geometry dividing 'land' areas from 'sea' areas, and determining if a point is wet or dry.

Ideally it should all be procedural, rather than based off pre-rendered height-maps, as I want the map to be randomly generated and somewhat parameterised.

Closest examples I can think of are the map-generators in the SimCity and Civilisation series, but simplified right down to 2D with a feel of Defcon.

A: 

Something like: Start at any point. Declare it height 0 (beach). Recursively visit each adjacent point North, East, South, and West ala a flood fill passing the current node's height. Add or subtract some parameterized, random value (say -2 to 2). Clamp the values at min and max overall values (say -5 and 20). Recurse through your map size ignoring previously visited nodes. You now have a fairly contiguous 2D height map. Negative height is wet. You can play with how much the height changes per node and the min/max overall values to get more or less land - ocean's and continents vs archipelago's, etc.

Michael Dorgan
Hmm, okay. I wasn't going to go for a grid-based map, although I suppose I could do for the sake of generation.
Cylindric
Remember, you could always take these generated heights and turn them into a 3D mesh rather easily if need be. You stated you wanted a 2D feel similiar to Civ. That's grid based if I remember correctly, with some fanciness thrown on top.
Michael Dorgan