Impressions about the AI in v2.5 beta

Can't beat the AI? Is it too tame? Discuss the best strategies!
bard
Veteran
Posts: 110
Joined: Fri Jun 14, 2013 2:00 pm

Impressions about the AI in v2.5 beta

Postby bard » Fri Jan 23, 2015 6:21 pm

I have noticed an improvement on the AI of v2.5 compared to the latest time that I played v2.4. I like how they defend their cities now, I find it really hard to conquer a city when we have a similar technology level. And I also like how the AI build the improvements in their cities. But I'd like to point a couple of weaknesses that I noticed in combat, in case they could be improved for future versions.

1) It seems the AI does not attack a tile unless it has a good chance to win (I have not read the code, but I guess when they have more than 50%). I think this is a good decision when attacking lone units, but not when attacking cities.
In my games against the computer, all I need to protect my cities is one good defender in each city, as long as it grants a good chance to defend against the first attack.
For example, I have seen enemy stacks full of cavalry units (more than 20), next to a city where there was only one defender, that would require only 3 or 4 attacks of cavalry to be conquered, but the AI never attacked, I guess because the chances of the first attack are not good.

If the AI could learn to sacrify the first units in order to capture a city, I think it could be much more challenging to fight against them. Altough I understand they can not do it all the time, but only when they really want certain city, and they have enough units to capture it.

2) The AI practically stops trying to attack when the Zones of Control block its movement.
If you manage to place some fortresses along your frontier, one each 3 or 4 tiles (with 2 tiles between fortresses so the ZoC do not allow to move in between), then the AI no longer try to send units to your territory.
At some point in my latest game, I was in war against more than 10 AIs in the same continent, and they were continually sending stacks of units, mainly to try to kill my workers or capture my less protected inner cities, and I was close to be defeated, until I managed to build the lastest fortress that closed the last hole in the ZoC of my frontier, and then they stoped sending units, even when they had so many troops that they could have easely conquered any of my fortresses or any of my border cities, or they could have used one single diplomat/explorer to bypass the ZoC line.

If the AI were able to use units with igZoC to cross enemy Zones of Control, from time to time, the same way that they use ships to cross the oceans, the borders would be much more dangerous.

As I see it, if the first defender of your border cities/fortresses has good chances to defend against his best attacker, and there are no holes in the ZoC, you can coexist in the same continent with a bunch of enemy units that hate you... but as soon as they develop a unit with chances to survive the first attack, you are screwed again.
In my opinion, these 2 issues lead to attacks from the AI that are too predictable. You can even create on purpose a hole in the ZoC of your border, place some worker in your side as bait, and wait to see how they send full stacks of units to kill it, that will always follow the same path. When you know it, you can be ready to kill these stacks, to close the border again while your units heal, and to repeat it as much as you want, as they did in the "7 samurai" film :)

I must say that I use civ2civ3 rules to play, but I think these issues will affect in a similar way the classic rules. Actually, I'm interested to hear possible changes to the rules that you think could minimize the effect of these AI issues.

cazfi
Elite
Posts: 1720
Joined: Tue Jan 29, 2013 6:54 pm

Re: Impressions about the AI in v2.5 beta

Postby cazfi » Fri Jan 23, 2015 9:25 pm

Is that beta1 or beta2? Not that any fix listed in http://freeciv.wikia.com/wiki/NEWS-2.5.0-beta2 promises any improvements in your points. I remember doing some bugfixes affecting your first point in recent history, but it probably was in beta1 already (so it seems that that fix alone was not enough).

bard
Veteran
Posts: 110
Joined: Fri Jun 14, 2013 2:00 pm

Re: Impressions about the AI in v2.5 beta

Postby bard » Sat Jan 24, 2015 12:13 pm

It was beta2. Actually, I continue playing that game, and I'm enjoying it. It is not easy to exploit possible flaws of the AI when you are at war with many nations from the beginning.
The good side is that, right now, you can survive in a game against many AIs, even if all them declare war on you. The bad side is that the edge between playing peacefully, and being defeated, is too narrow. I'd appreciate some attack from the AI to my cities while our forces are even, instead of seing them waiting until they are clearly superior.

Another question, it it possible to test the AI without the omniscient mode (full knowledge of enemy location)? or there is simply no code for that?

User avatar
GriffonSpade
Elite
Posts: 578
Joined: Mon Apr 29, 2013 4:41 pm

Re: Impressions about the AI in v2.5 beta

Postby GriffonSpade » Sun Jan 25, 2015 3:45 am

Ai should probably be checking:
Evaluate -
1) Cumulative win chance that can attack the given target (Preferably the former. but also possibly just the tile if necessary.)
If 1 is successful, then Assess -
2) How badly do I want to kill this unit?
3) How much will it cost me to kill this unit?

The ability to take a city, and to get to a desired city should be high value. For defense, being within your own city's harvest range should be highest value, followed by being on the tile just outside/within 1 turn of harvest range should follow closely, and then to a lesser extent being at all in one's own territory.