Effect of suggestions on the AI - are we going too far?

teccuk

Lurker Extrordinaire
Joined
Sep 16, 2004
Messages
147
Location
Lloegr
After browsing these suggestions for many weeks now, there’s no denying that most of them really do deserve to be carefully considered, but the effect that implementing these will no doubt have on possibly the most important game play aspect – the AI has got me thinking.

Let’s take a fairly basic suggestion as an example – liberating, destroying, capturing or gifting cities. No-one seems to really disagree with these suggestions; it'd be great, no denying it. But would the AI be up to it?

Several authors of guides in the War Academy who really know the AI suggest that the AI works on a one turn at a time basis, incredible considering as humans we strategise the entire game ahead! Something like the choices outlined above may just be too much for the AI. If I’m allied with another civ and re-capture their city then for the sake of friendship etc I’d probably ‘liberate’ it especially if its landlocked and a long way away. I don’t know how you’d programme the AI to take account of these types of options. I suppose you could use an equation so: IF city is more than x squares from empire AND originally allies’ then GIFT. But that’s the point the more of these options you include the more complex and messy it gets.

Essentially then surely the more options and so on given to the player that the AI won’t be able to work into its ‘strategy’ the more the programmers will have to rely on letting the AI ‘cheat’ with better production and more starting units etc damaging the finely and near perfect current game balance. The example above is only an EXAMPLE but I reckon you could apply it to most of the suggestions.

I’m not a programmer or an AI expert so what does everyone else think?
:confused:
 
yeah s'pose no-one else seems to care!
 
I took a stab at it. I've outlined how I would solve some of the AI problems at a "visionary" level, and even suggested an implementation that could save a lot of time. (You wouldn't need to make the AI particularly intelligent to make it very competitive.)

Take a look:

http://forums.civfanatics.com/showthread.php?t=101196
 
CIV 3 has more features than CIV 2. But the AI in CIV 3 is also superior, so I am not too worries about the AI in CIV 4 if this trend continues.
 
Yeah that forums great, and I especially agree with this:

"Loyalties don't last, and neither do grudges, because players have no incentive to hold a grudge or a loyalty. It is much more prosperous to turn around and backstab an ally at their weakest, or to cooperate with a former enemy so you can focus your conquest on easier pickings"

but surely thats the issue, if the AI is only looking one turn ahead, how can it really consider the 'real life' advatages of making strong freindships and alliances? and hold grudges based on bad behaviour, e.g. invading a nieghbour with unilateral aggression without provocation (hmm sounds familiar to a recent event actually - lol).
 
Well, you can still give it artificial forms of memory.

The problem is at a more fundamental level, too. There IS no value to strong alliances or friendships in Civ 3. I bet we've all won the game without a single ally. And people wonder why the computer AI is a jerk -- because the most harsh players pushed the AI that far.
 
teccuk said:
(hmm sounds familiar to a recent event actually - lol)

Hmm. I'm not sure I would agree that Saddam Hussein's invasion of Kuwait qualifies as "recent".

On the other hand, you DO have a point. Hussein never did honor the cease fire agreement and other terms of armistice from when the Gulf War coalition beat his sorry army back into Iraq in 1991. That's why there were all those sanctions in place, and why the UN passed resolution after resolution demanding his compliance, which of course he never provided. So yeah, factoring all of that and considering the long running drama that went on and on and on because the UN lacks the backbone to enforce its resolutions, I can see how the subject of Iraq could be seen as recent. In fact, the investigation into the largest-in-history scandal of graft and greed called "UN Oil For Food Program" (more like Oil for Palaces! :eek: ) is still going on, so you DEFINITELY have a point, now that I look at it. Recent indeed! The war Saddam started in 1990 never officially ended until US forces dragged his rotten old parasite infested carcas out of that hole in the ground last December, terminating his murderous regime once and for all. :hammer:

By the way, I'm looking forward to seeing Saddam on trial. As bad as things are now in Iraq, with terrorists killing dozens of Iraqis per day on average, because they're too cowardly and too inept to fight actual soldiers, the whole lot of them still don't add up to the murder rate of Saddam's government in suppressing dissent. One thing's for sure, though: no more Uday Hussein out cruising the streets, looking for random women to kidnap and rape on a whim, then cut up and feed to his hounds.


But enough of current events. Let's get back to talking about Civ. :cooool:

I agree with you that any new goodies added for the player need to be handled successfully by the AI. That's one good argument for keeping it simple when it comes to new features. Too many gadgets could spoil the AI! We don't want that. :)


- Sirian
 
But Civ has more dimensions than Chess, and Chess isn't exactly an easy game to program AI for. It requires a lot of processing and a lot of memory, and it still gets beat quite often. Plus Chess is a closed, "perfect" game. Civ is more likely to have flaws and exploits. (Which is why the deity level is so absurdly hard but strangely easy if you exploit over and over. The deity level compensates for the exploit, which it can't comprehend, by cheating.)

It's not a foregone conclusion that they'll be able to make a game that's well designed and balanced with fair rules, and have the AI able to comprehend and play by those rules.

And Saddam Hussein in power is a scary thing. But I'm personally pretty worried about pulling out and leaving it as it is now -- could be ten times worse. Fortunately both candidates have no intention of withdrawing unless the job is done right (no partisan discussions about who can get the job done right faster).
 
A chess AI picks a move and then "guesses" the human response. This may go from 2 to 5 moves deep. For each move the board position is rated for total piece points and squares controlled. A fairly simple algorithm that succeeds by brute force.

The most sucessful bridge-playing AI (GIB) plays its hand based on its best "guess" as to what its partner and opponents cards are. It gets an idea as to what the other cards are by the bidding and the card playing of the opponents.

I suspect that to get a Civ AI that can really play the game on a human par will require some sort of strategy that is closer to bridge. To take a chess AI approach - evaluating each possible move by each opponent is possible in the early game but quickly becomes mathematically (time) prohibitive.

For the AI to get cues from the human actions (human builds a city, builds a barracks, builds a warrior... whatever) would give it some idea as to its best course of action. However, in bridge it has proven easier said than done to guess what a partner or opponent is up to even with the limited number of 8 different possible responses (clubs, diamonds, hearts, spades, no trump, double, redouble and pass) at a possible bidding level (1 through 7). Each response starts a "tree" that must be evaluated to "guess" the partners and opponents cards.

And considering that there is a $2 Million prize to defeat a human bridge expert and that there are hundreds of thousands of bridge players ready to plunk down $100 bucks for this software (the average bridge player is pretty well off) still no one has been able to get there yet. After at least 5 -10 years of tournaments and development.

So I'm afraid it is unlikely that we'll ever get a real AI civ expert. This isn't a real problem.. the game is still fun but I don't think the devs should spend alot of their time in this area.
 
I do think there is a couple ways the AI could at least feign reasonable response.

Should I prepare for war?
The AI could figure this out by evaluating two things about themselves and their opponent. 1) how would I do if the war was right now? This could be a combination of strength, troop, type, terrain, and logistical analysis. it would not be perfect, but could be refined somewhat. 2) what would the war be like in the future? This could consider probable technology. potential growth of enemy and domestic cities.

Here are the possible results based on war now vs. war later.

Draw vs. Draw
The computer decides that war with this opponent is unlikely since it is not profitable either time.
Draw vs. Lose
The computer has to make sure he is either relatively stronger in the future(aquisition of a weaker opponent, military buildup) or keeps his opponent from being stronger(having ally start conflict, start conflict to waste enemy production of improvements).
Draw vs. Win
Just do not appear weak, so the opponent does not attack you too early.

Lose vs. Lose
Expect an attack anytime. the opponent realizes you are well below him and needs some whooping.
Lose vs. Draw
Buildup and try to appear as strong as possible. You might fake out the opponent and prolong conlfict to a non-profit point.
Lose vs. Win
Same as above, but the opponent will definitely attack because he knows his future his grim.

Win vs. Lose
Attack now before they are prepared.
Win vs. Draw
Attack now before they are prepared.
Win vs. Win
Try to use advantage to your advantage.
 
True that Civ is unlike chess in that you can't always see where units are positioned, and moving units isn't always the most important decision (at least it shouldn't be).

But I think a card game is possibly not quite there either, because there's a certain element of luck and randomness involved in cards. There's some in Civ, but less. You can usually infer how powerful someone's military is, for example. You might not be able to easily infer what cards someone holds unless you've played for a while.

Regardless, I think the AI problem is one that a lot of people want solved, but may be hard to solve. I'd have a hard time believing they'd be able to outdo Civ 3, unfortunately. I think we're gonna see the same old "cheat to win while playing dumb" strategy that makes up "Sid" AI.
 
I disagree with on7green, the AI is the most important aspect of the whole game, without it being half decent theres little point, trade, war, expansion, diplomacy... everything is dependent on the AI, CIV is not SimCity and its no fun building an empire without other players.

I think DH is correct, in chess there effectively a finite set of possible moves, there are near enough infinite moves or combinations of moves possible in Civ, and yes at the end of the day no program will match the ingenuity and forward thinking abilities of a human player so I suppose the cheat to win while playing dumb strategy may be the only possible outcome.

So then what suggestions are just too much effort to program the AI with, what fantisitc idea may have to be left out?

And don’t pretend you didn’t know what I was talking about in the earlier post, it certainly wasn’t Hussein’s invasion of Kuwait...
:mischief:
 
Of course, the AI is the most important part of the game. There certainly have to be improvements on long term planning and on warfare tactics. Maybe city placement and improving tiles are also an issue. I think they know the civ3 AIs weaknesses long enough to provide a reasonable solution. If they improve the mentioned issues the AI should be competetive.
I think that the civ3 AI handels some thimgs like empire management, research and trading as good as the human player. I look forward for an AI which doesnt need the rediculous production boni to be a challenge for the human player. The most suggested changes would be no problem for the AI, if they can manage long term planning, imo.
 
Long term planning is the hardest part of AI. In chess, this is done using an algorithm called "A*". Basically you reason through all the possible moves you can make, and all the possible moves all your opponents can make. The tree branches out quite quickly, to the point where thinking even 5 moves ahead in a chess game can require a memory of 40 billion possible moves. (!!!) You can economize the tree by "pruning branches" that you can judge to be less relevent or less likely. The algorithm involves maximizing the gains from the moves you make, while minimizing the best move that the other player can make.

In Civ, this is much harder because,

1: there are many more moves. You'd need to be able to economize and simplify the way you think about moves, so it's no longer about which direction you move your units, but more general notions of where your units might need to be 5 turns from now.

2: there are many more dimensions. in chess, you just move. movement is the same as killing, in fact, so there's no two alternate systems. In Civ, you move, build, trade, research, tax, attack, fortify, irrigate, bombard ... you'd not only need to find the best strategy within a dimension (like worker management) but across dimensions (worker management that is also defensive enough to account for military threats and military needs)

3: there are many more opponents. the AI needs to reason about every opponent there is.

4: the opponents' position is hidden. the AI needs to make assumptions and inferences about what and where the player is.

The solution to all of these is really quite simple. Get an AI that does basically pretty good in each different dimension, and clog a few exploits that you find along the way. Give the AI priveleged information about its opponents that would be impossible to know. Give the AI a speed handicap at the highest levels to compensate for the fact that it's pretty stupid. And always make the AI play ruthlessly.

There you go, that's Civ 3's AI.
 
Still, general directives need means to accomplish them. "Modernize your military" -- to what extent? Do you upgrade units or build new units? Which units do you upgrade first? Do you build new units? Do you let the building of new units interfere with other goals?

General directives are very important, but that's 25% of the battle. It still comes down to a lot of detail.
 
Back
Top Bottom