Podcast Episode 8: In-Game AI

2K Greg

<span style="font-weight:bold; text-decoration: un
Joined
May 24, 2010
Messages
370
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&#8217;m Elizabeth Tobey, and today I&#8217;m talking with Scott Lewis, Gameplay Programmer, Ed Beach, Lead Gameplay Programmer, and Brian Wade, Lead Programmer, about the AI in Civilization V &#8211; 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&#8217;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 &#8211; 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 &#8220;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.&#8221;

ET: Beyond the complexities of each civilization&#8217;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 &#8211; I know that I&#8217;m not the only one who has accused the computer of cheating when on an expert level. Ed explains what the AI&#8217;s &#8220;thought process&#8221; is like on different difficulty levels, and how it gets &#8220;smarter&#8221; as you advance to more challenging settings.

EB: I think one thing the AI is going to do is &#8211; we have it set up so when the AI is trying to make a decision &#8211; so it's trying to decide what to build in the city, trying to decide what technology to pursue next &#8211; 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, &#8220;oh wow I'm actually 10 tiles away. Maybe I have 3 or 4 units that can reinforce the situation.&#8221; I'll pull those in and that will strengthen my military right in the nick of time here.

ET: So here&#8217;s the million dollar question &#8211; &#8220;what does this mean for me? How is it going to change my gameplay?&#8221; Moreover, how is it going to change the AI&#8217;s gameplay from past iterations of Civ?

EB: I think one thing we wanna do with Civ &#8211; not only just for the AI but also for the player &#8211; 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 &#8211; 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 &#8211; Brian brought them up &#8211; 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&#8217;ve talked about AI as if it is this amorphous mass &#8211; a single &#8220;thing&#8221; 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, &#8220;how am I gonna win?&#8221; 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 &#8211; 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 &#8211; from brand new to veteran player. And while knowing more about the technology that goes into making Gandhi such a sly opponent won&#8217;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.
 
Oh My G...oodness

Ed explains what the AI&#8217;s &#8220;thought process&#8221; is like on different difficulty levels, and how it gets &#8220;smarter&#8221; as you advance to more challenging settings.
 
I mean the "spoiler button", so people like me on an Iphone can read the transcript! :)

This AI sounds great, and explains why previewers thought the combat AI was making bad desicions with troop placements. They were more than likely playing on lower diffuculty ratings, and therefore the AI wasn't picking the best of options. Also they say the AI is brutal at harder difficulties, and seems no more cheating, just picking the optimal choices to win.
 
An AI that doesn't cheat , but makes better choices the higher the difficulty level. Sounds far superior to cheating Civ4 AI.
 
If the AI is really that good, I may pick ciV up for that reason alone. AI has always been one of the weaker points of the series, and if there really is no more cheating I'll be very happy!
 
All those subsystems won't come in conflict with each other? wonder how smooth the transition is. If there will be an emergence of sentience in A.I. it will definitely come from a Civilizations game. :assimilate:
 
They didn't say it doesn't cheat. That would be extremely surprising.

Actually they did. They are not using the system of bonuses that the AI got in CIV4. They are making it play like a human player. Make dumb choices when first playing the game, but as you get more experienced your choices become better.

Whether they are telling the whole truth will become apparent after a few games at the higher levels.
 
I mean the "spoiler button", so people like me on an Iphone can read the transcript! :)

This AI sounds great, and explains why previewers thought the combat AI was making bad desicions with troop placements. They were more than likely playing on lower diffuculty ratings, and therefore the AI wasn't picking the best of options. Also they say the AI is brutal at harder difficulties, and seems no more cheating, just picking the optimal choices to win.

Ahaha, that makes a LOT more sense. :)

The AI sounds really promising, it will be nice to get a strategy game with a competent AI. I hope the AI will get a little love in future patches and the like as well, since it seems to me most strategy games (any game, really) neglect the AI post-release.

I do wonder, if the AI is playing to each Civ strengths, will it play Babylons well also?
 
Oh My G...oodness

Yeah, that was a surprising mention. My guess is there are still difficulty related bonuses and penalties (which, btw, is distinct from "cheating" imo), but perhaps they are less pronounced (or only take affect at the highest of difficulty levels).

Nice podcast. There was quite a bit of detail there about how the subsystems work. Looks like it'll be pretty cool. My only wish for this podcast was a desire for them to talk about diplomatic thought process (grand strategy, economy, military, tactics, etc are all key systems, but diplomatic seems to be one area that people will encounter the AI in detail and it coincides with personality flavors). That being said, we seem to be getting the details in bits and pieces (with City-States next time adding even more).

Looking forward to the next one. How many are left?
 
Actually, this sounds too good to be true. Ah, WTH. This will be awesome!

You may say I am a dreamer
But I'm not the only one :cool:
 
It mentions nothing about bonuses at all! It says that the AI gets "smarter", than goes on to explain different teirs of choices, and at harder difficulties it chooses the top teir, meaning the best choices. They do not once mention that the AI has any sort of bonus!

The closest thing is when he says he's not the only one to say that the AI is cheating(talking about civ v AI, not all prior games in general) but then says how it's just smarter at higher difficulties. Again no mention of a bonus.
 
Top Bottom