Idea's for a decent AI

Johan511

Old Schooler
Joined
Jan 24, 2001
Messages
379
Location
Minot, North Dakota
What I have never understood is why we can't get professionals that program chess computers to come in and program civilization AI's. Honestly when I see the AI send one unit into hostile territory against me or any another civilization I drop my head in disgust, it just should never happen. Instead of making the AI smart we just give it bonuses, which is like giving it extra pieces, it's not even the same game.
I know this sounds like a rant, and I don't mean to rant, I honestly want to be constructive. But my lack of understanding in the way the system has been built has lead me to feel ashamed to be a Civ Fan. I've been playing Civ since the late 1990's and honestly I feel it's in the same place I left it in 2003, and that's just a disgrace for all of us.
If a computer can beat the very best chess players in the world without cheating why can't the AI in CIV do the same?
Is there any hope?
 
AFAIK, chess isn't 'programmed', so much as filled with a database of all possible moves, with it being predetermined what is best in any given situation. Civ has too many variables for the AI to work the same way. I don't know enough about AI to know why it's the way it is, and why it can't be better, but I would also hope that a better AI can be developed.
 
You make a good point Camikaze, maybe a database of top games can be to be built similar to what Fritz uses in chess but for the Civ5 AI. This way the AI has examples to pull from to understand the basic mechanics of how combat decisions should be made?

I'm not a coder, but I know that AI is based in logic, and most of the things the Civ AI's have been doing over the years just haven't seemed logical, at least from my point of view.

I'm usually a multi-player type Civ'er, but of course you can't play Civ5 in multi-player AFAIK, and the AI basics are solid, it just needs some serious help to become a GOOD player.
 
I didn't look at Civ IV AI that much, but from what I did see, it was a mishmash of heuristics that provided passable emergent behavior - instead of minimaxing decision trees the way theoretical AI would have it. I suspect Civ V takes a similar approach, but I haven't (am I even able to?) looked at Civ V's AI.

An approach I was playing around with was using A* pathfinding for tactical operations - I don't know if this is what Civ V does already, but since pathfinding = combat for melee units, using A* weighted by presence of fortifications/units on tiles would be pretty neat. Since land is pretty scarce in Civ V battles (it always feels a bit crowded to me), minimaxing two or three turns ahead wouldn't be prohibitively expensive either - search for blocks of contiguous units, assume players will concentrate firepower on single units, assign probabilities of death to each unit in a block, and go down the tree from there. Or minimax diplomatic choices, instead of what I assume was inherited from Civ IV, which looked like a simple heuristic of reacting solely to the current situation.

Anyway, I'm not an AI expert and I haven't seen the source code for Civ V, these are just stabs in the dark.
 
I would suggest one little thing for the combat AI:

AI cities should not bombard ALWAYS the damaged unit,
but rather the artillery type, if possible...

it is a small thing but would be an improvement
 
AI cities should not bombard ALWAYS the damaged unit,
but rather the artillery type, if possible...

That is a good start, maybe many of these little tweaks will make a better A.I for future patches.

Im not sure if the A.I already does some of this stuff but here it goes anyways:

Tactical A.I (when invading):

*Archers prioritise on melee units when there are other archers or siege units in range and only attack if the archer is adjacent to a friendly melee unit for backup or the danger is low (just 1 unit in range) if not, evade.

*Never, ever move units to a spot where they can get multiple hits or there will be more than 2 adjacent(melee) units, if possible remove the fog of war for the A.I when they make their moves, sometimes it seems that they are making too many blind moves that ultimately gets their army killed, Advance wars is a very good example of an evasive A.I, the computer player only attacks when they can get closer with big clusters of melee units, if not, they try to grind with ranged attacks and waits for the player to open up.
 
Just by looking at the state of Go-AI compared to Chess-AI gives a hint of why creating a Civ-AI isn't easy. Just hiring a guy with experience from Chess-AI isn't going to get you very far.

One thing people forget is simply the evolving rules. The optimial way of playing Civ5 has changed a lot since release. Civ4-AI is of course completely useless in Civ5 so while the franchise is old, the game is not.

Finally it's of course an economic issue. Graphics sells better than AI.
 
there are alot of simple things that the ai can do that would immediately make it better.

1) if an AI unit is being bombarded, be smart enough to MOVE before its killed.

2) ranged units are NOT front line units. too often instead of taking the shot from 2 spaces, it moves in closer only to get picked off my a melee unit.

3) GG should have a higher priority than a worker. in fact, GG should almost never be wandering around alone.

4) concentrate ranged unit attacks to kill off units. still seeing archers and city attacking different units.

5) i use the 2 unit per tile mod and it is 1000% better than 1 upt, altho the ai still doesnt know how to use it as well as the barbarians do.

6) for god's sake, teach the ai not to go into the water when there are enemy ships nearby. i was going in to attack a carpeted island with a decent sized navy protecting the waters. my navy took out about 90% of their navy on the initial strike, but then to my horror, about 75% of the land units embarked. i had a field day picking them off. 2 turns later when my land units arrived, the island was almost devoid of defenders. it went from a potential bloodbath to a turkey shoot.

7) teach the ai what to build what it needs. the CSs rarely need catapults, especially ones that move every turn.

8) have the ai create mega promoted units. i use the 6 promotion mod and seeing ai archers that have increased range and 2 shots is a lot of fun. unfortunately unmodded, the ai will attack with that same unit over and over but never get past the 2 promotions, and not let other units also get promoted.

9) ai units almost always stop to heal in open country. so if i see a unit about to take a ruins, i'll attack it knowing that it'll heal instead of grabbing the ruins. even if i lose more xp, i can still get to the ruins 1st then run away.
 
Back
Top Bottom