ID:265739
 
I'm currently creating a game that's somewhat inspired by Sid Meier's Alpha Centauri, and one thing that I've been having difficulty with is the naming of certain geographical features. I do have a map generator down, and I'm about to start implementing the placement of things like mountains and deserts, but one thing that's really been bugging me is how to detect certain geographical features like peninsulae and islands. Peninsulae could be multiple tiles wide, and I really don't want to run A* multiple times to figure out if a hunk of land is a Peninsula.
Alpha Centauri never did this. It had predefined geographical figures that it would then plop down on the map wholesale.

Actually identifying geographical figures is definitely a tricky problem, though. Islands are easy: you can just flood-fill every tile of land (excluding those already part of a flood-fill) then check the size. <= x is an island, > x is a continent.

Peninsulas are very tricky, though.
In response to Garthor
Yeah, I know that Alpha Centauri never did this, but I thought that since I have Risk-esque regions, I figured that maybe I could name some of the regions based on their geographical shape and position. Like maybe "Kashay Island" or "Queban Gulf"
In response to D4RK3 54B3R
If you're doing this for purely cosmetic reasons, I wouldn't bother. It's a hard enough problem that it's not worth spending time on unless you really need to.
In response to D4RK3 54B3R
D4RK3 54B3R wrote:
Yeah, I know that Alpha Centauri never did this, but I thought that since I have Risk-esque regions, I figured that maybe I could name some of the regions based on their geographical shape and position. Like maybe "Kashay Island" or "Queban Gulf"

Don't let the naysayers get you down. I think that would be an excellent project! I would also like to take a crack at it, but since I don't have much time right now, maybe I could just help you out a little bit?

It would be really cool if you implemented it as C program that could be fed an XML file and return characterizations based on that -- that way, it would be portable to more languages, and the only thing you would need to port from one language to another is a program that takes geographical data and exports it in the desired XML format.
In response to D4RK3 54B3R
D4RK3 54B3R wrote:
Yeah, I know that Alpha Centauri never did this, but I thought that since I have Risk-esque regions, I figured that maybe I could name some of the regions based on their geographical shape and position. Like maybe "Kashay Island" or "Queban Gulf"

As Crispy points out, for an arbitrary chunk of turfs this problem is hard and very loosely defined.

But I notice that you mention "Risk-esque regions", so I'm assuming your world is already broken up into definite regions (I'm picturing Incursion here). If your regions can be nicely defined as polygons, then this isn't terribly difficult. An "island" is a polygon where all of the sides border water. A "peninsula" is a polygon where something like three-fourths of the sides border water. "Gulfs" are slightly harder because you'd need to know whether polygons are convex or concave, but I don't think this is insurmountable.