Sie sind auf Seite 1von 3

Alex Why don't you start by telling us what your goals were for the AI?

Because it's pretty obvious how the game came out, and it turned out really well in the end... But what did you start off with as the vision or as the driving motivation for the AI? Christian For UNCHARTED 1 we had really big goals, then we had to scale back immensely to just get the game out. So, as soon as UNCHARTED 1 was done, we really wanted to make the AI "traverse." That was a big thing: traverse much better. Not only traverse like the player's doing, up/down buildings, like have attacks from multiple platforms, to be able to move down to where the player is and also follow him up to other locations. But the big thing was, for those who have played the game now, the train sequence. We're basically moving the platforms that the AI is on top of, at 60 miles per hour through the environment! That was a total engine refactor actually; we needed to change the entire engine to support traversal in different spaces and that was a big undertaking. But it was fun. Alex I'm sure you must have really loved the designer who suggested that one!(laughter) Christian It's pretty much an everyday thing at Naughty Dog, they push the envelope every single day. I think that's what's fun about the people I'm working with: we're rarely say no specially not in the beginning of projects. We'll try everything out, and in this case it worked out! There were no really technical difficulties, it was just a lot of work. Alex Why don't you start by telling us what your goals were for the AI? Because it's pretty obvious how the game came out, and it turned out really well in the end... But what did you start off with as the vision or as the driving motivation for the AI? Christian For UNCHARTED 1 we had really big goals, then we had to scale back immensely to just get the game out. So, as soon as UNCHARTED 1 was done, we really wanted to make the AI "traverse." That was a big thing: traverse much better. Not only traverse like the player's doing, up/down buildings, like have attacks from multiple platforms, to be able to move down to where the player is and also follow him up to other locations. But the big thing was, for those who have played the game now, the train sequence. We're basically moving the platforms that the AI is on top of, at 60 miles per hour through the environment! That was a total engine refactor actually; we needed to change the entire engine to support traversal in different spaces and that was a big undertaking. But it was fun. Alex I'm sure you must have really loved the designer who suggested that one!(laughter) Christian It's pretty much an everyday thing at Naughty Dog, they push the envelope every single day. I think that's what's fun about the people I'm working with: we're rarely say no specially not in the beginning of projects. We'll try everything out, and in this case it worked out! There were no really technical difficulties, it was just a lot of work. Alex OK. We'll dig into the details of all that shortly. Christian was kind enough to provide some debug screenshots of the game. but first I have to ask: do you prefer debugging "Chloe" or "Elena"? (laughter) Christian I think personnaly I like debugging Chloe! Alex Yeah, because I noticed all the screenshots are Chloe. Christian I do like the Chloe mesh, even though I was not directly working on Elena and Chloe, we actually had one of our other character programmers work mainly with the buddy characters. So he was the one working with those, but if I had to spawn them in, that's definitely the one I'd go for. Alex For the rest of the interview we're going to break it down bit by bit. First we'll talk about the architecture and how you worked with other people at Naughty Dog. Those of you that follow the GDC and the various conferences over the year, you'll know that Christian has had quite a few talks about the AI in the past. In fact there's a few of Christian's colleagues at Naughty Dog that also talked about the game's architecture, so we're going to see how that's turned out and how it helped the AI. Then we'll break it down and we'll look at how the character layer works. That's the big "meaty" part I guess! And then this is one of Christian's favorite topics as well: animation control. So we'll talk about that briefly. Then we'll finish off with some questions about gameplay and AI, if you have any questions feel free to ask, and I'll ask them to Christian. Alex Why don't you start by giving us a quick overview of the architecture? Christian Of the entire AI? Well, we basically have in the foundation this whole thing that we call the characters. A character is, for those that use the Unreal engine, a similar thing to pawn. It's like a very dumb but physical representation of a character in the world. It doesn't really know why it's there; it doesn't know how to make decisions at all, but it knows how to react with the world. It knows how to avoid obstacles, it knows how to move from one place to another, it has the health so it would be responsible for hit reactions & ragdolls and such. I don't want to fill up your red little window there. (laughter) Alex Go ahead there's room! Christian That's mainly the character from the world or from the games perspective. From the AI's perspective, the character also provides an interface of how to control the character. I use the analogy of a puppet and a puppeteer, one of the presentations where the character has a lot of query functions, and also request functions: please move over here,

start using this cover, look in various directions, or at various objects... That's all in the interface. The character knows how to do that, how to orient his head, his weapon, put holster and unholster the weapon. But he won't do that automatically, because he wouldn't know why. Then the AI part of it. We are using kind of a fairly straight forward behavior tree, with a bunch of modifications of course. And this is all the decision logic. Deciding on obviously where to go, and how to to attack or flank or search for the player or for any enemy for that matter. It's using the interface very intimately. Then the topology like how we actually nagivate around the world is outside of these main two modules. We are using a navmesh, and each character has what we call a navigation control or "navcontrol." The characters kind of tie into the world by remembering which Navmesh its on, and navcontrol provides the interfaces for both the character and for the AI: can I go from A to B? If so, what is the detailed path? Those things for example. Alex OK, so this is shared among the two components, so I should put it down here. Is that worked on by separate team, or do you actually work with both of these components together? Christian Yes, we actually named ourselves the character team. And we work on everything, all the way up from the AI all the way down through the navmesh and the character. Under the character lies the complete animation system. I believe that to be a good character programmer you need to have a good understanding of the whole depth. We actually work on everything. One day we'll write the high level behavior, then we implement various new features for the character in the character layer, and we hook everything up in the animation system. We're wearing many hats! Alex Did we miss any big components, or is that roughly the overall structure? Christian I think that's roughly the overall structure. I mean there is obviously, within the AI, all the smaller bits and pieces like sensory systems and stuff, but we can get into details about that later. Alex Absolutely! So you talked about the separation of the AI and the character, that was the big takeaway from the AI Summit this year (2009), where you did half a presentation with me. How did that work in retrospect, were you happy with it, would you do it again? Christian Yeah. Oh, we were definitely very happy with it! It turned out to be very powerful; it allowed us to create new characters for UNCHARTED 2, much faster with a fraction of the programmer time that we had to do before. For example, most of the buddy characters, like we had Elena & Chloe, but then we had Flynn the camera guy and Sullivan, and we used it for the some bad guys as well like Lazarevic. They were created fairly stand-alone; I think 5% was programmer time, and the rest of it was animator time of just configuring the animation aspects of the characters. So it was a very big win and we embrassed it even more since UNCHARTED 2 shipped. Alex Was this system in place in UNCHARTED 1, or did that only come into place for this game? Christian Oh, I wish it was there for UNCHARTED 1. The biggest problem we had with UNCHARTED 1 was reservation and allocation if you will, of world resources. World resources would be like spacial, anything that's spacial like ladders, cover, turrets... Anything like that. The problem was that allocation was very explicitly handled by the AI behaviors, and it made the behaviors very cluttered. There was a lot of duplicated code; in most cases you fixed a bug in one place and you might have forgotten to actually copy it to another place. It was just a system that didn't scale very well! What we did in Uncharted 2 is that we took a look at that, and tried to unify that whole system. And that's how the character separation came about. All of the world reservaton, allocation, and freeing, is actually handled by the character now, and the AI logic became much simpler. Alex OK. Bjrn had a very good question here. It seems you spent a lot of time separating these two and working on this interface, to what extent are the character and the animation interfaced? How closely intergrated are these two boxes at the bottom here? Christian One of the goals that made the separation, before I go into just how interfaced we were between character and animation system, was the interface towards the character was not mainly driven by the AI behaviors. It was actually mainly driven by me and the animator that I was working with, to be able to control the character. So there is actually two users of the interface; one is the AI, but the other one is like a character control module which is pretty much a mapping between the PS3 controller and these interfaces. You can actually, in any one of our levels at any given point, take control over a character and tell them to walk around or play animations or do whatever. Now what you've done is replaced who is sendind the commands to the character. It was immensely usefull to try out animations and stuff like that because the animator would actually be the one loading this up, taking control over the character. If it worked when he did that, then there was obviously something wrong in my AI behavior if it didn't do the same thing when I was trying. Christian When it comes to the character and the animation system, we have little animation controllers. Basically the character contains a collection of animation controllers, the controllers are things like an aim-at controller, look-at controller, locomotion controller, and also a set of specialized controllers that know how to interface with specific objects like a turret, for example. These controllers are what actually interfaces with the animation system, so the characters talk to the controllers, that it has internally, and the controllers in turn talk to the animation system. The controllers are modular in a sense that it's actually the high level AI, or the top level character. Like when we create the AI character Chloe for example. She adds all these animation controllers and basically maps a controller to the aim

controller slot, if you will. So you can have all kinds of knowledge in there because it's kind of a derived class. Just because it's inside of the character, it doesn't mean that it only knows about character stuff. In this case, some of our controllers know about high level AI decisions that can change which animation requests it will actually make to the animation system based on whether the NPC considering itself to be in combat or not. Alex So there's a little bit of AI logic sprinkled inside these controllers... Christian A little bit, not so much, I guess it would be the selection of like the demeanor, it would be like a very simple demeanor switch where you can do one set of requests, or another. Like there's really no heavy weight logic at all other than that. Alex We'll talk about the scripts & C++ shortly, but Leo's question was about how many of these controllers are used by the same characters? Because it seems like a pretty modular system. To what extent did you just use all the controllers for all the characters versus plug 'n play? Christian Almost all controllers are used by all of our NPCs actually. I think there might have been one or two, I think the standard character has about 10 animation controllers or so, and only one or two of those were replaced by the buddy AI. The rest were actually used verbatim by all characters. We're trying to use a very indirect approach for selecting animations and such, where the controllers, they never request the name of an animation clip for example. We're using a level of direction where they just use the name of a logical animation and then we can totally replace that with any in-game animation we want or even a tree of animations blended together if we wanted to do that. Alex That's exactly Dan's question, he was asking if these controllers are like a single layer in an animation tree, but you just mentioned that you could replace that with a whole tree potentially. Christian Yes, that's the thing; our layers inside the animation system can be thought of as layers in the animation tree except each layer doesn't contain just one animation. Each layer can contain nothing, but it can also contain an arbitrary complex sub-animation tree. So depending on which state you're in and how complicated the action you're taking is, the controller might or might not invoke one of these highly complicated animation blends.

Das könnte Ihnen auch gefallen