[Music] hi everyone oh good Mike's working so yeah I'm Sebastian thank you Dave thank you Dave and Steve for inviting me to come talk at GDC like the big text over there says I'm a senior designer at Bioware and I was most recently the lead combat design on Dragon Age Inquisition and a lot of my time I spent working on the AI for the game so before we get really rolling here can I get a quick show of hands who here is played Inquisition okay good good [Music] and who's played some of the other Dragon Age games the a 2 or just okay lots of fans in the crowd and also this is my first time at GDC and I'm just curious who else is here for the first time or there's student just trying to get in okay we're gonna we're gonna have some fun today great to see everyone here still a few people coming in at the
back a disclaimer because because this seems to be a tradition a lot of the screenshots and art that you'll see in here are scratch or they have debug renders in them and are not representative of of shipped game that you know the game shipped almost a year and a half ago now so I don't know if that's a big concern anymore but it seems to be a thing that people say when they do these presentations so let's talk about Dragon Age Inquisition it is a fantasy RPG from Bioware and the big thing about Inquisition for us is that it was our first title on frostbite which is a really neat engine that's an internally a technology we moved from our classic Eclipse engine that we use to make DAO and da2 and yeah it Dragon Age Inquisition is the first RPG on frostbite it's our first bio our title on frostbite and who
here's been through through an engine transition before show of hands okay so yeah yeah so you you know you know what that's what that's like so big challenges ahead when we started working on this back in 2011 it's also the third game in the Dragon Age series which meant that although we were starting fresh with tech we had already established a world and a story and characters that players already knew and loved and so we had a lot to live up to with this game and we also knew that we were going to be shipping on five platforms not just the the PC and the Xbox one and ps4 but we were also going to be targeting the Xbox 360 and the ps3 which meant that everything we were going to do was going to have to scale so a lot of a lot of constraints a lot of things that sort of you know influenced us when we were starting development and from the players point of view the biggest change
that we made for Inquisition was that we were adding open exploration to the game so that was going to be a big change for us when we were developing the game as we as we learned to make the game deal with these big areas and that's going to feature prominently and the challenges that we talked about today so when we talked about building the AI for Inquisition the first thing we talk about is building creatures Dragon Age has a huge variety of creatures big ones like this dragon and Giants and big big creatures we also have a lot of little creatures like this cute little nug lots of little wilderness creatures to fill out those big open areas some creatures will fight by your side these are some friendly Templars and but most of the creatures we talked about they just want to eat your face so we also need to talk
about building AI for party members and this is going to be another big big theme that we talked about today we have a variety of roles and capabilities Dragon Age has always been about the party that you travel with you know you don't go alone you have melee fighters and you have ranged snipers you have mages you have indestructible tanks a huge variety of capabilities and powers 9 90 some different unique abilities and just like in the previous games the player has the ability to switch control between any character in the party at any time meaning that from the system's point of view any character can go from being player controlled to AI controlled in the space of a heartbeat and that's that's a particular challenge we have to deal with from from the system's point of view additionally the player can pause the game pull the camera and move around the battlefield and give direct orders to
any of the characters in their party at the same time and then watch how that scenario plays out and we'll talk about how the AI accommodates that kind of control as well and when we're building because we're starting on a new engine in addition to building the content and the creatures and the party members and the abilities and the combat system we also had to build up our tools and workflow as developers we know that iteration speed is key to improving quality the faster you can see your changes in the game the faster you can evaluate them and see whether you need to improve further or whether you've achieved what you're trying to hit so we knew that we wanted to take advantage of the engines data driven pipeline to be able to do live tweaking in our toolset and see those results in game as we are playing and editing and iterating on
gameplay for our AI there were two related workflows actually that we were working on one is for combat designers who are working on building out the AI for creatures and party members and building all the pieces and we also needed to worry about workflows for excuse me for our level designers who had to shape the AI behavior in the environments that they were building and the plots and stories that they were trying to tell so today's focus is context is going to talk about to air two big themes as I mentioned one is adapting to big open areas of game for gameplay in a way that we've never done at bio air or on Dragon Age before and the other is looking at how we built up the party AI systems to support our complex and
customizable party members so that they can support the player and this is a retrospective it's been as I say almost a year and a half since we shipped Inquisition so I'm going to try to tell the story of development and some of the roadblocks we hit and and some and the way that we that we cross some of those challenges so hopefully by the end of our by the end of our talk today you'll be able to take some of these solutions to solve your own related problems and maybe cut out some surprises by taking advantage of the trial and error that that we went through bringing this game up so we got a big box labeled frostbite we cracked it open and what was inside well thankfully we knew that we wouldn't have to solve pathfinding we got a path finding middleware called nav power that came with an integration into frostbite so we have path mesh and navigation for
our characters you can see that big sea of green polygons over there on the display so that gave us a really good starting point we could get characters moving around and following each other around without having to do any of that that base level work for ourselves on the other side we also were able to take advantage of another EA team who had built a decision tree architecture and this is where we would build the vast majority of our logic from the combat design side it came with a nice visual note editor that we were able to use and we as a game team as a combat team we built out a huge library of conditional evaluations to test things in the world and to be able to to get ái the information it needed to make interesting choices and also a set of interfaces to drive game systems and that's primarily in our game where am I
going to move how am I going to move there and then what am i what abilities do I want to use well what's an ability an ability is a concept that we brought forward from past Dragon Age games that gave us a consistent approach to defining gameplay actions so for players and party members abilities are explicit this is something that you buy as you level up you go and you buy abilities with points you put them on your bar and there's something you can use and over the course of the game you're getting new abilities you're upgrading them and these are you know these are the things that you do in game we also use this in addition to using it for party members we also use the ability framework to define our NPCs so everything that a MPC character does is also defined as an ability even though it doesn't have that player facing inter interface and the level up GUI with the ability trees so this includes as I say obvious things
you know I'm going to throw a fireball I'm gonna taunt that guy over there and get his aggro I want to dodge out of the way those are all active abilities but some things that aren't player facing as abilities like jumping drinking a potion twitches that NPCs would play I'm gonna you know yell at you from across the map those are all implemented as abilities under the hood so this gives us a consistent approach to how we define gameplay actions and this is going to be very important when we talk about ability choosing so we've got our path fighting system we've got a decision tree we've got a framework to build our actions and abilities on now we need to actually channel making all these things go we'd never made a game with these frostbite tools we'd never had open our exploration areas we knew that we had a big scope lots of things that we had to build and so we wanted to make sure that we had a consistent approach to the way that our AI evaluates and the way the
decisions are made so that everyone on the team had same idea of how things are going to work at the most basic level and we wanted to make sure that you know even across creatures and party members because everything is running under the same AI system we wanted to make sure that everyone followed the same basic set of rules and this is what we came up with so we'll walk through a little example so I'm gonna run AI in our example here on this character who's standing in front and those four glowy purple fellows in the back there those are our enemies so the first thing our AI does in the core evaluation loop the first thing we're going to do is pick a target so that guy that guy right there the next thing that's going to happen is that we're going to choose what ability we want to use so we picked flanking strike down there in the right hand corner that's a melee ability so we know
that we're going to have to move because we're going to use our daggers we're gonna have to move in order to be able to execute that and once we've moved into position then we can play the animation apply the damage do all the fun stuff of actually using that ability so that's the core decision-making loop and action loop that every ai-controlled character in the game basically follows there's a few exceptions but typically you pick your target you pick your ability that you want to use you moved if you have to to accomplish it and then you execute it by firing the animation and away we'd go so with this in place as a team as a development team we have a consistent approach to a evaluation sports both party members and creatures between party members and creatures how they do that choosing for example party members have a player customization element that they can use for how they're going to pick targets and where
as creatures use an aggro system to determine who they're targeting but despite having minor differences and how they do these steps everyone follows the same basic logic pattern now not every ability not everything you want to do can be accomplished by directly moving to your target and smacking them in the face as we did in our previous example the pathfinding layer as I mentioned gave us move to point and follow leader so with that as long as we know where we want to go we've got that solved but a lot of our creatures and our party behaviors need more complex movement we wanted to be able to create more interesting patterns both to give life to our creatures and fill out the big open spaces that we had in a way that meets player expectations and also be able to create interesting gameplay challenges without requiring designers
to hand build specific location picking and movement behaviors every time so we wanted reusable abstractions and we came up with a system we call movement behaviors so these are reusable parameterised you can see a big example from the from the editor over there on the on the screen parameterised chunks of behavior that a creature can run one at a time and that get-get excuse me that puts them in a position to be able to do interesting things in gameplay without having the designer to manually specify how they're going to compute their targets and the move positioned every time so an example of one of these is stay at range you can see over there and it's parameterised so that the designer can say that's the guy or the thing that you want to focus on and you're going to pick a position somewhere around that object or that character and hang out there even if that target moves and it gives the designer the flexibility even to say okay I want you to be in a flanking
position so you're gonna try to move around into the back arc of that character or I want you to you know sort of shuffle around and and be a little more dynamic rather than picking a point and sticking in it additionally we have a movement behavior that lets characters find cover objects that have been marked up in the world so that for example some of our range creatures can respond to their environment a little more and feel like they're living in the scene without level designer having given specific movement commands our plate excuse me our prey flee behavior is implemented in the same way where even if we have a creature one of those little nugs who's fleeing from three different predators the creature just needs to run the flee behavior and it goes and looks and finds the right path that's going to take him away from those predators regardless of where their positions are in the world and even hold position which you think would be pretty simple it gets a reusable
parameterised movement behavior so that it can sit in that slot and we can do things with it like tell someone to stand in one place but track a target even though that target might be moving around the level so with this system in place we now have tools that allow creatures to move around in ways that are both interesting for gameplays for gameplay and also meet player expectations for wildlife predator prey behaviors aggression and circling wolves that kind of thing the next problem we had to deal with is around the nature of these big open zones themselves in our past games combat tended to happen in fairly enclosed spaces if there were hostile creatures where you were there was going to be a fight and that fight was going to end with stack of bodies on one side or the other and open exploration zones changed the rules in
da2 in this example here there's no there's no walking away that Hurlock train coming over the hill they're gonna chase you forever until you run into the area boundary and then you're gonna fight them and there's going to be a stack of bodies on one side or the other however when you're in a big area like one of our explore zones the player often has the chance to try to walk away from a fight either because creatures you know they're they're just defending their home and they'll leave you alone if you walk away far enough or perhaps you don't even want to get involved in that fight you need to be able to walk up and determine whether you want to even engage the battle or not so in addition to those sort of game play facing concerns we also had very pragmatic technical reasons for having to assert more control over where fights could happen because we had to stream these big giant areas and there's a risk if the player can kite those her locks all the way
from their origin point then they're going to get streamed out because they belong to that part of the terrain where the player was and and now we've we've streamed them out we've even streamed out the terrain underneath where they came in we could also get into bad situations where if you can manage to taunt enough creatures onto you and attract the attention of enough of these encounters then you could run out of memory budget and remember we're dealing with gen3 memory budget here so things things were pretty tight before we had a solution for dealing with this and in addition to being bad for performance as I say this could lead to really frustrating gameplay situations and we needed level designers to have tools to be able to control and build the specific kind of experience that matches the themes and the story and the gameplay challenges that we're trying to create so here's an example of a very simple encounter that we built in our level and there's the tether volume that the designer has
dropped down on top of it so on the AI side inside our tether system we have three simple rules in the first rule as you can see is that you can't leave any creature who's attached to a tether their movement behaviors are aware of that tether zone and they won't pick points they they'll never pick a destination point that's outside that tether box so the creature should never be voluntarily moving outside its tether zone in addition any target inside you might Heather box is better than any target outside the tether box the aggro system is aware of tethers so that a creature is able to choose targets that are less likely to drag them out of their target box and if they know that the creature that they're that they're looking at is outside their tether zone then they can choose to do things like walk home rather than continuing to engage or chase a creature who's outside there our area of operation and the third rule is
it if you ever end up outside whether it's because the designer changed you that your active tether box in game play or if you got knocked out of your tether zone by a combat effect if you ever end up outside stop what you're doing and run home run run back toward your spawn point or your your tether point until you're back inside your box before you could do anything else and so with these rules in place and the editor tools to support them level designers could build encounters with reliable expectations of how creatures were going to behave and how they were going to move around and related problem we had was where tether volumes solve the problem of where creatures are allowed to go in a really broad stroke set sense we had hazards where creatures shouldn't go that despite being passable despite being
things that you could run through you really shouldn't be standing in those areas you want to avoid those fires on the ground barriers traps all kinds of stuff that in Inquisition with our big organic environments we had a lot more of this kind of ambient hazard in da2 we didn't really have this kind of thing happen a lot if there was a fire on the ground it was usually there for one of two reasons one is because it was a specific gameplay challenge that you as the player were expected to deal with so don't stand in the fire well if your guys are in the fire pull them out and the other reason or the other possibility was that it was something that you had placed down that creatures should be standing in and taking damage rather than very smartly running out and negating your AoE attack so the other twist with Inquisition where we have more of these organic hazards is sometimes they can appear spontaneously things can catch fire the dragon can
light areas of the ground on fire in combat and something that was safe five seconds ago a good place to stand can become somewhere that you really don't want to stand for an extended period of time so we needed a way to keep AI creatures out of these areas the first thing we did was at a path finding obstacle so you can see that big yellow chunk superimposed on top of the bright green navmesh and that kept creatures from ambiently wandering into the fire and going out hot Oh hot and that was okay it meant that creatures wouldn't discretionarily walk in or they would avoid it on their way around the world but we needed something a little bit stronger because as I say these things could appear under your feet and we needed a way to motivate the AI to actually move if they ended up inside one of these and so we created this tool we call a fear zone and the fear zone unlike the tether zone only has one rule if you're in the fear zone go somewhere
else so inside the prefab editor for for our ground fire here you can see we drop in a fear zone which is just a spherical bubble that says to the AI if you're ever inside here run out and you can see in the debug draw there for the in in the middle of gameplay it shows up as a kind of a blue sphere hopefully it's contrasting enough on the display that you can see Varrick is standing in the middle of a fire there and he's the AI is giving him a cue telling him that he should move out of that fire rather than standing in it despite me having ordered him to go in there five seconds ago for the purpose of demonstration so with fear zones designers have a tool now to motivate creatures under AI control to move away from some area of danger and this actually works using the same movement behaviors as the prey flee behavior that I talked about earlier so we have a consistent set of tools for saying okay
anything that you're trying to get away from yeah here's fine here's a way to pick a point and move away from that direction and as it turned out this fear zone tool is also very useful for our open world game play and that gave us a tool to draw down around you know camps and settlements to keep ambient hostile wildlife from wandering through the middle of the village and this created a problem that I called standoff in bear town so this can require a little explanation a little background for those of you who've played Inquisition you know that bears are tough and the reason that bears are tough is that bears are balanced for a four-on-one fight because the Bears have to stand up against a party of four rather than rather than rolling over like most of the other creatures that are designed to be encountered in groups and there's a corner of the hinterlands explore zone that is just packed with bears I called it bear town during development and
there is luckily there's an inquisition camp there's a there's a rest and resupply area in that part of the map where you can go after fighting a bunch of bears and getting getting slapped around and you know revive your party members resupply your potions get healed up and the Bears are kept out of the camp by the fear zone that we drop in around the camp so you can see there's a big 30 meter bubble around the camp area in the level editor there that that keeps the Bears out if they they come they try to come inside they hit the fear zone and they leave but the problem with this is that if they're actually trying to actively move into the fear zone because you're in there then they ended up bouncing off the edge of the off the edge of the fear zone and oscillating and just wobbling back and forth there and that's no good meanwhile the player as long as that bear is there and hostile the player is
not allowed to interact with any of those resupply items they're not allowed to do anything interesting in camp and so they're stuck there they're inside the bear can't come in but they can't they can't leave they can't fast travel there's no way so they're stuck so the first thing we did was we changed the AI so that the AI is blinded to anyone who's in a fear zone that they're that they're responsible for so the bear now could no longer see you the bear no it wasn't trying to bounce off the fear zone anymore you just sit there staring at ya waiting so we ended up having to clarify the game rules so that the party was allowed to drop out of combat even if there was a hostile bear there as long as he wasn't actively targeting somebody in your party that you would be allowed to use the camp facilities despite there being a bear
sitting out there waiting for you to come back and by solving these problems we were able to achieve a pretty good gameplay balance between having aggressive threatening dangerous wildlife and basic player survivability we had to give them a way out now let's talk about a problem specific to our player party pathfinding relative to our previous games we have a much more open and permissive movement model you can jump over gaps you can jump on to obstacles you can scramble your way up onto things and in some cases you can find your way off of pathfinding so you can see an example here that bright-green navmesh sweeps around and everyone else in my party down in the right hand side of the screen is standing on the navmesh but I managed to jump my Inquisitor in the left hand side up there onto an island where there's no path finding data which is good because it means that the player isn't stuck trying to you
know use physics movement to jump up on to audio obstacles and get somewhere that it looks like they should be able to get the players movement isn't constrained by the AI parameters but this is a problem for us when we're trying to get everyone else in the party to follow you because the player can go places that the AI just has no way of going and so this led to a couple key scenarios that we had to solve here's another example you can see I'm controlling the Inquisitor there in the middle and you can see I'm up on a rock in the middle of the screen where there's no path finding data if I switch to another party member like Iron Bowl over there on the side then I can grab control of him I can drive away and I can leave my Inquisitor up there on the rock and well they have no way of a no way of getting naturally back down off that rock because there's no passing data so what happens in our game is when you switch characters whenever a
character becomes AI controlled they get teleported and for the sake of player experience usually this gets covered by the camera transition or in really severe cases there's a fade through black to cover that to cover that teleport up and if you played the game and you never notice this happening success but this gives us the reliability that we need to know so that even if I move and switch characters no one in my party is left in a situation where they are off the navmesh and stuck so whenever a party member becomes AI controlled teleport to the nearest point on the navmesh and ideally the player never notices this happening the other situation that we can get into is involves traversing a terrain that the AI can't cover so you can see in this example I'm down there at the bottom of the screen I've just jumped off the
cliff and I left my party members behind and what this means is that when I land at the bottom of the cliff if you could see them right now they're up there they're there behind the cliff wall there they're gonna start taking the path that goes around and coming back down the switchbacks to get back to where I've just gotten to I I mean yeah Culley shouldn't jump off that cliff you probably take damage hurts when you fall but still I'm now in a position where I can get a really big head start and if they get stuck on other paths finding data or or if the if the path is is long enough I can outrun them and I can potentially run far enough away that they're outside the streaming chunk and then the ground stream zone underneath them and they're in for a world of pain so if the player ever out runs the AI we have a leash distance teleport that we implemented party members are have a maximum distance that they're allowed to be we teleport them in and again when that
happens we try to cover this by bringing them in behind the camera because if I'm if I'm running I'm in front of the camera everyone else if they're if they're following me is probably behind the camera anyway and so this happens again if you never saw this happen in the game success and in some situations we disabled or we expand the range of the tether if it's a puzzle area that relies on on separating your party members and positioning them in different parts the level typically we know that you're going to come in and go out through unknown access so we can gate and we can say okay it's safe here to turn off the tethering because we know that you're in this specific area and in combat to give more flexibility for positioning your characters and and giving you more tactical options we we grow that that leash range but at the end of the day with these fail-safes in place as as as inelegant as they may be if you notice them happening we had confidence that party members couldn't get stranded by
weaken at technical weaknesses in the pathfinding system the other problem that i want to talk about here about party in the big open world is our party aggression rules our party when we started had fairly opportunistic targeting they would see somebody who was fight able based on and the rules from our previous titles if they're fight about if they're in a hostile faction i'ma fight them but again we wanted to give the player control over how they would engage in these kind of situations without your party necessarily picking a fight that you weren't interested or ready to take part in in a fairly target-rich environment I mean there's wildlife everywhere they're all fight able you can you can go hunt hunt nugs if you really if you really really need an UGG skin leather but what you probably don't want is your party running off and hunting nugs on your behalf when you were trying to accomplish something so that's more
obnoxious than than punishing bringing the Bears down on your face but the party shouldn't be spontaneously attacking things we need to put that control back in the hands of the player so we came up with some rules for party aggression which says that you're not allowed to engage you're not allowed to take the first swing or use a using offensive power until someone in the party has done damage and you can see I can't do damage until somebody's then that would just means the player has to be making that choice or if somebody in the party is taking damage which means that the fight is already on me I've been I've been jumped and and the party is allowed then to engage spontaneously without waiting for a go order there's another test that takes place here to only target creatures that are targeting someone else in the party because again in Inquisition in especially in hinterlands if you play this when you go into that zone you see create groups of other creatures that are both hostile to you there's
mages there's Templars there's bandits and they'll be fighting each other there'll be bandits fighting bears etc and they're having a little fight out in the in the distance and previously the AI would go yeah that hostile there in combat I'm gonna go at them and we needed to make sure that even if even if you were allowed to engage you even agreed to pick a fight with this group of characters here that you were fighting then once that fight was over your party members wouldn't take off and and go bloodlust on on that group over there if you weren't ready to engage them and so with these rules in place the player now has the control that they need over how their party members under AI control engage in these open-world zones now I want to talk about how we solved one of the biggest challenges with our party ai and Inquisition around ability selection by creating what we call the behavior decision system or BDS so if you hear me talk about the BDS behavior decision system same thing and
the challenge is that we have a lot of abilities on these creatures the party members can have up to 30 some different active abilities per class and they can have up to eight of them mapped and loaded on any given character at any given time the player is unlocking these as you play through the game we're ad removing abilities from characters and when we started building our static decision trees for building out our party AI we realized that we had while we had a couple problems first we had a technical problem so you can see here this is an example of something we would have started with where I have a sequence and I'm gonna choose and I'm going to say okay can I do long shot yes I can do long shot long shot it's a good idea okay second choice can I do stealth if I didn't want to do long shot can I use my stealth ability and so on down the line which again we had a technical problem
and that we couldn't add and remove abilities from this data structure in a really in a really good way because things had to come in an order and they had to be somehow slotted into the hierarchy so we we tried this next we said okay let's add all the abilities so there's a master rogue ability table that says you know that has all of the abilities that this character could have ever and then we're gonna we're going to conditional eyes them so that when they if they're not loaded then we're just not going to take those paths but we still end up with a conceptual problem where long shot might be a good idea there might be a good you know it's reasonable that right range whatever but we might be in a situation where throwing blades is actually a better choice to make at this point in time and so either we have to be very specific we have to build the evaluations in this structure so that they're
they're very specific and I'm only using long shot when it's absolutely the best thing I could do and it's not and it's not potentially you know worse than anything else that could happen down the line or we need a different approach and we thought well what we'd really like to be able to do is say okay we're just going to evaluate all of our abilities we're gonna we're going to bring everything in we're gonna rank everything we're gonna find what the best option is and then we're going to do that one but this required changing our architecture and thus the BTS was born so the behavior decision system splits our AI evaluation into two phases the first thing we do is evaluate all our options and then the second thing we do is execute whatever the best the best choice was and so this means that every ability itself specifies two sets of logic one is the evaluation which says why or when it's a good time to use this ability and it also specifies a chunk of
execution logic that says okay once i've chosen to do this i need to move or not to get into range and then execute and we'll walk through an example here so this is the evaluation tree taken directly out of the level editor or the rather the game editor for that long shot ability and there's some preamble stuff off to the left-hand side that basically says is this a viable ability right now isn't off cooldown is it disabled is there is there any reason why it's a bad idea to use this right now okay we've dealt with that so we're gonna give ourselves 20 points right up in the first slot there we're gonna give ourselves 20 points because this is a pretty good ability to use right now now the next thing that we're going to check because long shot in the game rules says that it's better the further away you are from your target when you're using it so we're gonna check and say if I'm
at medium range for my target I'm gonna get myself five points and if I'm even further away then I can get myself another five points so that I get a give a full thirty point score for this ability and we'll talk about what that means in just one second and then I'm also going to be able to give myself an additional ten points if my target or rather if this ability has been set for this character by the player to be something that they that they prefer this character to use so once that happens we score that ability and we realized that we needed a set of rules as we were building out these evaluations so that we could be consistent in how these things are being applied so you can see passive movement things that just move me around the battlefield are the lowest priority basic attacks are always sort of you know they're always a pretty good idea if I can use an ability I should use that over a basic attack support abilities get a bonus score they get a little bit of a priority bump they start
at a twenty five base line rather than twenty because typically they're things that either need to respond to a bad situation that's come up or something that I want to use ahead of combat at the start of things to repair and so they get a little bit of a priority bump to make sure they come out first or they come out when they need to and then we have reaction abilities that really need to be used on time and we'll cover those specifically but those are things like blocks and dodges that I that have specific frame requirements around when they need to be used in order to be useful at all so you can see this is kind of how things get get ranked and rated and we build all our our evaluation trees in this framework then we break down inside those ranges ten points that ten point range five points for medium range five points for long range for long shot but we have ten points of dynamic range for comp for context is this a good time or a bad time to use this ability and then we
have that ten point tiebreaker where the player can put their thumb on the scale and say I want this one more often which means that we have a twenty point range for pretty much all of the categories of ability and we've completed our evaluation now we've gone off we've run long shot we've run a bunch of other things that we have on this character basic attack comes in at ten poison weapons we run our evaluator it came back at twenty five caltrops came back at twenty two and full draw is in our ability list but it's on cooldown right now so it just evaluates out it gets clipped by that preamble healing potion we evaluated it and it just said nope I don't need I don't need to use this right now I'm at full health it's okay so we can have evaluations that just punch out early on without even returning a score but when we look at the scores we say okay long shots the best choice right now so let's use that so we move into execution so the next the update we start running the
execution tree for long shot which handles the movement and execution part of that AI decision loop we've picked our ability we've picked our target we've picked our ability and now we're moving and executing so we're going to test to see if we have range and if we have line of sight to use the ability and if we don't we're gonna move until we we get those we're just going to move towards the character assuming that at some point we're going to achieve line of sight and we're going to get into the right range once we get those then we fall all the way through to the end there and we're able to actually fire the ability itself play the animation fire the projectile do the impact all the good stuff that comes with actually using this ability and then in the bottom right hand corner we just make a note to set ourselves to hold position so that we don't keep moving toward that character once we've achieved line of sight and the appropriate range to use
and it's important to note that while this is running if I didn't have line of sight and and range when I started while the ability well the execution tree is updating and moving me toward the target I'm still able to run that evaluation I'm constantly re-evaluating all my choices so if something even better or some better option comes up off of cooldown or if I end up in a situation where I need to react quickly as long as I haven't actually triggered the animation yet I'm still in a position where I'm able to react to those changing circumstances and start evaluating a different execution tree for a different ability on the next update so let's see where are we at here and an added benefit of the way that we implemented BDS as a general system for scoring behaviors is that we can also add movement to the priority evaluation we can use an evaluator to check whether the character is in combat and apply
different movement parameters by using the behavior tree controls over movement and you know for example an exploration characters have a tighter follow so that they stay closer to you so they're there when you need whereas in combat characters can hang back a little more and spread out so that your melee character can can lead and your ranged characters and your casters can fall back behind the other way that this works that was a big advantage is that we were able to use this for things like tether and fear zone where those behaviors can come in and they can override in the priority system anything else that characters doing they can come in at priority 100 and just stomp anything else that the character is doing until their conditions are resolved until I get back inside my tether I'm doing nothing else few zones as I say work the same way so recapping behavior decision system I can add and remove abilities now at runtime and I can do that without having to pay attention to the evaluation order
because we've come with a scoring system that means that the right ability can be scored regardless of whether it's the first or the last thing that gets evaluated and we've done it in a way that leverages the existing library of functionality we get a big win because we've built this library of decision tree evaluators and task nodes and functionality to build really really complex logic and we can still use that in the eval and the exact parts and we can also you know we have a whole set of target picking stuff that happens just in every AI update so this integrates directly into the decision tree architecture that we've built so we have a powerful tool for AI decision-making it allows party members to effectively choose between a whole array of very situational abilities and make pretty good choices I did say that I was going to call it reaction abilities specifically because they had an extra piece of logic that we needed to build for them we introduced this new class of
abilities in Inquisition we didn't really have these in da2 or in origins and their active reactions to damage that's coming in that allows you to actively counter that before you take that damage and so there are things like parries which are a reaction that gives you an advantage from our point of view so I'm gonna get a hit back out of it a block is a reaction that's going to counter that damage but it's still going to leave me in place and then the most extreme is a dodge where I'm going to react by actually getting out of the way of that hit before it lands but it's the most costly in terms of loot it loses my battle position and now I'm gonna have to reposition and and collect myself so we want to be able to use the right reaction for the right kind of incoming hit but we still don't necessarily know where that hits coming from so we had to add what we call attack Telegraph's so this is the actual combat collision that we're looking at here that set of green spheres for our Qunari spearmen for one of his his spear thrust attacks
that's the combat collision that happens on say frame 20 of the attack and about 10 15 frames before that happens we drop down a really broad collision box in front of him that allows him to notify anyone any other character who's standing in the area that's about to be hit that there's a hit coming and it's something that you could maybe you could block it but not necessarily parry it and in addition to sending that information it also includes the positional data about where he's standing so that I the character who's reacting knows which way to point they're their reactions so their block or their or their dodge which way they need to be moving to get away from the incoming damage and these reactions as we saw on the priority slide they come in at extra high priority they override anything else that that character can be doing and this was very successful it was too successful because we put this on for example our tank characters who
have an active nice active shield block it completely nullifies most incoming attacks from that front arc and they were able to use it with frame perfect precision against big nasty enemies in the game and defeat them you know over a period of time because they had to get their parries and their counter-attacks in well between between guard but they were the AI was able to defeat really tough enemies without taking any damage which sounds great we win we win at AI my robots are best but the problem for the player is that this really incentivizes the play to let the robots do the fighting instead of participating in the combat and and sandwich sales go up because people put their controllers down and walk away so what we ended up having to do is we added shared cool-down so that every ai-controlled party member when there when the AI is choosing to do these things there's a two-second wait
that they have to do between using one of these high priority reaction abilities to level the playing field and to give human players a reason not to just let the AI do what they're doing this is an AI specific cooldown it doesn't affect the the in-game cooldown system it doesn't affect a player using these abilities it just gives the AI a little bit of a disadvantage they're still able to react quickly but they can't get into that toe-to-toe perfect parry perfect frame perfect blocking situation so the AI is able to use these reaction abilities without outclassing the player and creating a negative play patterns we also need the player to be able to customize their party AI we've created a pretty good baseline experience where the party as soon as you give them an ability they're able to to use it fairly competently but we want to make sure that the player is supported by their AI characters in the way that they want and that when they customize the AI the decisions that
they're making the choices they're making are going to be observable so we wanted to give them big chunky levers that we could use so that they can see those results in the game and know that they're making a difference and getting them to play the way they want and so the first level of control as I mentioned is just what abilities do you put on the character you can choose which abilities you map and the AI is only going to use the ones that are mapped which is a change from our previous titles those abilities are available both to the AI and to the players they're at control so as you're switching between characters are going into attack cam you can use all those abilities on the character and then we give you an additional layer of granularity that the AI is able to either disable so that ability is still available to a player who's controlling that character or veil take as an order intact ham but the AI is never going to pick this ability for themselves so if it's something on a long cooldown that you're saving for an emergency or it's something that
consumes a depletable resource you want the AI not to be spending that on its own discretion enable is the default choice where the AI is going to evaluate it in priority sequence as we just went through and you can also set it as I mentioned before you can set it to prefer and that just puts the thumb on the scale so that that a that that ability rather is going to be executed more often it's going to come out at higher priority in the evaluation and in some cases it also widens the ai's rules for when that's an appropriate ability to choose so if an AoE ability perhaps says that I need three targets around that character in order for this to be a good choice it might drop that to to Hana me AI characters in in that area of effect so that that ability is just going to come up more often it's going to be used because the player wants it to them to use that ability more often and the other interesting setting I want
to talk about is the targeting behavior that the player is able to customize again choose target its usability move and execute those are the four important steps in our AI evaluator and so the player is able to influence how the AI follows or how it picks targets rather by choosing between either following a character because we want it to be supporting typically when the ad is running it's supporting a controlled character so we can either say track some characters interactions either the controlled character whoever the player is controlling chase them around and beat on their target or look into the aggro system and defend a specific character and counter threats whoever the whoever's targeting that character we're going to pick them off in priority so with these settings the player can set how the AI is picking their targets and picking their abilities in meaningful and visible ways we also needed to support the cat cam orders that the player is giving when
they're giving direct commands to their party followers so either as I say direct commands use that ability move over here or giving them behavioral orders that modify how the AI works underneath so in the direct commands move here usability these have a fairly simple execution they just run that ability as though it had been chosen by the AI and the I decisions making is suspended when the player gives an order we aren't we're not constantly running the evaluator in the background the AI is just going to be hard on target to follow that ability up until it completes successfully the other side is that the we have these behavioral commands that modify how the AI works under the hood like attack this enemy if you give this order as a bull has in the in the example there it overrides the entire target picking set of their AI and says that's your target every frame every update get that guy until he dead
hold position is more complicated because it has to affect both the target picking and the ability picking so that the ki doesn't get stuck trying to use things that would violate the rule that says that they have to stand here and it also adds a little miniature tether behavior so that if they get knocked off of that spot that you told them to hold in combat then they'll try to regain that position before doing anything else and we also have an order that allows you to basically implement the defend targeting that I talked about a moment ago on the fly so that you can adapt to situations on the battlefield and it works in exactly the same way these commands give the player control over party behavior without having to micromanage every action including city overriding the way that it picks targets in the big AI hierarchy now having implemented all of these things we've put all this stuff together we built out our behavior decision system we
discovered something that was actually a big win for us behavior decision system wasn't just good for party it was also great for our creature AI designers because we didn't have to manage an AI hook up table for each creature we didn't have to necessarily come up with the right evaluation order and and manage each creatures AI individually we could iterate much quicker on how each individual AI ability prioritize itself and how it executed itself and we could also focus on giving the creatures interesting abilities and moving them around between characters without having to maintain a master AI setup we could pull an ability off one creature and either add it or remove it from the other character and swap them around much more quickly using BDS because the the AI hookups for that ability come with the ability itself and we were able to create creature variations we were able to use this a lot in DLC where we we had taken the
creature archetype that we'd shipped in the game and we give them an extra ability as a little bit of a bonus it also meant that we were able to support really complex creatures like our dragons and Dragons in our game are big they touch every part of the combat system including parts of the combat system that aren't used by anything else they fly they do all kinds of crazy stuff and I'll show you the in-game debug from the behavior decision system so you can see there's 58 different abilities there's 58 different options that the dragon is evaluating at any given time and some of them are grayed out because they're just not applicable there are things that are state specific there's special movement in there depending on whether they're in the ground or in the air there's things they can only use when they're flying and we were able to use BDS to manage this complexity and break it down into chunks that designers could work on without having to necessarily eat the entire dragon shape burrito all at once so BDS
gave us a consistent data-driven way to prioritize behaviors across the game from simplest wildlife creatures to massive complex dragons while also supporting the complexity we have for our party members and giving them the ability to support the player in combat and on that happy note that's my talk I want to thank everyone here for coming out and listening to me go on about Inquisition for almost an hour now and I also want to thank Dave and Steve specifically for for putting this whole AI track together and inviting me to to come talk here I want to thank the combat team back at bio in Edmonton who came up with so many of the things that I have the honour of presenting to you folks today and yeah thank you
Inquisition is a very big game and there's more material in here than I could ever cover in an hour we've got two minutes for a couple of questions and then I'll be happy to talk to people outside in the hall after the talk is over over here on the right hand side please sir hey have you considered using the players direct input while they're installing that character have you considered using the the players decision while they're controlling that character as waiting in the decision tree later on when it's being driven by AI um we hadn't considered that specifically but it sounds like a great idea do you guys do any kind of load balancing of AI behavior selective decisions get calculated over frames or is everything always happening like for every frame that's a good question over regarding whether we do load balancing and yeah the AI evaluations are sliced over frames each creature evaluates their a I think once every three frames and so we split it up and some creatures get sliced down to 5 frame evaluation
one more question here over here in the yellow shirt please okay this is a question about the leash distance and teleporting the party member so I was just wondering about this scenario where you outrun your party and you have your camera pointed back towards where you came from does it look like the party members outran you they come in behind your direction of travel I think in that case so if you're pointing back in your camera and we can't solve for a good place behind the camera then they will pop in behind your direction of travel so it still looks you know silly but it is the the unfortunate reality of dealing with that and making sure that we have to account for their potentially getting lost behind thank you okay thanks thank you you
Auto-generated captions from YouTube — names and numbers may be misheard.
Game Developers Conference · 2026
Comments