Podcast Episode 8: In-Game AI

Clearly they use parallel computing, given their system requirements (minimum dual core, recommended 4 cores).

Yes, but it is not clear that the AI does.

An earlier podcast talked about extensive use of multiple cores by the graphics engine, hence the requirement; I have yet to read any confirmation that the rest of the game does, although I am hopeful.
 
I sincerely hope that it's possible to play against the full best AI with no bonuses given to the AI. I mean, I hope it's not a simple continuum from dumb AI/bonuses for human to full smart AI/bonuses for AI. Ideally there would be a setting for each, "Artificial Intelligence" and "Bonuses for Human/AI". Mods for this should hopefully not be too hard.
 
By handicapping them.
Right. I really think that on anything but the lowest couple of difficulty levels, the AI should play to the best of its ability, and then give it positive or negative handicaps to adjust.

I would always want my opponent to play smart, in a combat sense - I never want to see "oh, that was dumb, he just moved his siege unit unprotected into where my cavalry could eat it". If I needed an easier difficulty unit, I'd prefer that they had fewer units, rather than just as many units used badly.

Anyway, hopefully the best AI will kick in around Prince or something, and so anythnig above that will just be from handicaps. That way I'll never have to deal with an AI making unnecessary bonehead decisions.
 
Right. I really think that on anything but the lowest couple of difficulty levels, the AI should play to the best of its ability, and then give it positive or negative handicaps to adjust.

I would always want my opponent to play smart, in a combat sense - I never want to see "oh, that was dumb, he just moved his siege unit unprotected into where my cavalry could eat it". If I needed an easier difficulty unit, I'd prefer that they had fewer units, rather than just as many units used badly.

Anyway, hopefully the best AI will kick in around Prince or something, and so anythnig above that will just be from handicaps. That way I'll never have to deal with an AI making unnecessary bonehead decisions.

Yeah, I agree. There needs to at least be a level (Prince) where you're playing against the best AI and no one gets bonuses. Above there, the AI player gets bonuses. Below there... I don't know, it might be nice to have some choice. Personally, I never play below Prince so I don't care.
 
It's not that bad that AI will be dumbed down further to getting handicapped on the lowest levels. Some new players to the series whom Firaxis/2K want to draw are definitely gonna need it to get into the game.
 
It's not that bad that AI will be dumbed down further to getting handicapped on the lowest levels. Some new players to the series whom Firaxis/2K want to draw are definitely gonna need it to get into the game.
Hint - CivRev players. Hint - console kiddies whose parents has fat wallets :mischief:
 
The lecture explained that the Civ4 AI did NOT have lists of build priorities ("build temple, then barracks"), but the AI thought about which basic items they need (culture, production,...) and built the buildings that provided this, no matter what they were called. That made the AI quite resistant to patches and mods.
In this regard the Civ 4 AI was a lot 'smarter' than people would give it credit for as long as it understood the unit/building and the benfits of using it. The problems started up when people began adding abilities to units and buildings without 'teaching' the AI about them. The only real shortcoming of Civ 4 AI was their inability to see the bigger picture, individual decisions like production queues were well done but without solid goals they couldn't decide what their cities should focus on so the workers sometimes went bonkers when presented with a variety of relatively even quality choices.

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.
Yeah, most people don't realize that something as simple to us as picking which tile to place a city on is a pretty complex chunk of code for the AI and even then it's hard to take everything into account. Hell, I had a lot of trouble just getting the game to select good starting plots in map scripts despite it being stupidly easy for me to look at the finished map and pick out a ton of 'better' spots in a matter of seconds.

Yeah, I agree. There needs to at least be a level (Prince) where you're playing against the best AI and no one gets bonuses. Above there, the AI player gets bonuses. Below there... I don't know, it might be nice to have some choice. Personally, I never play below Prince so I don't care.
No bonuses, only penalties! :)

Bonuses break the game, they result in anomolies like tanks running around in 1400AD. Penalties are good, bonuses are bad. So for low levels, penalize the AI and at high levels penalize the player. No, it's not the same net effect as giving the other person a bonus, hopefully they realized that this time around.

And I definately support the idea of 'full AI' without any sort of handicapping, if it's not in the base game it'll be a snap to mod in.

As for the cheating AI in Civ 4, there was more than seeing into the fog of war but that was definately the biggest.
 
Hello everybody,

Episode 8 of the Civilization V podcast is now available for your listening pleasure.

It's all about the AI in Civ V

Check it out here on the official website:
http://www.civilization5.com/#/community/podcasts

There is a transcript available, as always:
http://www.civilization5.com/#/community/podcast_transcript_8

And here it is for you iDevicers:
Spoiler :
Elizabeth Tobey: Welcome to the eighth episode of the Civilization V podcast series. I’m Elizabeth Tobey, and today I’m talking with Scott Lewis, Gameplay Programmer, Ed Beach, Lead Gameplay Programmer, and Brian Wade, Lead Programmer, about the AI in Civilization V – or, as I like to say, explain why Gandhi can be so evil when all you want is for him to accept your research agreement and give you some iron. To start, Ed gives a broad overview of how the team approached each civilization’s personality and play style.

Ed Beach: Let me first start by explaining what we have that makes each Civilization play a little bit uniquely. We have what we call our flavor system. And so before any game starts up we have defined for every Civilization whether they're particularly interested in offensive military action or defensive military action. Whether they like to pursue things maybe with fast mounted units or maybe they like to build naval units and explore around the seas. So a good example of a nation that we would give a high flavor for navies would be England just because they built their empire that way and so we want to reflect that in the game. We also have flavors that define whether they like to keep their people happy, whether they like to investigate science, a lot of economic sides to the game as well are all defined with our flavor system. So for each of the different leaders and civilizations in the game we have those settings then at the beginning of the game we go and tweak them all a little bit so that nobody plays exactly the same in two games and some games you might have France particularly interested in building navies or in another game you might have a civilization that's normally interested in keeping their people happy a little bit less inclined to that and they may be a little bit more militaristic. So once we have that all established then we start to use that to drive the AI's behavior in the different games so you'll have situations where that controls both how they expand, whether they want to build more cities, whether they want to expand by conquest, it will also drive what kind of units and buildings they put into their city and also just how they relate to the players. Are they gonna take a friendly route because they're gonna go for a cultural victory this time? Or are they really trying to dominate the world militarily and they're not actually very good neighbors for you to have right on your border.

Brian Wade: Yeah but even with the bias – even with the variation, Napoleon will generally be a very aggressive neighbor.

Scott Lewis: Yeah it's not good to have Montezuma on your border either.

BW: No, you probably ought to think about defenses in any case.

EB: Yeah so you'll see the basic tendencies of them once you've played the game enough times and have a rough idea what to expect but they're not gonna play it the same way every time. And then also we'll look at the situation on the map where they start. If you have a civilization that likes to build up their navy but they happen to start inland, you know, eventually they'll get to the coast and start working on their navy but they'll adjust to that situation and realize that “hey if there are a whole bunch of horses right near where I'm starting maybe I wanna go ahead and build a mounted army and start out my game that way.”

ET: Beyond the complexities of each civilization’s individual personality and gameplay style, there is another level to AI in Civilization V: Difficulty levels. When you get to the top tier of difficult, the AI can be brutal – I know that I’m not the only one who has accused the computer of cheating when on an expert level. Ed explains what the AI’s “thought process” is like on different difficulty levels, and how it gets “smarter” as you advance to more challenging settings.

EB: 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. We're also looking at kind of a different depth of analysis in terms of the military and tactical game when you go and you have a higher difficulty setting. So rather than just looking in the immediate area of a city when you're playing on the higher difficulty levels the AI is gonna be thinking a little bit deeper, looking further across the map and using that to kind of come up with decisions like, “oh wow I'm actually 10 tiles away. Maybe I have 3 or 4 units that can reinforce the situation.” I'll pull those in and that will strengthen my military right in the nick of time here.

ET: So here’s the million dollar question – “what does this mean for me? How is it going to change my gameplay?” Moreover, how is it going to change the AI’s gameplay from past iterations of Civ?

EB: I think one thing we wanna do with Civ – not only just for the AI but also for the player – is we wanna set it up so that playing each of the Civs is a unique experience. So if you look at it, in other games we've had bonuses that allow you to do things a little bit faster as each of the different civilizations that were part of their leader traits. And then we've also had unique units, unique buildings, that kind of thing. We still have the unique units and the unique buildings but one thing that we added for each of the Civs is what we're calling its unique trait. And so each of the Civilizations play with one special bonus basically that they have – and most of the special bonuses help them throughout the game, both in the early game all the way through to the late. I don't know if you guys wanna talk about any particular Civs you have a fun time playing with their bonus.

BW: Well the Germans have a pretty good aggressive bonus and they can get the barbarians to help fill out their military forces. You can get a large barbarian horde and bring it into play quickly.

EB: And so one thing we wanna do is actually set it up so that the AI is aware of these bonuses and will take advantage of them. So the Germans for instance – Brian brought them up – their bonus is when they encounter barbarians they take out the barbarian camp. They can convert the barbarian camp guard into a German unit. But we have them very aggressive at scouting so that they will find all the barbarian camps early in the game so that will hopefully help the AI capitalize on their bonus. There are other good examples of that. For instance, India likes to build very large, populated cities. They don't need as many cities as the other civilizations, they just like to pack a lot of people into them and get lots of citizens to work those tiles. And the AI's aware of that and so with India it's gonna be less likely to build settles but it will be very likely to build buildings that help provide food and growth to those cities.

SL: My favorite ability is that when the Aztecs defeat a unit they get culture which is just sort of really weird and strange but kind of great because most of the time to get culture you have to build temples and churches and what not. And it's kind of weird, so I like it.

ET: This entire podcast, I’ve talked about AI as if it is this amorphous mass – a single “thing” of sorts that makes the computer players of Civilization V do what they do. That is, of course, a massive oversimplification of what is actually going on behind the scenes. There are AI subsystems that work together to make all of these choices and create a cohesive opponent that feels like a real player.

EB: One of the things we wanted to make sure of with the AI for Civ V is that it looked at the game from all of the different perspectives that a strong player of the game looks at the situations that you're faced with. And so there are a lot of different levels that we think the AI needs to operate on to be effective in playing the game. So there's some times where you're just looking at the overall situation and you're trying to figure out, “how am I gonna win?” Am I gonna pursue a cultural victory or a conquest victory or a spaceship victory? So we need an AI that's thinking at that level. We also need to think about your economy. Do I need more cities? Do I have enough cities? In the cities that I have, do I need to boost the buildings that I have to increase my science production? Or maybe I'm running low on happiness and my people are going to be limited by that. So we need like an economic AI. We also need AI thought in terms of how to get units to a destination. Maybe we wanna found a new city. Maybe we wanna bring a military force of 5 or 6 units somewhere to either defend against an enemy attack or launch an attack of our own. And then once those enemy units get there, how do they need to be deployed for battle? Who's in the front line? Who's in the back line? Do we try to set up flank attacks? Do we just sit back and let our ranged units whittle down the enemy? So all those different decision types are things that we want the AI concerned with and we decided the best way to structure the AI software for this project was to go ahead and create a subsystem at each of those levels. So we have a grand strategy subsystem that tries to figure out how you're gonna win the game. We have an economic subsystem that acts as kind of your economic advisor and figures out oh I need more cities or I don't or I need more science or I don't. There's a military subsystem that worries about what types of units I need to produce. Whether I have enough defenses or whether I need to go and increase my defense budget and get more units built. And then there's also an operational AI that delivers units to a particular target. And once they get there there's a tactical AI. So we have all these different levels. There's also a diplomatic AI subsystem, there's AI subsystems that manage city production. And we've set it up so that those different subsystems know how to communicate with each other. If they have a special request that needs to go in so that – because I need to prepare for war I need the military subsystem to go and start producing a bunch of units, maybe fast moving units, maybe units with bombard capability, whatever. Those types of requests can get passed around between the subsystems so that they're coordinated and kind of are all operating on the same page.

ET: Like most core aspects of Civilization, the fifth iteration in the series has taken AI to a new height. The team is striving to achieve the most dynamic and distinctive opponents possible, and a challenging and unpredictable yet believable experience for players across all difficulties – from brand new to veteran player. And while knowing more about the technology that goes into making Gandhi such a sly opponent won’t help you get him to accept your research agreement, or give you that iron you so desperately need, at least now you know you have Ed, Scott, and Brian to thank for making him who he is.

Are you just intentionally skipping over the one about the modding tools that we we told was coming over a month ago??? At least give us a feature about it... maybe a couple screenshots of the tools... And there are other things more substantial than AI that could have been shared as well. Honestly you could praise the AI until you are blue in the face, but, unfortunately, seeing is believing in that department.
 
"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."

Alright, question. So it sounds like-- and maybe I'm wrong-- on higher difficulties the AI will play more human-like and do things like nuke their best friend if that's what it takes to keep someone else from winning (since that is what a "strong" player would do). If that's correct, would it be correct or incorrect to infer that on lower difficulties there's more of a chance that the AI would play true to the history you created in the game (so, not creating any WTH moments in "history" like someone suddenly nuking a close ally for trying to build a spaceship)? Greg?
 
Are you just intentionally skipping over the one about the modding tools that we we told was coming over a month ago??? At least give us a feature about it... maybe a couple screenshots of the tools... And there are other things more substantial than AI that could have been shared as well. Honestly you could praise the AI until you are blue in the face, but, unfortunately, seeing is believing in that department.

Nothing has been skipped over. There is a podcast about modding coming, and you'll get it as soon as it's ready.
 
Nothing has been skipped over. There is a podcast about modding coming, and you'll get it as soon as it's ready.

Alright... just listened to the podcast and I'll admit, there was some interesting info (particularly a little more about flavors... though I would like to know more about that subject than has been briefly discussed so far... like what exactly are the flavors). Sorry for flipping out... :blush:

Still, with less than two weeks left until release, and the next podcast being about City-States, are these (and other features) going to be released on a daily (or bi-daily) basis now???
 
No bonuses, only penalties! :)

Bonuses break the game, they result in anomolies like tanks running around in 1400AD. Penalties are good, bonuses are bad. So for low levels, penalize the AI and at high levels penalize the player. No, it's not the same net effect as giving the other person a bonus, hopefully they realized that this time around.

And I definately support the idea of 'full AI' without any sort of handicapping, if it's not in the base game it'll be a snap to mod in.

As for the cheating AI in Civ 4, there was more than seeing into the fog of war but that was definately the biggest.

This is a tough call. I agree in principle that bonuses can "break" the game, but penalties force the human player to play a different game at higher levels. As you progress through the levels and get past the point where as a player you get any bonuses, you can start revising your build, work, and research orders to maximize their effect. As long as each research beaker, hammer, and point of food counts the same for you, these strategies will work on higher levels, you'll just have to refine them to keep up with the AI, which is getting bonuses. But if you start getting penalties, the relative value of hammer, research, and food costs will change, and you'll have to come up with entirely different strategies to maximize your effectiveness at each level. I think it's better for the game to remain the same for the player as far as production, research, and food are concerned, while giving the AI a bonus to make it more competitive.
 
I just hope the AI doesnt cheat. I dont consider bonuses as cheating, as they get them based on difficulty level, and we choose the difficulty with full knowledge that the AI will be getting them. What I consider cheating is things like the AI having full knowledge of where your units are if they are within range of his movement.
 
An AI that doesn't cheat , but makes better choices the higher the difficulty level. Sounds far superior to cheating Civ4 AI.

They didn't say that, and there's no evidence for that.

Right. I really think that on anything but the lowest couple of difficulty levels, the AI should play to the best of its ability, and then give it positive or negative handicaps to adjust.

I would definitely want this too. The rest of the post I agree with as well but didn't quote the whole thing for brevity.

Seven, your thoughts on the AI were great and I know you're very right about mapmaking and so on, but I do disagree about penalties - changing the way a player is able to play the game isn't so much fun.

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.

No, that's just wrong, please don't spread such misinformation. Edit: I see a couple of things have been pointed out but fog of war is really only the tip of the iceberg, there are far more things the AI "cheats" at - things that are not bonuses. It receives and sees hidden diplo modifiers, gets additional demographic-type information (calculate power levels, for instance) and knows what deals other players have done in diplomacy when a human player never could, for some examples. BUG mod probably has pointed out or made obvious others I might be forgetting.

Combat is the easiest task for AI. In Panzer General, even with more complex combat, AI often beats human on computers which are less than half as powerful as modern mobile phones.

These are hardly even honest opinions, you are just tremendously wrong. The AI in Panzer General is incredibly weak and easy to beat, assuming halfway competent humans (like even young children or an adult player who has been taught the game for just a couple hours) and in much more recent modern games the same patterns persist.

Combat might not necessarily be the hardest task, there certainly could be other things the AI is worse at, but that doesn't mean it is good at combat.

I expect the civ5 AI to "cheat cheat" some too along with have bonuses but I'm ok with moderate amounts, it is just necessary sometimes.

I'd be a bit worried about processing time differing too much depending on difficulty level though, that could certainly turn into an annoyance. Overall, I'd actually even be happy if the top difficulty levels were routinely beatable enough by good players, much better than an inconsistent difficulty system all the way through. If you could beat the top level 80% of the time on normal settings you could still challenge yourself with far more custom settings that affect the game more than most difficulty jumps do anyway - or the number of players who really care at that point doesn't matter too much anyway, or they will play MP for challenges.
 
I dont get it..with 8 hours a day 5 day a week you'd think these podcasts would come more often.
 
I dont get it..with 8 hours a day 5 day a week you'd think these podcasts would come more often.

Two possibilities: They accelerate the schedule as release day approaches, or some of them come AFTER release day to increase interest (or insights) for SUSTAINED sales.

Post-release revelations may not please those who are already certain to buy, but civ fanatics are not the only market.
 
Earthling said:
I'd be a bit worried about processing time differing too much depending on difficulty level though, that could certainly turn into an annoyance.
This is a concern for me as well. Hopefully the processing power freed by the simplification of trade routes and other aspects will be enough to make sure the increased AI doesn't suffer a slowdown.

I agree completely with Ahriman and Earthling on AI difficulty. Assume for a second that the developers made the smartest AI possible, spending as much resources as they could to make it think masterfully at all aspects of Civ, not just in thinking ahead, but in thinking creatively. Then imagine a large subset of players beat this AI. What else is left for them but to give the AI bonuses to once again challenge the players? This scenario has happened in a lot of other games.
 
Back
Top Bottom