Is the AI Aware of victory conditions?

dexters

Gods & Emperors
Supporter
Joined
Apr 23, 2003
Messages
4,182
Location
Canada
I've noticed an AI can continue to build spaceship parts even after a victory has been won. (this is of course choosing the 'play more turns' options so the AI may simply be going through the motions)

But for much of the game does the AI look at what victory condition is active and try to achieve that condition?
 
Dexter, I have not played at the higher levels, so I am not sure. My guess is probably not, unless you have only one victory condition checked, at least at the lower levels. I think on the WW2 scenario that the AI is keeping track of the victory conditions though, based on how it acts the closer you get to Japan as the Allied Player.
 
I would guess not. I've played 20k games where I haven't gotten attacked in the last few turns.
 
I think that the AI is "just going through the motions" all the time; even before the game is won, they're not "planning" a victory.

That said, I've had games where I'm getting close to space victory and I get multiple sneak attacks and I've had games where they just sit back and watch me launch.
 
Perhaps I should clarify.

AI not attacking to stop a culture win might be due to other factors.
What I do want to know is if they are aware of which victory condition is turned on or off so they can go about trying in their limited way to win themselves.

Dexter, I have not played at the higher levels, so I am not sure. My guess is probably not, unless you have only one victory condition checked, at least at the lower levels. I think on the WW2 scenario that the AI is keeping track of the victory conditions though, based on how it acts the closer you get to Japan as the Allied Player.

I have not played this scenario. Can you elaborate?
 
I have continued to build SS parts after I have won the game by other means so it is not surprising the AI does the same thing.
 
It's been several years since this was first discussed, and I'm too lazy to do an exhaustive search.

My understanding is that the AI strategizes on a turn-by-turn basis: "What would be best right now?" Not "What would be best in the long run?" I don't believe it makes any real effort to attain any specific victory. It just builds units and buildings and wonders as it can, and "hopes for the best". Everything is given a numeric weight, which determines how "important" it is to build. For instance, the UN is a game-winning wonder, so it is weighted very heavily. It will try to build it in some city, once it has the prerequisite knowledge, even if it hasn't got a snowball's chance of completing it.
 
Yeah, I don't feel like searching for the earlier discussions either, but from what I remember, the AI isn't programmed so much to win but rather to prevent someone else from winning.
In practice, this means the AI tends to go after the leader, whether that's a human civ or an AI one. That's why sometimes, for example when building the spaceship, you get attacked a lot, and other times you're just left alone. It depends on if the AI sees you as the current "top dog" or as one of the also-rans.
If you start out behind and gradually move up in the scoring (a typical pattern as you move up in difficulty levels), the AI will become less friendly as you approach the leader position.
 
Yeah, I don't feel like searching for the earlier discussions either, but from what I remember, the AI isn't programmed so much to win but rather to prevent someone else from winning.
In practice, this means the AI tends to go after the leader, whether that's a human civ or an AI one. That's why sometimes, for example when building the spaceship, you get attacked a lot, and other times you're just left alone. It depends on if the AI sees you as the current "top dog" or as one of the also-rans.
If you start out behind and gradually move up in the scoring (a typical pattern as you move up in difficulty levels), the AI will become less friendly as you approach the leader position.

I've noticed this a lot myself. Though the reason I've asked this if more in terms of whether limiting the victory conditions at the game set-up stage may help get a more focused result out of the AI vis-a-vis everyone else human and AI components in a game.

Thanks to everyone for their responses.

P.S. Padama et al, I do recall that old thread asking the same question. I tried a google search and turned up my own thread instead. :lol:
 
I'm pretty sure the AI doesn't plan for victory conditions.

It seems the developers just built a general AI logic base, and that's it. My reasoning is:
a) It seems like all AI cities are set to "auto-govern". The AI masses settlers when losing a war...
b) It seems like all AI workers are set to "auto-work". Workers treat any given terrain the same, regardless of the AI civ involved...
c) Pretty much all AIs act the same. Mass settler then mass build "auto-build". Eventually one AI has a "diplomacy factor" and "aggression factor" that makes it fight a war for a few turns.
d) The research rate is very predictable (there's a calculator). The AI doesn't bee-line anything, even if losing a war, losing a culture battle, stuck on an island, etc... The exception to this is, sadly, the Nationalism -> Fascism -> Communism slingshot, which is the AI's way of saying "I want to avoid Infantry at all costs"...
e) The AI just doesn't "react" to many things. Probably because it was never programmed to. If it's 1000 BC and I march up to AI capitol with a SOD, they may still be annoyed with me... They just don't react outside of a few "per-turn number calculations"...

When I think about all the above, it seems like the developers just took the steps to "make the game", and didn't go much beyond that. Even 2 expansion packs to Civ3 didn't change the AI behavior much. Maybe improved the "auto" settings a little, but that's it. They were probably saving AI thoughts for Civ4.

I don't blame the developers though. Programming "better AI" just isn't as cost effective marketing as "programming pretty graphics" :lol: But especially as the US economy goes down, I don't expect there to be many "better AI" games out there... Budgets are just too tight, and when developers present the game to their bosses (for paychecks), the graphics & playability are 95% of the requirements..

Dang, what I just said actually makes me sad :sad: I guess the golden-age of great gaming is over...
:borg: !! Hello world of shallow mass-produced incomplete no-patch console games !! :borg:

Re: attitude issue
AFAIK AI attitude (pleased, annoyed) towards you is based on several things:
- Difficulty level affects base attitude
- Preferred Government / Shunned Government
- Culture Graph: The programmers wanted to make culture useful...
- Current Trades: Sign an alliance and *bing* instant Pleased mode

PS:
OMG I just saw a "Civilization Revolution" advertisement banner :lol:
Wonder if the AI will be "watered down" in that game too. Or maybe its designed for MP !!
Kill 2 birds with 1 stone !

EDIT: Removed false data from AI attitude area
 
ZzarkLinux, I don't agree with many things you mentioned based on my own observations from playing and from a recent debug game I just finished watching AI play against itself (Babylon won by Culture well before Space Race got underway)

Just a few things off the top of my head
-AI attitude gets worse as you get stronger. This appears to be a base modifier so it doesn't mean they can't be polite or gracious with you, but it will require trades/rop and a common enemy.

-AI does beeline for techs. Monarchy, Feudalism, Replaceable Parts, Nationalism and generally ignore the optional techs. AI research also varies. Early in the game, most AI will go 100% research then slowly scale back to their equilibrium research. Depending on empire size, and other factors, this can range from 70/30 to 30/70. I've even seen an AI at war bump luxury to 20%

-As for the settlers phenomenon, if a war opens up new land to colonize, the AI will build settlers, but this is not always the losing civ that's doing it. Granted I do capture settlers quite often in the early game, but this (from observation) is generally more to do with surplus settlers that was beaten to a patch of land in the early game so the AI sends it back to a city to wait. The settlers aren't disbanded.
 
Nice Padma, I was just re-reading this a few days ago :)

Power lead: If you have a power lead, most of the good effects (negative numbers) are halved. ROP is one of them that still gives you the full points no matter who has the power lead. Example of what is affected: Maximum of -5 for donations instead of -10. So the Americans start off with the Aztecs at -6 (-5 for favorite government, -1 same government, -1 for same culture group, +1 for agression level) with them at 4000 B.C. on Chieftain, but this drops to -3 at 3950 B.C. on the lower levels, because already the human has a power lead. If the AI has a lead in power, you’ll see the full effects, or normal numbers (all numbers I‘ve listed in my study). If I give myself 5000 gold and donate everything I have that turn, the donation part of the formula will be at -5, but when I end my turn, the power rankings are calculated and the AI now has the power lead, so it will jump up to the full -10. If the civ is extremely furious, positive things seem to have less of an effect.
 
ZzarkLinux, I don't agree with many things you mentioned based on my own observations from playing and from a recent debug game I just finished watching AI play against itself (Babylon won by Culture well before Space Race got underway)

Just a few things off the top of my head
-AI attitude gets worse as you get stronger. This appears to be a base modifier so it doesn't mean they can't be polite or gracious with you, but it will require trades/rop and a common enemy.

-AI does beeline for techs. Monarchy, Feudalism, Replaceable Parts, Nationalism and generally ignore the optional techs. AI research also varies. Early in the game, most AI will go 100% research then slowly scale back to their equilibrium research. Depending on empire size, and other factors, this can range from 70/30 to 30/70. I've even seen an AI at war bump luxury to 20%

-As for the settlers phenomenon, if a war opens up new land to colonize, the AI will build settlers, but this is not always the losing civ that's doing it. Granted I do capture settlers quite often in the early game, but this (from observation) is generally more to do with surplus settlers that was beaten to a patch of land in the early game so the AI sends it back to a city to wait. The settlers aren't disbanded.

(emphasis added by me)
That's remarkable because it's frequently stated that the AI can't do this.
 
I'll get you guys a screenie later today when I'm at home :)

Edit: screenie may not be possible as I may have saved over it. :(

But i should ad said civ (Germany) has a small island continent all to itself and had previously set the luxury slider to 10% prior to it hitting 20%.
 
Thanks for quoting the article. I had the whole idea of power rating backwards :crazyeye:
I edited my first post so that the wrong info isn't there anymore. So the AIs really are suicidal !!

About the settlers issue, I still think it's all done by "auto-Govern". I would like to see the code for AI city placement though, sometime. They settle resources that they can't see / use for quite some time, even in tundra-land or desert-land.

AI does beeline for techs. Monarchy, Feudalism, Replaceable Parts, Nationalism and generally ignore the optional techs
Not sure what you tried to say here, maybe you could clarify.

In all the games I see, the AI is hell-bent on government techs and nationalism, which is everything you mentioned. Because they probably prioritize government / mobilization very highly (I always have difficulty buying Feudalism / Nationalism).

This is the article for AI tech research. This opens up a good question though...

"Does the AI consider a tech's priority at decision time, even if said tech is not immediately available?"
ie Is Feudalism why the AI skips Literature throughout the entire ancient age?

EDIT:
Oh, and one more thing
dexters I get the feeling we have different definitions of "AI programmed to win"

IMO you seem to look at the AI as "It is generally programmed to build culture / SS parts", just like it's generally programmed to value techs with the same formula each game.
But for me that doesn't cut it (probably cause I'm a programmer). If I had the code I'd put in all sorts of if statements to make the AI even better / less predictable / more focused in certain situation.
 
ZzarkLinux said:
I still think it's all done by "auto-Govern".

Well, duh. ;)

When you put a city on an auto-governor, or set your workers to automatic, you are invoking the routines that govern the AI. So you can see exactly what the AI would be doing with that city (or unit) in the same situation.
 
Then we have a good test.

- Pick any random world seed S
- Turn victory V on.
- Run empire on full "auto" for T turns (just make units fortify or autoexplore [remember AI knows map anyway])
- Save

Then do the above test again with same S and T but flip the V off this time.

After both saves, examine and see if your civ did anything different when victory V was turned on / off.

I'd love to do the test, but alas, I'm too busy programming AutoCAD...
 
Thanks for quoting the article. I had the whole idea of power rating backwards :crazyeye:
I edited my first post so that the wrong info isn't there anymore. So the AIs really are suicidal !!

Suicidal is a matter of opinion. But AI giving whoever is in the lead a 'favourable' penalty is the logical and correct strategy.

If it's a blow out game by the human player, it may seem suicidal (but it may also mean its time to try something more difficult) but for much closer games, #2 and #3 ranked civs going after the top ranked Civ is a pretty good strategy and has the potential to lead to major sea changes, and create opportunities for a lagging human player.

About the settlers issue, I still think it's all done by "auto-Govern". I would like to see the code for AI city placement though, sometime. They settle resources that they can't see / use for quite some time, even in tundra-land or desert-land.
As pointed out, the automation options in the game reflect how an AI would manage its own empire. You can do one better and run a game in DEBUG mode and watch the AI play. I used to do this quite often and is doing this now since my return to the game. It's good entertainment and I gain much more respect for the things the AI can do right and there are many.


Not sure what you tried to say here, maybe you could clarify.
...This is the article for AI tech research. This opens up a good question though...

"Does the AI consider a tech's priority at decision time, even if said tech is not immediately available?"
ie Is Feudalism why the AI skips Literature throughout the entire ancient age?

The link you provided is actually a very good summary of how AI researches. It's non linear, weighted and situation based on AI needs. That said there are some techs we know will be weighted heavily. Resource/Defense techs are a best bet, but so do the human player as I want to see where iron is ASAP to plan my expansion. For the AI it allows it the ability to hook up resources and build the right units.

You had mentioned earlier the AI skips replaceable parts. That's simply not the same from my experience. They like to hit the lower branch. In fact, the AI is known to do the ToE > Rep Parts > Atomic Theory slingshot. Exactly what Id' do as a human player.

As for why they don't go with literature, they do. In fact AI usually beats me to it. I prefer to get Philo and Code of Laws first for an early Republic, I never prioritize lit. GL is a drain, and I'd rather capture it. Building libraries that early is also a drain on expansion. My focus in the early game is expand and attacking whoever is near me that is taking my settling spots/resources.

If I had my way, I'd make the AI value GL even less.

EDIT:
Oh, and one more thing
dexters I get the feeling we have different definitions of "AI programmed to win"

IMO you seem to look at the AI as "It is generally programmed to build culture / SS parts", just like it's generally programmed to value techs with the same formula each game.
But for me that doesn't cut it (probably cause I'm a programmer). If I had the code I'd put in all sorts of if statements to make the AI even better / less predictable / more focused in certain situation.


I'm posing a question. :) I asked because I am sure there are those wiser than me who have tested it and know the answer. no one has come forward with a difinitive answer to what I'm asking:
"does limiting VC help the AI play a more focused end game?"

So far Xeer's response seems best and I think that's probably how it was designed to work.

I do have a game in debug mode with just conquest/domination vic checked off. I'm not playing but only watching the game so we'll see how that turns out.

P.S. The map cheat is oft repeated but seldom understood.

Yes the AI knows the map. But it can't act on its knowledge until it has the right techs. The only advantage it has is
-it knows where you have empty cities
-it knows a resource is on a tile, so it will prefer to settle near it, but its workers wont even road the resource until it can 'see it' with the proper tech advancement
-it knows where the barb camps are.

Even with this knowledge the AI will need to send out explorers and ships to explore the map so it can act on its knowledge. AI players are prolific circumnavigators because they are programmed to explore the map so they act on their knowedlege!

All of this is due to 'true' fog of war being very expensive to do for the AI. As Soren Johnson, the game's AI programmer mentioned in a recent lecture on his Civ IV AI (even CivIV does not use true fog of war for AI. )
 
Back
Top Bottom