IA Logo


IA Information
Communication

Dave Mark's books

Post-Play'em - Observations on Game AI


Posts Tagged ‘dialogue’

Skyrim: Pardon the Interruption

Saturday, December 31st, 2011

This is a quick one. I have seen this numerous times in my few hours of playing, but I haven’t captured as many of them on video as I would like.

“They neglect to take any sort of context into account.”

People in Skyrim obviously have a proximity trigger with your character. If they have something to say, they will say it either when you get in range of them or vice versa. While this makes for some great immersion at times, they neglect to take any sort of context into account. They don’t observe what is going on and decide whether or not they should talk to you.

I don’t recall anyone doing it while I was in an active dialog tree, but there are certainly times when I am listening to something important — and especially if I am obviously part of a group discussion (such as in the two examples in the video). People doing their random walks will pass close enough to me to trip their trigger (so to speak) and say their piece. It’s horribly distracting.

“Real people have an awareness of unwritten social rules.”

The reason that this breaks immersion is that (real) people have an awareness of unwritten social rules. This is notoriously hard to get right in games. Richard Evans has been working on it for years — most notably with his work in The Sims 3. However, we aren’t solving for behaviors such as “don’t walk in on someone where they are taking a leak.” We are simply saying, “if I’m involved in something important, don’t interrupt me.”

If it is, indeed, the case that there is a boolean to not interrupt when a dialog is active, this is a simple fix. Apply the same boolean flag to when something important is going on that the player must listen to. In the case of the street preacher in Whiterun, this isn’t as big of a deal. By definition of his role, he is going to repeat himself. However, in the cases shown in the video, this is a one-time thing with important information… don’t play your random engagements.

“If I’m not
looking at you,
don’t speak to me.”

Another way of solving this is through a slightly more complicated method of simulating “eye contact”. That is, if I’m not looking at you, don’t speak to me. Let’s face it… that’s a common one that we all use in public anyway. In the case of the examples in the video, the 2nd one would have fallen into this category. The guard just happened to be walking by — behind me — and decided based on proximity to say his line. In the first video, at least I looked at the guy.

In effect, many of these rules can be combined together in some form of rule-based system… even an additive one using cumulative values. By assigning values to the various considerations (including a value on the importance of the message itself) you can define a threshold above which you are allowed to say the line. That solution would be much less brittle than the simplistic one that is being used here, and yet it is still lightweight and easily customizable by designers and programmers.

Dragon Age: Origins – First Look

Monday, February 22nd, 2010

Just sat down with Dragon Age: Origin for a while. I know I won’t get too far into it anytime soon because, for a Bioware game, that usually means a commitment of a few months. I plan on blasting through more soon, but the 360 is on the same 43″ HDTV that the wife wants to watch Olympic stuff on. (I can’t begrudge her that since she usually doesn’t watch enough TV to get in the way of my gaming.)

To give a frame of reference of how far I am, I started as a City Elf and am only just about ready to roll out of town with Duncan. That has, at least, given me plenty of opportunity to go through both peaceful and combative encounters. Also, I haven’t yet dealt with the NPC behavior customization. I imagine that will be more important as I go foward, but for now I just wanted to live by the defaults.
Well Lookie Here!
One of the first things I noticed was when I was in a conversation. While I like fact that people’s eyes move and blink, I would like to see a little more movement. There is so much that can be said by breaking of eye contact, turning the head while still speaking, etc. I have written about this here and there before (and really should write a formal article about it). The point being, what they have done is a start, but it isn’t enough to really sell the character. As an example of dialog scenes that are well done, I point you to Assassin’s Creed (the original at least… haven’t seen AC2 yet). Previously, I wrote about how I liked that, in Assassin’s Creed, not only could you walk around during conversations, but that the NPCs did as well. They looked down, away, etc. I would like to see more of this. The walking around isn’t even quite as important as the head and eye control. Some of those can even be randomized — especially with parameters — so it’s not like it would take a lot of work or resources.

On the subject of head movement, however, one thing I noticed the first time that I was in a conversation with two people was that their head turns are NOT animated by hand but are automated. The reason I know this is that there is a very distinct start and end to the turn and that the turn rate is entirely constant during the whole turn. Put another way, if someone turned from looking at me to the person standing beside them, that 90° turn would go from a rotation rate of 0 straight to n, rotate that 90°, then change rate from n to 0 again. The rate, n, was always the same throughout one turn and on every turn. The overall effect made it look like one of those audio-animatronic characters in a Disneyworld exhibit. It was very mechanical-looking.
While I like the idea behind the technique, I believe a better way would have been to randomize the rate, a rate of change into the turn, and a rate of change out of the turn. This not only changes things up between one turn and the next, but also smooths out the starts and stops so it doesn’t look like little servo motors kicking in.
… one of those audio-animatronic characters in a Disneyworld exhibit.
Also, you don’t always have to look directly at someone. If someone standing next to you is speaking, you can turn your head part of the way and do the rest with your eyes. In fact, it is very common for humans to “split the difference” and look somewhere between the two speakers in that arrangement. Toss in the occasional look at other objects of interest in the environment (especially if you’re nervous, wary, etc.) and you can really sell a conversation without a lot of extra work.
Don’t Mind Me
She never acknowledged that I was even there.
While I appreciate that not every denizen of a place should attack you, I would at least like them to acknowledge my existence. For example, I was a little startled when I was storming the castle. In a couple of the rooms, I came upon a woman scrubbing the floor. She didn’t look up when I entered (if she was a servant, shouldn’t she care to see if it is a boss?), she didn’t look up at I moved around, she didn’t look up as I stood with my boots under her nose. She never acknowledged that I was even there. She didn’t do anything other than scrub the floor. It was a little startling, especially when everyone else in the place (friend or foe) recognized that, as an armed elf, I was seriously out of place. (Incidentally, I got a kick out of the fact that this matched up nicely with the theme of AIGameDev‘s AI Marmelade – their twist on the Global Game Jam. Their coverage of it was sub-titled “on little old cleaning ladies in stealth games.”)
I admit that this is likely a content issue. Developers would love to add more background characters to an area, but then you run into the issue of having them react in meaningful ways. Also, if those reactions are going to involve custom animation or sound, the expense goes up significantly. It would be nice to have a general list of generalized actions and interactions, however. Put people in there moving from place to place, carrying things, tending things, etc. When I come in, at least have them look at me. If I try to engage them, make them politely dismiss me. If I do something flashy like attack people, make them run. That much, at least, puts a little life into the place. Oh well… no one can ever say Bioware skimps on content. They just put it into length of the experience rather than the depth of it, I suppose.
Combat AI – So Far…
I was a little wary going into this first play session because someone I trust on AI commented that he was frustrated with his party members. As I said at the top, I haven’t gotten too deeply into the game and haven’t messed with the customization yet. However, there was nothing that I saw yet that was really “pants-on-head retarded.” I was a fighter as was my buddy. He attacked when I did or when we were attacked. I was too busy trying to do my own gig to see if he used a healing option when he should have. I don’t think he did because he “died” a couple of times during our great castle adventure. I didn’t think to give him a ranged weapon to see if he would switch at appropriate times, though. And now, of course, he is no longer in my party (taking some cool gear into the abyss of retirement with him). My next play session will have me leaving town with Duncan and likely teaming up with some dudes. We’ll see how things go then.
… it looked a lot like a tool that an AI programmer would make for a designer.
I only briefly looked at the customization system. From what I could tell, it looked interesting if you are an AI programmer or a designer. In fact, it looked a lot like a tool that an AI programmer would make for a designer. I would lay money that it’s origin is not too far from that. I can see how it would tend to quell the inevitable gamer uprising that would like more control of the autonomy of their party-members (is there a contradiction in there somewhere?). However, it was said by a few people that you actually have to tweak this system by hand to get people to work together properly. I really don’t like this idea. In my opinion, if it doesn’t work intelligently with the default settings, there is something wrong.
From a technical standpoint, the system looks like it is a parameterized rule-based system of some sort. I’ll have to play with it… for all I know, it is tweaking a behavior tree behind the scenes. Much of my conclusion on what is going on would be based on whether you can sort your rules in a particular order of consideration. Like I said, I only just glanced at it. More on this after I play. In the mean time, I refuse to look up any technical documentation on it just to see if I can figure it out on my own.
The enemies were pretty much standard “fight to the death” fare so far. They were all castle guards and punks, though. That would be right up their alley. I’ll have to see what other types of enemies offer later on.
Anyway, despite their similarities in production, the game is much more enjoyable to me than Mass Effect was — at least for now. I’d be pleased if that stayed the case.
Definitely keep an eye on the rss feed here. I’ll be writing more about this game later in the week.

Mass Effect: First Look

Friday, January 29th, 2010

I’ve had my copy of Mass Effect (yes, the original) from GameFly for a month or so now. My son played it for a few straight weekends when he was visiting and finally finished it. Seeing how long it took him to go through has convinced me that I do not have the time to ever complete the game. However, I did want to get a feel for what it was like specifically for reference purposes. Here’s a few of my first impressions.

Good Dialog Animation

One thing I noticed that was rather pleasant was that the cut scene dialog animation was reasonably well done. This is even more impressive since there are at least a dozen races that I have encountered so far and all of them look believable when they are speaking. I happen to have a soft spot for ol’ Urdnot Wrex who looks particularly compelling when he speaks. Kudos to BioWare for pulling that off well.

Fixed Cut Scenes
On a down side of that is the fact that I now feel really rooted to the ground during those dialogs. Much of this is by an unfair comparison, however. After playing Assassin’s Creed where I could wander around aimlessly during dialogs, I found myself a little restrained during the Mass Effect ones (of which there are plenty). Which brings me to another point…

Odd Disconnects
Having been a veteran of Neverwinter Nights, I am well familiar with the extent that BioWare can take their contextual dialog trees. While I agree that this is still largely a necessary evil in RPG games, there are times when I am a little alarmed by a continuity disconnect.
For example, upon arriving in Noveria, I had a pleasant chat with the lady Gianna. She tells me upstairs at the security station to come see her to have an appointment with Anoleis. It took me less than a minute to get down to her office where she greeted me with the question, “What do you want?” It was rather startling to have just left her and have her forget that she told me to come ask her something specific. Of course, this is something that can be chalked up in part to poor writing. On the other hand, this is also something that could have been added as a trigger flag in the dialog tree itself. That is, if the player gets to you quickly, acknowledge it and say something appropriate. In this case, it would have been “Ah, you are here. Let me announce you to Anoleis.”
On the other hand, the in-dialog flags seem to be well done. Often, they will remember that I have asked about one topic in another branch of the tree entirely. That is well done. Of course, I was tickled when one character told me off by saying we have already discussed something. On the other hand, I can see how that would be annoying if you were distracted by something and didn’t hear what was said.
Another peculiar interaction was when Gianna met me outside a room after I had finished a combat sequence. (I believe it was outside that one dude’s office.) She told me to talk to her in the hotel bar before I spoke to the guy who sent me on the mission. Uh… OK. The problem was, as soon as the cutscene was over, she was gone. We didn’t get to see her walking away or going to the bar, etc. Not having anything else to do, I went to the bar and found her already there (she’s quick!). Again, this effect is a by-product of having the cutscenes be somewhat de-coupled from the actual live action gameplay. It’s mildly annoying.
Not much of that has to do with AI, however. This next bit does.
Combat AI
In a few of the combats that I have been in, I’ve noticed a peculiar combination of tactics. While I praise the design that puts some enemies behind cover for a while. It seems like they also leave cover for no reason, walk some pre-programmed path while still firing at me, then return to cover. If that doesn’t smack of a shooting gallery, I don’t know what does. Additionally, there have been times when an enemy inexplicably leaves cover and runs right up to me in the open. It seems to be a design decision to “mix things up” however. While mixing things up is fine, it doesn’t really make a lot of sense from a combat standpoint. Because of that, it makes the enemy look dumb. If the enemy looks dumb, people think the AI is dumb. It is unwise to intentionally write something into your enemy AI that people will perceive as being broken – either technically or in the “brain” of the enemy.
All in all, the AI seems to alternate between overly scripted or a sequence of randomly strung together actions. There isn’t that cohesive combat flow that I experience in the likes of Halo 3, Gears of War 2, or F.E.A.R. Interestingly, this makes the battles almost as mundane as the incessant walking (jogging) and driving that you have to do in the game. Where I would hope to have the proverbial minutes of terror to break up the hours of boredom, I don’t even get a rise out of the combat. That’s disappointing.
Anyway, while I don’t plan on finishing the game, I will put a few more hours into it and see if I notice anything else.

Fable 2: First Look

Sunday, March 8th, 2009

Continuing with my pre-GDC blitz of “must at least look at” games, I have just putzed around with Fable 2 for about 90 minutes. I had a look at some of this material back at the 2008 GDC when Peter Molyneux was going through his pre-release hype. (Isn’t he always?) Therefore, I knew some of the things to look for.

Most importantly, on the AI front, is the inclusion of the almost legendary “dog” AI. To hear Peter talk, you would have thought this game was a bigger and better “Nintendogs” game… that the entire purpose of buying it was to play with your doggie and bond with him. While that isn’t exactly the case, I have to admit that the dog is a good point of interest. The dog certainly is convincing in many ways.

My Dog Runs Rings around Me!

I think one of the things that was startling to me was how it moves in a general area around you. Most companion AI tends to lag behind you. For example, my recent mucking about with the companion AI of Left 4 Dead has me convinced that I am the only person in the entire world with any initiative. This is obviously a logistic issue because very rarely can the AI know where you want to go or when. This is sometimes mitigated in linear games where there is only one place to go. In my short experience with Gears of War 2 today, I saw that exact phenomenon. My companions were able to move ahead of me and take up positions specifically because there was no other way to go.

In Fable 2 this is done via the “breadcrumbs” trail. Despite being far more “open world” than other games, if you have selected (or the game has selected) a destination, by extension, the dog knows where you are headed. Of course, if you turn around and backtrack or go off to one side for some reason, the dog has to react and come back to you… but this is what happens in real life anyway.

The result of all this is that the dog will playfully romp or explore ahead, behind, of off to one side or the other in a general “halo” around you. If you stop traveling for a period of time, he will come back and see what’s up. If you stand still for very long, he may even lie down for a bit… all the while keeping an expectant eye on you as if to say “now what?” It’s all very convincing.

I really noticed one particular aspect of the dog’s animation after I put the controller down and switched off the 360. I went to go feed our own dogs and, as I was walking from the food bin to the bowl, one of our dogs was walking a few feet ahead of me. However, he had his head turned slightly back toward me, keeping an excited eye on me and the cup of food that I was carrying. He did that very dog-like routine of glancing forward and then back at me over and over all the way to his bowl. It struck me that this is exactly what the dog in Fable 2 was doing as I walked. As he would criss-cross in front of me, he would keep glancing back as if to make sure that I was coming along with him. It was this sort of attention to detail both on the behavior and the animation AI that really sold me on this dog. I’m looking forward to experimenting more with it soon.

Look at Me When I’m Talking to Ya!

Interestingly, there were times with the villager AI that I felt that the eye-contact issue was the problem rather than a feature. I’m not talking about how, while in conversation, people will glance away or past you. This was a problem with where they were facing in general. If they started their spiel while I was in one place, and then I moved to one side or the other, they would continue to face the spot where I was. Only after a moment (usually after finishing a line of dialog), would they turn to face me again. It was all rather disconcerting. Compare this to how well games like Half Life 2 continued to address you throughout a conversation… even to the point of turning and walking backwards if necessary.

Dialog Pauses

Another problem I had with the villager AI was how many of the scripted dialogs had very unnatural pauses between lines. There was an awkward silence between many of their sentences that left me wondering for a moment if they were finished or not. It was one thing when it was in response to something I had selected. However, when they paused in conversation with each other, it was odd. When they paused between their own lines, it was horrific and very distracting. I have to imagine that this is because each line of dialog needed to be loaded and accessed separately, but I can’t see why this would be a problem.

Both the facing issue and the dialog pause issue may be related to the same root cause, however. It may be a result of waiting for an associated animation to finish and report back that it is done. If a line of dialog (and the code to “face the player”) are associated with a particular animation, they would each have to wait for the other to finish before they both advanced to the next segment. If the animation finishes first, it isn’t as tragic because the animation can sit in idle for that extra second. However, if the voice finishes first, the next line must wait until the animation is done — causing the unnatural pause. This is just speculation on my part for the moment. I figure that if I analyze it a little further I can make the determination down the road.

Individual Individuals

One thing that jumped out at me during the initial city quests was how the group of kids all reacted slightly different to my various gestures, poses, and flatulation. I would get more “love points” (or whatever) from some than I would from others in the group. Upon a little examination, I found that each person had their own likes and dislikes — that is, things that they were more impressed by or didn’t like. It’s one thing to have different “respect ratings” from different people. It’s quite another to have different models of what causes respect on an individual basis.

I found this rather amusing since I am doing a co-lecture on this very subject at GDC in a few weeks. (“Breaking the Cookie Cutter: Modeling Individual Personality, Mood, and Emotion in Characters“) It’s something I would like to see more of in games in the future — although maybe not in quite as transparent a fashion as what appeared on-screen in Fable 2.

Will You Treat Me Different When I’m Famous?

I think it will remain to be seen what happens when I’m more renowned than I am so early in the game. In the original Fable, it got rather annoying that everyone, everywhere wouldn’t shut up about you. The comments that they heaped upon you were not as many in number as there needed to be. (You can only hear “chicken chaser” so many times before you want to crack someone’s head.) With a nod to my friend and colleague, Adam Russell, who did the villager AI for Fable, that isn’t an AI problem as much as it is a content problem. (This is another bit that I will bring up at the AI Summit panel, “Characters Welcome: Next Steps Towards Human AI“… it doesn’t matter how many decisions our AI can generate if we don’t have enough art and sound assets to express it.)

Anyway, this is a bit long for a first look. I will tag on some more as I experience more of the game. On the other hand, I will be shipping this back to GameFly in the next day or so. I need to check out a couple more titles before GDC in a couple of weeks.

If you are just jumping into this one article, make sure you click the tag(s) below to see if I have written anything else about Fable 2.

Half Life 2: Paying Attention to Me

Tuesday, February 10th, 2009

When I posted my first observation on Half Life 2, “Movement on Rails” the other day my colleague, William van der Sterren commented that one of the cool things that they did in HL2 was making the NPCs acknowledge the player’s position during conversations. While I certainly agreed at the time, I thought this was limited to eye contact and head position. That was just the beginning. I had not experienced the full depth of what they had done in the game.

Last night as I was playing some more, I had some of the extended conversations at Black Mesa East. As Dr. Mossman was walking me through the lab, I was surprised to not only see her turning her head, but even walking backwards (convincingly well) at times so that she could continue to face me. I’m tempted to go through that section again just to mess with her. If I keep moving, does she keep changing?


Anyone who has coached kids playing baseball has probably taught the drill of how to watch the ball as you are running backwards. Part of that drill is to change sides without turning your head. That is, looking over your left shoulder, then turning your lower body to run with the other shoulder leading so that you are now looking over your right shoulder. I think it would be interesting to watch the NPCs in HL2 react to that sort of situation.

All in all, I agree with William that it was a new point of immersion for a game NPC. More specifically, it worked to not break the suspension of disbelief simply because it looked natural.

Monlogue Breaks

On the other hand, there were awkward pauses in the monologues of the various characters. Sometimes, I figured that they were waiting for me to cross an invisible trigger threshold. That is, as they entered a room, they waited for me to cross through the doorway that they were then going to close behind me. However, the next line of monologue was put into the same queue as the actions such as closing the door. Therefore, they could not proceed with their spiel until such time as I allowed them to close the door. If I had not moved, they would never have continued.

A solution for this would be to have a separate queue for the speaking and the actions. However, the speaking could be superseded by ad hoc lines such as, “Come on through the door so I can close it behind us.” and then continuing on with the monologue. This shouldn’t be too difficult to do with a priority-based system. The insertion of the vocal line “Come on through…” would be a higher priority than the other lines. As each normal line finishes, it triggers the insertion of the subsequent line into the queue with the appropriate priority. If there is nothing else more pressing, it would chain right on the end as per usual.

One of the effects you can pull off with this method is reaction-based stuff. For example, I was dying to fire my pistol into the ceiling during some of the speeches and conversations. Would they have reacted? I don’t know about HL2, but in other games, probably not. However, a priority-based system would override whatever sequence is being dictated with “What the hell are you doing?”, a few follow-ups about shooting weapons in the house (“You’ll put your eye out, kid!”), and the revert back to the regularly scheduled monologue.

Another effect would be acknowledging random people walking by. For example, during the hallway monologue, Dr. Judy could have received an event that a colleague was approaching coming the opposite direction. She could have inserted a slightly higher priority event to say “Hi” to the person in between lines of her monologue. She would say “Hi” at a break between lines and then go back to what she was talking about. Sure, there are caveats that you have to look for, but the inclusion of simple mechanisms like this work in a similar fashion to the head-turning one. They look natural and therefore feel natural to us.

(Remember to check the other Post-Play’em observations on Half Life 2.)

Add to Google Reader or Homepage




Content 2002-2017 by Intrinsic Algorithm L.L.C.

OGDA