Forts?

At first I thought this was right, too, and would mean only 8 checks, but it is possible to have a diagonal choke point that doesnt follow this. Example:
xxxx
ooxx
xxoo
xxxx

This is a lot more difficult to evaluate, especially considering it could just as easily be:
xxxx
ooxx
oxoo
oooo

At which point, simple qualifications might make the first spot a potential choke point. (This is kind of a problem with the original proposal as well.)

There needs to be something tangible beyond the choke point, for it to have actual value, and that is something the AI may never understand (at least in this game).

Circle gets the square...

In the first grid, the simple check would decide that each of the 'o's was a chokepoint, and that is actually true. A second check might be required to decide whether to build on any one plot, involving borders, also actual plot contents (less likely to build on a resource, more likely to build on a hill, etc).

In the second grid, indeed a "false" chokepoint is indicated. I don't have an immediate answer to this.
 
Edit the XML so they don't give any defensive bonuses and I doubt the AI will build them. That's assuming you're not looking for an AI-only solution.

You are wrong. I was talking about if 1 field is surounded from at least 2 sides, not if multiple fields are. If there is a XX field, it is automaticly not good.

In a 9 point grid:

OOX
XXX
XXX

OXO
XXX
XXX

OXX
OXX
XXX

OXX
XOX
XXX

OXX
XXO
XXX

ect.

The AI would ignore all chokepoints that require more than 1 fort. Yes a few of them would be flops, but imagine how rare these are. How often do you find two mountains in the middle of plains.

This doesn't really work at all for ocean. For example:

Code:
OOOOO
OOXOO
OOXXO
OXXXO
XXXOX
XXXXX

No reason to build forts there, but using your algorithm (as I understand it), the AI would, including on that one tile right at the end of the piece of land. It would also end up forting any one tile islands it finds.

Finding choke tiles suitable for a fort is simple enough at a basic level, but you also need to take into account whether an opponent can easily move around it and, in this case, whether there's anything even worth defending behind the choke, or anything to defend it from.

I'd say basic criteria should be:

1. In between impassable tiles, so that it's blocking the only way through
2. Without any easy way for land units to get around it (like your two mountains in the middle of a plains example - might be unlikely, but then again, some of those plains might be hills or something instead)
3. You need your territory on one side of the fort and an opponent's on the other, otherwise it's pointless

Number 2 seems hardest to solve to me. Using any kind of pathfinding for this would probably end up being very expensive.
 
Edit the XML so they don't give any defensive bonuses and I doubt the AI will build them. That's assuming you're not looking for an AI-only solution.



This doesn't really work at all for ocean. For example:

Code:
OOOOO
OOXOO
OOXXO
OXXXO
XXXOX
XXXXX

No reason to build forts there, but using your algorithm (as I understand it), the AI would, including on that one tile right at the end of the piece of land. It would also end up forting any one tile islands it finds.
I newer said that I was ocean, it is coast or shalow water. Plus, I rarely ever see 1 tile islands in my game, even less that are within someones teritory.
You can not expect a perfect world where the AI would be able to perfectly analise every tile.
Just a reasonably good one in witch it would make as few mistakes as posible.
 
I newer said that I was ocean, it is coast or shalow water.
Uh... what difference does it make? All water terrain is impassable to land units.

As for one tile islands, it depends on the map script. With some of them, it can be quite common, but you'd run into the same problem with any small, narrow island, anyway.
 
Top Bottom