views:

105

answers:

6

Are there any good approaches to generating regions for a 2D map? Suppose you have a world map and would like to create country or province borders with a somewhat realistic look.

+1  A: 

I'd use a scriptable/programmable CAD or Vector illustration package to draw the shapes by hand, then process the data with a custom script into custom data files or directly into source code. In fact I have done this a number of times in the past (usually to generate VB.NET code for creating GraphicsPath objects from CAD line drawings).

Could you be more specific? What kind of format do these regions need to have? What kind of data do you already have?

David Rutten
My question is more of how to create divisions of a 2D plane that could be feasible for country/region borders, using a generative approach (that is an algorithm.)
Martin Källman
+2  A: 

Tessellation using a Voroni diagram is one approach, and whilst the shapes can be made quite irregular, it is not very realistic.

Martin Källman
A: 

One possible (and partial) solution is to do a lot of path check between to random point. Zone where a lot of pathway are grouped indicate a chokepoint, that is a physical where "traveler" would have to go throught. Those point are good to use as separator between country.

Guillaume

PATRY
A: 

I recently came across a link that covers generating 3D landscapes. You might find some ideas there. The basic gist seems be using 1/f random noise; just glancing at the pictures this seems more realistic than the Voronoi diagram approach (I assume you're trying to generate arbitrary "country" outlines, not trying to follow any real world data).

mtrw
+3  A: 

I found this blog post (and its two successors) recently, and I think it's quite close to what you're looking for.

http://simblob.blogspot.com/2010/09/polygon-map-generation-part-1.html

He's using his methods to create realistic landscapes but hopefully you can see ways to use the same techniques to group areas into believable regions.

Kylotan
Interesting! Thank you :)
Martin Källman
+1  A: 

Martin Källman's idea seems the best way to do it since you don't have natural terrain to define some of the borders. Generate random points within your borders and then Voronoi them into country borders. I would probably take it one step further and make more points than desired countries, and then merge several adjacent cells to make some of the resulting areas concave. You could use an algorithm similar to a randomized Kruskal to perform the merging (take all the countries, merge two adjacent countries, repeat until you have the desired total). I can't get to Kylotan's link, but it may describe a better way to merge the cells generated by the Voronoi.

McBeth