What does CvArea do?

deepwater

Chieftain
Joined
Apr 17, 2011
Messages
30
Hi, yet another question, sorry. :blush:
title says it all. :scan: If anybody could help it would be great. :)
 
CvArea objects refer to regions of the map, like oceans and continents. So every CvPlot belongs to some CvArea or another, identified by the area ID.
 
Each connected water or land plot (i.e. a unit in that plot could in theory move to the connected plot - ignoring impassable terrain) will belong to the same area. In other words all land plots on a continent have the same area id. All separate bodies of water will also have their own area id.

The game actual tracks quite a bit by area, including how many cities, units each player has, each area has an AI type, how many free specialists each player has (think Statue of Liberty), etc... It is how the Great Wall works, and why it doesn't keep out Barb galleys (because they are in a different area, being at sea).

The areas are computed using the pathfinder routines. You can actually use similar techniques to the way the game calculates them to further break down areas into passable and impassable regions, and even into irrigatable and non-irrigatable regions.

Out of curiosity, what were you looking for it to do for your mod?
 
Each connected water or land plot (i.e. a unit in that plot could in theory move to the connected plot - ignoring impassable terrain) will belong to the same area.

The areas are computed using the pathfinder routines. You can actually use similar techniques to the way the game calculates them to further break down areas into passable and impassable regions, and even into irrigatable and non-irrigatable regions.

Just wanted to double check if CvArea does ignore impassable terrain as Carboniferous said.

If it is true, can someone recommend a way to "break down areas into passable and impassable regions"? i.e. if impassable terrain splits a continent into two unconnected regions how would I know this?

edit: I think I know another way to accomplish what I'm really trying to do, but I would still be interested in answers to these questions. What I'm really trying to do is detect choke points.
 
Back
Top Bottom