Less is More: Designing Awesome AI for Games

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Wow ladies people here this is amazing I thought I was up against a clay talk so I figured nobody would be here this morning so I was in fact I was thinking of just popping over there if you guys have a minute let's be right back yeah all right get going okay hi I'm Kim I'm just going to flip my screen because as being a grumpy here there we go top secret AI notes here that you can't know about so up here now so loud you may know me as a nee tomato that is my online handle all over the place on Twitter and my gmail account as well so if you want to look me up that is me except on YouTube so whatever content is there zany tomato is not me just putting that out there I've been making games basically my entire life I think I made my very first game when I was about I don't know six years old so early eighties sometime and since then I've become incredibly fascinated by how it is we make games and how we as people react to games so my background is more specifically in how human perception works in games I have a PhD in computer science specializing in software engineering and AI and I also have an undergraduate degree in cognitive science which is basically an interdisciplinary study of the mind so if you like I pay attention to how people think in games and that's what I'm always interested in when I'm making games most recently I've been working on a little game called Rockets Rockets Rockets it's a game about Rockets I'm going to talk about it a little bit more in a moment but just picture rockets and you're probably getting pretty close but we're here today to talk about AI so one of the big applications about how the brain works and how we perceive situations is of course in how we perceive other intelligences and so I spent a lot of time working in AI systems big and small today we're not going to talk about academic AI which is a very kind of big huge unwieldy beast that doesn't tend to partial up and fit nicely into games instead I'm going to focus on some of the work that I've done around smaller systems and essentially what this is it's a very short talk so I'm going to try to give you as much as I can a dense overview of some of the key tips that I have learned through about 10 plus years of working in AI so we are all game developers in this room in some capacity we contribute to the wonderful thing that is video games and as game developers we have one job that job is to create an experience and everything else that we do is in support of that experience we should have never at any point we should never deviate from supporting that core experience and AI is of course no exception it too must be made to support this experience it is not about having super clever AI it's about what does it bring to the game that you're making what problems for you does it solve that you otherwise wouldn't be able to solve through simpler means and I say this as a lifelong AI developer I really like AI and I like all the complicated problems but it turns out simple is usually better so good AI adds a lot to a game it can take a game world it can enhance it it can bring to life a single play player experience in ways that otherwise you might not be able to it can be a great companion an awesome component it can contribute to the wonderful depth that is the visuals of the world the animation all sorts of different ways just AI impact our world there's been some really really interesting and clever examples throughout the history of games half-life 2 had some really interesting stuff and as well its counterpart the original it had a combination of scripting and AI that was used cleverly to avoid interrupting gameplay very well tweet well integrated with storyline and player enhanced the experience not perfect but nothing I'm going to show today including my own game is anywhere near perfect thief was all sorry about the low res image it's all I could afford thief is also a really great example it's showed AI actors that responded very realistically to light and to sound they had actors that voice to the current state so they were getting feedback constantly to the players neat interesting system Sims is another kind of a different variation on using AI but here you see clever abstractions being used to represent core human-like behaviors and as all of us being humans in this room it's something that we can respond to very well it's something that we inherently understand being human batei i daddy I know cookie get it it's only gonna get worse from here hang on bad I of course is a threat to flow in immersion it breaks the very thing that we are setting out to do with our games to create that experience to support that core experience it's a distraction right it's the hey guys listen through the entire to the entire game now we all have our war stories right you know there's the Oh Dead Rising right where you've got the you give a survivor a weapon so zombie game give a survivor a weapon and they're like been brilliant I was running for my life but allow me to stop and fight every single thing on the way now because that makes sense or Starcraft you know you got your troops clogging up choke points Mario Kart some of the crazy rubber-banding you know again none of these things are necessarily wrong it's just in their execution they are breaking what is supposed to be the core part of the game now sometimes it's funny for those of you who aren't familiar with the basket trick you can find a basket at your favorite local shop in Skyrim and you can pick it up and you can put it on the head of the shopkeeper and then you can proceed to rob them blindly and that's basically what they'll do so hilarious right I mean huh it's pretty funny but it's not really canon it is not really in support of this wonderful rich world that they have developed and sure we can have some fun with it but you know the fun has a limit one of my personal favourite games I used to in when I was in university I spent my time on the double-oh-seven speedrunning this game that was just what I did for for relaxing and nothing was more painful than an Italian level trying to shepherd her to the end of that level was just like I'm finally finally wrapping up the therapy from that very very difficult and it's still interestingly still one of my top ten games of all time so what I want to do today is I want to frame AI in a particular way I want to frame it as a perception problem it is how we perceive AI in the world that actually governs the quality of the ad not how complicated it is behind the scenes not all the clever tricks that we have done not how it might hold up against you know deep blue or whatever the current best chess engine is etc how well it does on Jeopardy all we care about is how the player perceives it in the moment that's what we are trying to control it is our job as game developers to manage that perception but before we do that we need to know a little bit about how the brain works so let's segue a little bit into the brain there are a ton of things you actually need to know but I'm trying to pull out a few salient elements that I think you want to keep in mind when you are creating a eyes the first is that brains are incredibly stubborn we are not at the best of times very good at fighting our natural tendencies I never tried to break a habit ever tried to quit smoking or you know whatever say um too much while you're talking all of these things are incredibly difficult to do we're worse when we're in a flow state which is hopefully where players are going to be our brains are hard-wired to find patterns we can't help it as a culture we talk about stereotypes as being an incredibly negative thing but there's a flipside there's positive stereotypes are what allow us to efficiently navigate our world to deal with the onslaught of information that is always being fired at us at any given moment especially in today's modern time unfortunately it means we suck when it comes to random at small scales because we're so intense intensely bound to finding a pattern that we will find it at even the smallest thing now you can actually embed some form of personality in repetition etc but generally it's set as a flag something is going wrong when there is repetition there are some things that we tend to repeat you know if you come over here and you punch me in the head I'll probably say ow then maybe a few other things and if you come back later and you punch me in the head again I will probably say oh and then WTF but the owl part is consistent it's ok that I repeat that but very rarely are those there are those kinds of gems that you can repeat and that includes visuals and all sorts of things and that's because things stand out if they don't fit our entire brains really are giant pattern matching systems which means that they are very good at policing when something doesn't fit a pattern everything that our brain wants to do is take a look at everything around us and fit it into a pattern if you guys grew up watching Sesame Street you know this was one of our earliest victories right you guys come on sing it with me one of these things is not like the other it's all I know we anthropomorphize brains attribute human-like behavior no matter what they also attribute intelligent behavior to hmm interesting if brains are automatically going to attribute intelligent behavior maybe as AI developers we should just get out of the way of the brain they're also storytellers by the way for those of you didn't go to the clay talk it's about invisible ink but that's a hat from don't starve so so games will games bigger friend brains will take the most flawed input and they will weave it into some narrative our brains do not work like our memory in our computers we do not have discretized memory slots into which we fit different components it's nothing like that it is really a schema a series of schema for weaving together narratives if you've ever looked at any of those those self-help books for improving your memory and they talk about taking different objects and weaving them into a story that's why you're leveraging what your brain naturally does scary thought they're so good at weaving narrative and our brains are so afraid of holding contradictions and cognitive dissonance and all of those crazy things that our brains will actually unconsciously shift our memories so whatever we perceive at reality at any given moment is only the reality that your brain has decided to show you in that moment so sit and think on that when you're falling asleep tonight it's disturbing speaking of disturbing so a lot of you have probably heard of the uncanny valley the uncanny valley is when we start to get something that is lifelike enough but not quite enough it's looking more and more real enough that our brains are starting to put expectations on just how real that should go and yet it's not quite there and so other systems in our brain are going woohoo something weird go I should avoid that as game developers this means that as you increase fidelity you increase your responsibility to uphold that fidelity this means different things in different aspects of games but in particular in AI the more you model the more likely something will stand out as artificial to your brain you guys seen this before it's great right it's still funny to me I just I always love this so what the heck is going on here so good right so good so good so this is creepy Watson if you weren't familiar with this so once then is of course behaving strangely if even if you were to flip the camera around and he looked like this right that would be more believable because now there was an opportunity to weave a narrative around how he was getting to where he was going but he's not right he's just doing all of these crazy creepy things he's teleporting around the room it breaks our expectation because our brains are trying definitely they end up with dramatic music will kill that the only one that they end up with is of course this creepy character there's just we can't resolve it so that's a great example of the fidelity that we were set to expect given the world etc he even turns his head to follow is messing with our brains and setting our expectations too high that this current demo is not not delivering on so really a suggestion of behavior is much better than a complex model brains will assume that the complexity is there most of you probably played pac-man or at least seen it for years massively complex behaviors were attributed to the four ghosts what does it inky blinky something in Clyde inky blinky sleek add-on or whatever for ghosts then there and it turned out that on the grid each ghost really had a home spot and the home spot was a corner set out from the actual map that you as a player could Traverse and then I had little behaviors for switching between chasing and evading etc but really when you boil it down it was an incredibly simple series of steps that we're driving this that gave rise to what otherwise seemed like highly complex behavior you don't need to do a lot but it's very important that this be consistent with the players mental model now you are in control of your player but you are nonetheless setting them up to be receptive to the world that you are trying to create believable believability in you are the one that is in charge of mitigating the distance that sits between them and their screen in such a way that they are able to get pulled in and nothing at least very little is going to interrupt that so steam burns isn't a game where you flying around and you're trying to maneuver yourself such that you can shoot down your opponent and the AI and this one this was written by Andy Moore's like right there yeah yeah and this one again is not a great example of a very straightforward simple system and yet it was perceived as very very complex and he tells a really great story which I'm going to bastardize since he's sitting in the front row where he had a class that was assigned this game to deconstruct the AI and these poor students were working on it and working on it working on it just this I'm an like how how did this work this is incredible I can't we can't seem to figure this out and so the professor did the only thing that a professor we doing invited Andy in to talk to the class and as Andy was taking a closer look at the AI he realized that he had transposed the X&Y coordinates he said oops but why did this work because it fit the players mental model even though it was actually a typo undocumented feature it worked with your expectation of how the game was supposed to work contrast that with my recent game of Dragon Age Inquisition which I love by the way I don't mean to slight the game this doesn't fit my mental model I don't know about you guys but chest surfing is not usually present in these sorts of worlds one thing that that I think Dragon Age does get very right they get a lot of things right but in particular relevant to chests is most games historically just you know leap chests out in the middle of the wilderness unattended they at least assign somebody to guard it it's kind of I mean yeah anyway you get my point so we're with the brain do less get more less is more or less is more or less is more so let's come back to AI as a perception problem what does this mean for us distill your AI needs what are the broad sweeping behaviors that you need start simple resist complicating I say resist complication in and of itself or more complex systems isn't necessarily bad and may be right for you depending upon the game but resist the urge to just jump into something more complex start simple use the brain I'm wearing Star Wars shoes by the way just I hope you appreciate it so let's take you through an example this is what I did so one of the I did a bunch of different things on Rockets rockets rockets one of the things that I did was I wrote the AI for it if you are not familiar with the game it is dogfighting meets figure skating in space if that wasn't clear it is a fast paced game of rocket tag I grew up in the 80s as I alluded to earlier so this is very much for me and I won't speak for the other team for the rest of the team but it's very much a tribute to those games that I grew up playing like colorful games I loved Tron when I was a kid I liked things that challenged me that are worthy of my time to spend with my friends or even just to the little bit of actual gaming time that I get these days to spend it on something so I was trying to go for that it's a couch based multiplayer game it is very fast it has a lot of momentum you just push in the direction that you go but there's a little bit of momentum that you need to counteract so it takes a bit of learning it's very close dogfighting you're bumping into things I'm going to show you a quick little video of it see this works dog fighting these figure skating in space told you and this is Stanley this is the AI that I wrote so Stanley parable is one of my all-time favorite games and I was playing a lot when I was working on the AI and I decided to name the AI Stanley so if you haven't bought Stanley parable you haven't been Davey written his amazing go by that go meet jay-z fantastic so I set myself three rules I said always have a working brain all behavior must be controller based so effectively think of that like I wrote a controller API so that anything that the player had to do which naturally would be done through the controller Stanley did as well and respect the player I was not going to pander as well it's a lot easier to make your AI easier later it's incredibly hard to write legitimately challenging AI so here are the steps that I did first step watch people play this is something that I think is often overlooked but you need to know how humans play if you're going to make something that looks like a human and I wasn't just trying to get a sense of how people played I was also very interested in how other people might expect another human to play or not play and I started to form from this a general idea of what an AI opponent would look like now bear in mind this was a very early iteration of the game and there were lots of different things that were wrong with it but it doesn't invalidate the step of spending time with your game to figure out how humans are interacting with it I defined some broad behaviors that were happening on the screen avoiding if that was a little bit confusing it's just sort of like going the other direction but you know chasing evading just kind of looping around ramming in and I started stupid don't get me wrong I really want I had all these grandiose plans for this incredibly complex system and I really really wanted to do something complex but I started stupid I wanted to give the brain the best chance to weave its own narrative I wanted to see first what it did before I stepped up oh no no no AI engineer I got this and got in the way of the brain you can obscure intelligent behaviors that are naturally emerging if you goo complex too fast this is the very first version of Stanley it just follows the player when I push this bill my teammates were like whoa how long just been working on this this is great I said yeah I'm onto something excellent excellent got a little more complicated just don't don't worry I then took that and I started studying it for appropriate and any inappropriate behaviors I didn't care that my algorithm was stupid I cared that I created a simple model free of confounding factors that I could see what then went into creating an intelligent component and there all sorts of things that I noticed that we're going crazy I'm just going to go through a couple of them you can go back through the slides later and take a boo at that so one of the big important things is intelligent randomness I mentioned earlier that the brain detects patterns like that we're always on the lookout for patterns which means that you want to use things like normal curves not uniform distributions because you know generally things in life are the result of multiple contributing factors and if you think about rolling dice there are a lot of different combinations that add up to the same values which gives you a bell curve so your randomness should be more natural just in doing that but also you need to ask yourself that just because something was awesome once does not mean it'll be awesome the second time the second time the players brain might go wait a minute seen this before normal into swear sorry now I caught myself not taking my own advice I wish I had been to this talk before I started this this is really just for past Kim I haven't worked out the details of how that's going to work but so I went complex I actually started with a nav mash and I was screwing around with it for way too long I was getting really ticked off and I couldn't make it work it's just the behavior was a natural Stanley wasn't behaving like the humans my own man maybe all these years of AI don't know what I'm doing in it take away my peach de and slice it screw it toss everything new can pave baby new can pay so I took it all out and I switched to Ray casts that's it that is that this is my top secret reveal of all of GDC that's all Stanley's navigation is it's just ray casts now why do the red cast look like this well I thought about humans again what if humans do we tend to navigate on the basis of what is in front of us we bigger broader farther reaching judgments on the basis of what's farther up and less so about here we really only need to fit ourselves around things we don't need to be a world all the way over there Braille and also because the game was fast-paced people were naturally looping around and bumping into things and so I wanted Sandlin to do that too because if he was too perfect people I can't sorry I reset it once it kind of the game also has a very natural dance that emerges you're swooping in you're swooping out you're swooping all over the place I wanted to take advantage of that it's very easy to do repetitious things in AI so I started out with an algorithm just that had him doing loops so I mean I I slightly lie it's raycast plus some some behavior patterns right I have a hierarchical state machine driving all this under the hood ah but I was able to hide those things in the natural repetition of the game because I had studied the game in the way so many people played I knew that this was going to work and then I ated it's my favorite slide right wasn't it cool she really liked that and it seemed to work the game is currently on Steam early access if you want to give it a try it seems to have passed the rocket Turing test yes I know that's a Turing machine not the Turing test but I was just so proud of the slide that I left in it I do know the difference catch me that wrap up room if you want to talk about it uh people thought that they were playing humans again and again and again and again and holy cow if that doesn't feel really good and just to wrap up I'm gonna share some quotes really enjoying online multiplayer but I'd like to be able to choose who I'm playing the game is local multiplayer only and only have her husband so this is again oh my god time passes crazy fight wow this AI is actually where the opponent can't talk various let's play videos had some Incan incarnation of this very strips is a complex hunting evasive responsive and vindictive behaviors that I never wrote great AI update Wow this AI thank you and my personal favorite a lot of variations of that one so he's challenging he's definitely challenging okay rapidfire a wrap up support the core experience watch people play and get in their heads identify broad behaviors not intricate detailed ones that are probably going to collapse on closer inspection by the smart little brain thing anyway start simple resist complicating the AI figure out what your brain and your players brains give you for free and work with that try going simpler before you go complex remember once an AI has done something stupid is incredibly hard to overcome that bias commit to something simple easy to do a good job something complex you screw up thank you you
Info
Channel: GDC
Views: 86,688
Rating: 4.9037938 out of 5
Keywords: gdc, talk, panel, game, games, gaming, development, hd, design, ai, game design, programming, fantastic contraption, radial games, kimberly voll
Id: 1xWg54mdQos
Channel Id: undefined
Length: 24min 55sec (1495 seconds)
Published: Sat Oct 08 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.