Podcast Episode 8: In-Game AI

As someone who used to be a game AI programmer and has an appreciation for how amazingly difficult it is, if the AI can truly keep up with a top-notch human player without cheating then I'd be starting to get nervous about the straight-forwardness of the strategic choices available in the game.

Sounds harsh, but geez if an AI is bonus-free against great human players in a truly complex, nuanced and highly strategic game which has many viable, open options at any one time, then they've got some of the best technical people on the planet IMHO.
Welcome to civfanatics, Redfury_au!

I agree with you. It its hard to translate tough decisions into numbers, ands it becomes even harder for an open game like civ which is mind boggingly more comes than ches s in terms of considerations to make and combining possibilities.
 
I'm 99.9% sure that if this is the strategy game we're all hoping for, and the top level AI is challenging for really top players - it will get some significant bonuses.
 
Cheat is very a loaded word.

Pre-Civ4 the AI would cheat, i.e. it had access to information the human player did not such as unit positions in the fog of war and locations of unrevealed resources.

In Civ4 the AI does not cheat, but it does get bonuses as part of a handicapping system. So the AI may get extra units at the start or a %bonus to production and science, but it does not get to look under the covers and see information that the human player cannot.

In Civ5 I would expect the same situation as Civ4 plus the newly revealed variable intelligence. I would be shocked if there is no handicapping for Civ5 difficulty levels.

I hope there will be a level with max AI intelligence and no handicaps, (if not it can be modded) but I am sure there will be harder levels above that which still involve significant bonuses for the AI.
 
Welcome to civfanatics, Redfury_au!

Thanks Shurdus!

It its hard to translate tough decisions into numbers, ands it becomes even harder for an open game like civ which is mind boggingly more comes than ches s in terms of considerations to make and combining possibilities.

Yep spot on. When you do game AI programming you realize that all you've got is numbers, forumula's, weightings and decision trees (unless you want to venture down some very risky paths such an neural nets or genetic algorithms.)

As an AI programmer, I still remember that moment of realization that what I had before me (a multiple-gigahertz machine) was totally inadequate for even beginning to model all the complex relationshiops, factors and interdependencies that go into a single human judgement or decision in a game like this. And I don't even mean the large, concious decisions - I'm talking about the ones that are rattling around the back of your head whilst you're playing.

People believe a lot from watching movies like Terminator and Matrix ;) Truth is imho we are much further away from creating truly human-like AI than parts of the mass media would have us believe. The fact that a lot of people will bring up the deep-blue chess scenario when arguing AI capabilities just goes to show how little the subject is understood by most people.
 
About AI getting bonuses. 2K Greg said what amount of initial happiness depends on the difficulty level. Since I doubt they'll make handicaps for AI on higher levels, I expect at least this parameter to be different for AI and human players.
 
from the description it seems like some form of min-max algorithm... well from my experience success of this algorithms is strongly dependent on the number of turns you can realistically make forward and evaluation function (this is the most tricky part...how to decide which position is stronger and how to avoid local maximums and minimums?)

I think some form of scripted AI could do fine, especially in economics side of things. but it takes time to develop good strategies and involves having decent gamers as design leaders. Let's look at S&T in CIV about the basic starting strategies and development strategies, some of those guidelines would be worth to program to strengthen evaluation.
 
In Civ5 I would expect the same situation as Civ4 plus the newly revealed variable intelligence. I would be shocked if there is no handicapping for Civ5 difficulty levels.

I agree.

About the variable intelligence thing - I assume most people realize this is nothing new. It's pretty much the way all game AI is written - you write it to be the best you can then give bonuses for higher levels (if required) and cripple it at lower ones.

If you're constructing a list of the best techs to research at a given time and deliberately NOT choosing one of the top ones, thats crippling ;)

vranasm said:
from the description it seems like some form of min-max algorithm

I wouldn't be suprised if parts of the 1UPT combat is implemented as a look-ahead min-max type algorithm because with modern processors you could probably pull off something fairly decent here with sensible decision pruning. The whole AI certainly won't be minmax though.
 
I wouldn't be suprised if parts of the 1UPT combat is implemented as a look-ahead min-max type algorithm because with modern processors you could probably pull off something fairly decent here with sensible decision pruning. The whole AI certainly won't be minmax though.

Yep I would be surprised if it was... since looking ahead with only 16x2 figures in chess is a lot of positions ;-) imagine 10ths of units for each civ...

On the other hand every heuristic analysis is very sensitive on gaming skill of the author of such analysis...but i think you already know it. This is for someone curious how it's done ;-)
 
Yep I would be surprised if it was... since looking ahead with only 16x2 figures in chess is a lot of positions ;-) imagine 10ths of units for each civ...

On the other hand every heuristic analysis is very sensitive on gaming skill of the author of such analysis...but i think you already know it. This is for someone curious how it's done ;-)

Yes you obviously couldn't minimax the whole map. YOu would need to isolate areas (like around cities) and do minimax for small areas. So something like:

- Do broad threat assessment
- See city or area worth defending is under threat
- Move troops into area
- Having another AI module doing minimax search around that area.

etc etc but yeah would take very careful and clever design with so many different units and decent movement rates.
 
Pre-Civ4 the AI would cheat, i.e. it had access to information the human player did not such as unit positions in the fog of war and locations of unrevealed resources.

In Civ4 the AI does not cheat, ...
Sorry to burst your bubble, but:

IN civ4 BtS the AI still has unit locations without having to worry about line-of-sight. This is easily tested at sea with a privateer (or 2, with different damage levels) being pursued by AI frigates.

I had believed that the civ4 AI obeyed LOS rules, but I encountered too many surprises and I started to observe (and test, as above) more closely.
 
It sounded like (from somewhere I read/heard this?) multiplayer would support simultaneous turns. Does this ring a bell for anyone else?

If so, could we have simultaneous turns in single player, I wonder? That would probably be really hard to pull off, I must have mis-understood...
 
Cheat is very a loaded word.

Pre-Civ4 the AI would cheat, i.e. it had access to information the human player did not such as unit positions in the fog of war and locations of unrevealed resources.

In Civ4 the AI does not cheat, but it does get bonuses as part of a handicapping system. So the AI may get extra units at the start or a %bonus to production and science, but it does not get to look under the covers and see information that the human player cannot.

In Civ5 I would expect the same situation as Civ4 plus the newly revealed variable intelligence. I would be shocked if there is no handicapping for Civ5 difficulty levels.

I hope there will be a level with max AI intelligence and no handicaps, (if not it can be modded) but I am sure there will be harder levels above that which still involve significant bonuses for the AI.

There are in fact some AI "cheats" in civ4 but they are not very well known. The following poster happened to notice just one of them.

I agree with you that the usage of the term "cheat" in these discussions is usually not constructive as it's an emotionally loaded term. I just say "handicap" or "bonus".

Sorry to burst your bubble, but:

IN civ4 BtS the AI still has unit locations without having to worry about line-of-sight. This is easily tested at sea with a privateer (or 2, with different damage levels) being pursued by AI frigates.

I had believed that the civ4 AI obeyed LOS rules, but I encountered too many surprises and I started to observe (and test, as above) more closely.

The AIs get visibility for their units at least as big as their movement range. So effectively destroyers with 9 movement points or so have a huge vision range. However that vision provided by the destroyer is not available to other units. This "cheat" is obviously intended to counter the AI's lack of short-term memory.

This "cheat" is most noticeable IMO when your privateers get absolutely mauled by enemy destroyers as soon as they're invented. You think you might chance it and manage to avoid detection but no, their massive vision range means they'll hunt you down with ease.
On land, the cheat is much less apparent and barely impacts gameplay (in a negative way) at all.
 
This is an interesting read. What would be most interesting for me, however, would be a way to play at the default 'no bonuses/handicaps for either player' level (i.e., noble) while still playing with the stronger AI, to ease the transition to higher levels of difficulty. I hope there is an "Aggressive AI" option that enables this as there was with Civ4.
 
This is an interesting read. What would be most interesting for me, however, would be a way to play at the default 'no bonuses/handicaps for either player' level (i.e., noble) while still playing with the stronger AI, to ease the transition to higher levels of difficulty. I hope there is an "Aggressive AI" option that enables this as there was with Civ4.
What Agg AI ? The BtS one or the vanilla/warlords ? I can agree with the first ... but , please, not the second :p

On the read:

It is actually easier to adopt stupid AI for low levels/ smarter AI for high levels in Civ V than in any of the previous versions ... simply because the Ai is not monolithic . You can make a AI dumber just by introducing noise in the communication between the various AI levels ( say, the strategic AI thinks it needs to get a iron source, but the worker AI sometimes would send the governement to eat bushes and make a nice farm somewhere else instead in low levels, but not in high ones ).

The big issue is that first you need to have a good AI for the high levels :D
 
It sounded like (from somewhere I read/heard this?) multiplayer would support simultaneous turns. Does this ring a bell for anyone else?

If so, could we have simultaneous turns in single player, I wonder? That would probably be really hard to pull off, I must have mis-understood...

Indeed that would make sense, but I guess you could simply create a local multiplayer session with only you and load it with AIs. Then they could do their intensive calculations while you did you turns (and you could use cheat against cheat with the whole double turn conundrum :D)
 
Sorry to burst your bubble, but:

IN civ4 BtS the AI still has unit locations without having to worry about line-of-sight. This is easily tested at sea with a privateer (or 2, with different damage levels) being pursued by AI frigates.

I had believed that the civ4 AI obeyed LOS rules, but I encountered too many surprises and I started to observe (and test, as above) more closely.

There are in fact some AI "cheats" in civ4 but they are not very well known. The following poster happened to notice just one of them.

The AIs get visibility for their units at least as big as their movement range. So effectively destroyers with 9 movement points or so have a huge vision range. However that vision provided by the destroyer is not available to other units. This "cheat" is obviously intended to counter the AI's lack of short-term memory.

This "cheat" is most noticeable IMO when your privateers get absolutely mauled by enemy destroyers as soon as they're invented. You think you might chance it and manage to avoid detection but no, their massive vision range means they'll hunt you down with ease.
On land, the cheat is much less apparent and barely impacts gameplay (in a negative way) at all.

I stand corrected...I was under the impression the last of these had been removed...sorry for the misinformation.
 
The AIs get visibility for their units at least as big as their movement range. So effectively destroyers with 9 movement points or so have a huge vision range. However that vision provided by the destroyer is not available to other units. This "cheat" is obviously intended to counter the AI's lack of short-term memory.

On land, the cheat is much less apparent and barely impacts gameplay (in a negative way) at all.

Thx for clearing this up, very cool info!

I heard the Starcraft 2 AI only uses maphacks on higher difficulties, where it also gets other bonuses.
 
jkp1187,
For SP play, a simple alteration to the difficulty-level xml will probably suffice. If AI 'awareness' is not included in it, just edit the file so all the 'diety' level values are the same as noble/prince values: get noble/prince game with maxed out AI awareness. Standard "work on a COPY of the file" cautions apply, of course.

PieceOfMind,
Thanks for the reminder of the specifics on the AI LOS situation.
 
I think one thing the AI is going to do is – we have it set up so when the AI is trying to make a decision – so it's trying to decide what to build in the city, trying to decide what technology to pursue next – we go ahead and we look at all the possibilities based on where they are in the tech tree right now and we rank them according to which ones we think are the best choice for a strong Civ player at that given point in time. Now what happens is when you're playing on the higher difficulty levels we almost always pick one of those top choices just because we want that civilization to be as competitive as possible with you. When you're at a lower difficulty, one of the things that we do is we start opening that up to some of those other lower ranking choices and we pick from those choices as well.

Interesting. So at higher levels, the AI will become stronger, but also more predictable. I wonder how well you can game the AI then.

mjs0 said:
Whilst I found the podcast very interesting I was disappointed it didn't talk about concurrency. With the AI split into multiple subsystems that communicate by way of requests there should be a lot of opportunity for this to happen in parallel and for the work to be spread across multiple cores.
Clearly they use parallel computing, given their system requirements (minimum dual core, recommended 4 cores).
 
Back
Top Bottom