IA Logo

IA Information

Dave Mark's books

Post-Play'em - Observations on Game AI

Posts Tagged ‘animation’

Skyrim: To Headlook or not to Headlook?

Friday, December 30th, 2011

While playing my initial few hours of Skyrim this week, I’ve noticed an interesting disparity in the way headlook is used by characters. While I enjoy headlook in games for the most part, there are times when it can either be overused (“why is everyone in town staring at me all the time?”) or used in such a way that it looks unnatural to the character. Here’s a video with a few examples. Watch it first because the commentary addresses the scenes within.


Look at Me When I’m Petting You!

First, the dog in Riverwood doesn’t seem to care that I’m there. With nothing else going on in the middle of the night, you would think that he would at least be interested in me. Instead, he just sits there staring at nothing. While that is perfectly acceptable for a dog to do (ours do it rather often), the problem arose when I actually “talked” to the dog. He barked in reponse — but wasn’t looking at me at all when he did so. He looked around randomly — but not towards me.

If you are going to make it so that the dog responds to being addressed, at least make him stand up and face you or turn his head to see you (if possible). You do this with enough other agents in the world, it shouldn’t have been hard to include a line or two of code to do it with the dog. (I have yet to test this with other animals in the world.)

Look at Me When You’re Talking To Me!

When I entered some tavern or other in Whiterun, I was immediately spoken to by the owner of the place. She was standing behind the counter. However, I noticed that she was not looking at me — just staring straight ahead. Ironically, she only looked at me when the server lady spoke to me (and mentioned her name). Then, she wouldn’t stop looking at me at all. One thing I forgot to test was to see if it was proximity based. That is, if I went father across the room, would she have stopped looking at me. All in all, with that sort of incessant tracking, I feel like I’m being targeted by and anti-aircraft gun. At least with the bar there, she had a reason to continue facing that one directly.

Move More than Your Head

Now to this clown Heimskr in Whiterun. As seems to be his job, he runs his mouth out in the town square. When I walked up to him, he started tracking me. (Grateful to have an audience, I suppose.) While it looked OK at first, at one point he raised his hands up… right between my face and his. He was still trying to look at me, but his hands were in the way. As I moved back and forth (after stopping to grab some lavender), he kept his body facing forwards and his hands raised — but his head kept tracking me.

It looked horribly unnatural to have his body pinned to one orientation — especially in a gesture that is meant to be for the audience’s benefit — and yet still move his head so much. Unlike the bartender above, he has nothing holding him to that orientation. I would like to see some pivot to the body as he addresses me that way.

Face Me Once in a While

This one is a little rough. While I commend games for not always having the agent face directly at you, my qualifier is constantly. Sure, orient your body differently as you move around! However, you aren’t being clever (or realistic) if you position your body so that it is facing away for some reason, point your head toward the player, and then leave it that way! In the video you will see 3 clips of people who happened to not be facing me directly when I started speaking to them. They didn’t orient towards me at all when they started speaking to me and didn’t fidget at all during the conversation. The result looked rather uncomfortable.

Not shown in the 3rd clip is that the speaker did reorient himself after we were jostled by someone walking rudely between us (more on that subject later). I thought that was interesting in that it triggered some sort of alignment code in the agent. Therefore, it seems that some such code exists, but just wasn’t being used.

How to Fix it

This really isn’t that difficult to fix. Not only would it look less uncomfortable, but it can be leveraged to make for far more engaging characters. All that needs be done is the following:

  1. If the player moves outside of a particular front-facing zone, pivot the body as well as the head. You don’t need to pivot to face him completely, only enough to get the head into a more natural range. For example, if the zone is 60° on either side of center and the player moves out of it, pivot so that the player is now 30° off-center instead. Try it on yourself and see how natural that feels.
  2. As you are talking to the player, reorient yourself once in a while through various shuffling animations. Again, make it so that your body is always somewhere between +/- 30° off of the centerline to the player.
  3. Don’t always stare at the player. People don’t do this in conversation. Randomize headlook more. Look around occasionally — even while you are talking but then glance back at the player directly. The points where you glance back at the player can actually be marked up with the facial animation so that you glance at the same time as important points you are trying to make. Otherwise, look around either randomly (and not all in the horizontal plane, either… up and down are OK, too!) or at other points of interest in the room. For example, people walking by, the performer in the tavern, windows and doors in the room, etc.

Anyway, these are just minor things that have jumped out at me in my initial few hours with the game. While not really bugs, certainly, the headlook issue breaks immersion for many people if it is not done naturally.

There are far more annoying things I have seen that will be addressed later.

Dragon Age: Origins — Final Thoughts

Wednesday, November 16th, 2011

Well, after messing around with it for over a year, I finally got around to finishing Dragon Age: Origins. I have to admit that the game grew on me after a while. Here are some final thoughts on it. (Note that you can read my earlier posts on the game.)

Custom AI Tactics

“I kind of liked dealing with the AI tactics.”

Once I finally dedicated a little bit of time to looking into it, I kind of liked dealing with the AI tactics. It’s a simple rule-based system, of course, but one that gives you a feeling of control. The reason that I specify “feeling” in this case, is that most of the rules are pretty obvious. For example, a rule for Morrigan might read “When there are 3 or more enemies clustered together, use Fireball.” I’m sorry, but that goes in the “duh” column. Really, that should be a part of the logic for the Fireball spell in the first place. The same goes for the “dual weapons sweep” logic that I used on my main character (for when I wasn’t controlling him). “If there are 2 or more enemies surrounding you, use dual weapon sweep.” (I also found that I used it with one enemy just because it looked cool and did great damage.) Regardless, many of the usage rules just simply made logical sense.

“The solution to this is to build the logic into the abilities themselves.”

The solution to this is to build the logic into the abilities themselves. If you are wounded, use a healing poultice (if you have one). If you are low on lyrium energy and have a potion, use it. If you are strong and have a shield, do a shield bash against your enemy. There really should be no need for the player to construct these manually. Of course, I don’t know what the chicken/egg order was on this mechanism and the “tactics” abilities that were built into the character customization. That is, did they create the AI tweaking mechanism and then decide to add the character abilities that allowed you to unlock more tactics slots or did they create the notion of “has better tactics” and have to come up with a way of expressing that?

“That character has that cool new ability but never uses it!

The unfortunate by-product of this is that I can see how it would be very frustrating for people who didn’t know that the tactics screen was there or didn’t understand how to use it. I’m sure there were more than a few people who would cry, “that character has that cool new ability but never uses it! This AI is stupid!” Of course, there is always the possibility that the reason this mechanism was in place was because they were struggling with how to have the NPCs use their skills intelligently. By putting the onus on the player, they absolve themselves of a little of the responsibility. I don’t buy this line of thinking because, by creating a customizable rule-based system in the first place, the battle is almost won.

Companion Pathfinding

“I usually was pretty pleased with their positioning.”

With Skyrim being out, one of the comments you hear about the companions is that they can do silly things like block doors or passages and be completely clueless about the fact that you want them to move. This is not something that I ever found to be a problem in DA:O. In fact, despite the fact that I usually had 3 other companions along with me, I usually was pretty pleased with their positioning. They followed at respectful distances, they didn’t get trapped behind geometry, they handled it fairly well when I would reverse direction on them, etc. Most of the time their “group” behavior was very believable.

There was only one time that I noticed anything really odd. I was in Dust Town in Orzammar and Zevran (easily my favorite NPC, by the way) managed to get up on a pedestal of some sort and was unable to get down. After some examination, I realized that it was an extension on either side of some stairs. He had somehow managed to enter it from the top of the stairs but couldn’t exit that way. Likely there was navmesh geometry on the pedestal (why, I don’t know) but no link to the rest of the mesh. For some reason, when my back was turned, he skipped a mesh boundary by being nudged off the main mesh. I’m just speculating here. Anyway, I had to actually exit the zone without him and come back.

Enemy Targeting

In an earlier missive on DA:O, I had complained about how the target selection seemed to be a bit nonsensical at times. Perhaps I got used to it or perhaps it wasn’t as bad as I initially thought… but this issue didn’t seem as bad as I had commented on earlier. There were times when I thought it was a bit odd, but it wasn’t altogether unreasonable. That, of course, has been one of my mantras for some time and, in fact, is something that I stress in my book: “Not always perfectly rational, but at least reasonable.” I don’t know if that was the goal here or if their targeting was simply sub-optimal.

Of course, with regard to my companions, some of it had to do with the tactics selection and aggressiveness settings. If I had them set wonky, they would act wonky. However, I can’t use that excuse with the enemies. On the fly, it is hard to determine what sort of logic they are using… e.g. “nearest visible” vs. “strongest”. This would be something I would have to record and slow down to decipher. However, since it doesn’t seem to be that weighty of an issue, simply “knowing” wouldn’t really change much.

Again, though, some of this is mitigated by the fact that you can control each character in turn. Is this a bandage, though? Are we at another chicken/egg moment? Did they allow you to control the character targeting because they felt people would be frustrated by the target selection? Probably not… it’s not that bad to force them to build a whole huge mechanism (character control) around it.

Scripted “Random” Conversations

I found the seemingly random chit-chat between companions as one of the most amusing parts of the game. I have to admit that it was so endearing, that it made me want to replay the entire game with different companion combinations just to see what all these conversations were. (The combination of Zevran and Morrigan was a riot!)

“You begin to get used to the fact that riiiighhhtt here someone is going to start talking.”

The initial impression is that these asides simply take place “whenever”. Conveniently, they would also take place when you really weren’t doing much else. It didn’t take long, however, to realize that there were “hot spots” in the terrain that triggered these conversations. Not to the extent that Place A triggered Exchange A; they were randomly selected from the available list. They were obviously placed in areas where you needed to do a bit of walking and, therefore, wouldn’t be interrupted with much else. The long bridge to the Proving Ground in Orzammar has one, for example.

The problem is when you have to walk the stretch more than once — especially in succession. You begin to get used to the fact that riiiighhhtt here someone is going to start talking. It’s even worse when you have to reload because it doesn’t remove the conversation from the potential list… and you may get stuck with the same one over and over. While I like the conversation as a way of both fleshing out the characters and making the scenic walks a little less boring, I have to wonder if there is another way of doing it.

Facial vs. Body Animation

“The lip-syncing is worthy of being looked into by the pop-music industry.”

While this doesn’t necessarily seem to be AI-related, I figure that it probably is. The facial animation in DA:O is great. The lip-syncing is worthy of being looked into by the pop-music industry. With how good the lip-sync is, I found myself staring obsessively at the mouth only while people were talking. Maybe because I was drawn to the only realistic part in the whole face.

The rest of the facial animation is spotty, however. I would love to see more expression in the rest of the face, too. The eyes, eyebrows, and, in fact, the entire head, needed to be more animated. While the head wasn’t “Fallout” creepy, it needs to move more… look around a bit. Same with the eyes. Little tiny twitches are nice, but people do things like glancing at the floor, etc. You’re on the right track, but need to do more.

“People don’t just wave their hands randomly.”

The body animation during conversations was simply horrible, though. I like the whole “hand-wavey” thing that they tried to do. It’s better than standing perfectly still. On the other hand, people don’t just wave their hands randomly — they use them to augment what is being said while it is being said. They use it to punctuate words much the way I used italics in the this paragraph. If I had italicized different words that were obviously not meant to be stressed, I wouldn’t have communicated the same thing or, worse, it would have distracted or even confused the reader. That’s what I felt about the hand motions in DA:O. They seemed vaguely relevant but so imprecise and ill-timed that it made things worse rather than better.

The solution likely lies in a markup of the dialog to map to the animation selection. By tagging the stressed words with the appropriate gestures, you can match them dynamically. The trick, of course, is that you have to back-time the start of animation so that you can finish on-time. The shorter the target animation, the easier this is to pull off.  That would actually require two markers… e.g. “move to position” and “execute”.

For example, if I want to slap the table as I’m saying “now”, I would tag a point 2-3 words ahead of time with the “raise hand” animation and then the word “now” with the “slap table” animation. Imagine the impact (so to speak) of having a character be able to slap that table, point the figure, shrug the shoulders, incline a head, wave something off dismissively, etc. and have it happen right at the precise moment it needs to. Now that would be immersive! (Note that the word “that” would have been a great place for a couple of key animations, eh?) (Note that the word “eh?” in the prior sentence would have been a great place for a… OK… never mind.)

That said, the rest of the animation was spot-on.


“The companions didn’t cause me undue stress… which is a spectacular accomplishment.”

All in all, Dragon Age: Origins was a really well done game. I enjoyed a lot of it and never felt really “constrained” by a specific narrative. I know I left a lot of side-quests on the table, but that’s almost a requirement for a Bioware game these days. You aren’t going to do them all and still manage to be a productive adult.

The companions were, indeed, companionable and didn’t cause me undue stress… which, as far as companion AI goes, is a spectacular accomplishment. The enemies were reasonably intelligent and only some of the more obvious boss monsters were pattern-style scripted (which is a disappointment because pattern-style scripted AI looks less intelligent).

All things considered, I enjoyed the hell out of the game. People have told me that DA2 is well worth the time. I just wish I had more of it to dedicate! I have a feeling that it isn’t a game I can finish in a weekend!


Assassin’s Creed: First Look

Sunday, April 26th, 2009

In my latest episode of “finally got around to playing”, I have had a chance to mess with Assassin’s Creed (on X360). As with most people, I was immediately impressed by how visually attractive the game is. However, that has usually been a warning bell in the past. A lot of time “pretty game” has tended to also portend “stupid AI”. This doesn’t seem to be the case with AC.

While this isn’t normally my strong suit, I have to say that the animation model in the game is very well done. Even without the climbing and hoping and dodging, there is a lot of detail that made for convincing depth in the characters. Even just running forward and then rapidly changing to run the other direction prompts a foot plant and skid animation that is really kind of cool. I also like the fact that the transitions between animations are very smooth. Even just something as simple as changing from a walk to run and back to a walk (even on horseback) exposes a gradient of speed that does not have the hard-edged state change feel.

Look at me when I’m talkin’ to ya!

I also like how you can move around during the (long) dialog scenes. You don’t have to, but you can. In fact, I found myself wanting to pace during these conversations because it made it more realistic. Additionally, when your character says something while he is facing away from the listener, he will turn slightly towards him… not to directly face him, but to talk in his general direction. Think about it… don’t we all do this? How often do we actually look directly at the person we are talking to? It’s a nice touch with the animation that makes those plentiful dialog exchanges more livable.

Running, Jumping, and Climbing on Things

It goes without saying that the advanced animations are very well done. The climbing and running and jumping business is ridiculously well done. There are the occasional quirks but those are more of a problem with the control scheme (on the 360) than anything else. I especially like when I get too close to an edge and my dude has to fight to keep his balance.

Excuse me. Pardon me. Move, damnit!

There are ways that they incorporated this into the game design other than all of the building stuff, however. It was a very nice touch to have the character stagger or even fall when he runs into people. That makes the chase scenes through cities very realistic in that you do have to pay a little attention to where everyone is.

Of course, in order to utilize that mechanic, you have to pack the streets full of people going about their business. This was done very well. There are places where it is next to impossible to run through simply because of the press of people. Even walking through them can get annoying. I haven’t bothered to simply watch people to see where they are going, but you don’t get that initial impression of “random walk” that you get from a lot of other games. (One recent transgressor in this effort was when I was playing Oblivion where every person in the city just broadcasted “I am so lost!” I will write up my observations on Oblivion later.)

An even better touch is how the people react to your passing… not just physically, but verbally. If you bump into one of those jar-toting ladies and get them to drop their burden, they will give you a little lip. The same can be said for running into a dude when you are on a horse. I found myself being more careful moving through people just to avoid what should be relatively innocuous confrontations.

The agents in the game, be they friend or foe, do have a pretty obvious state-based behavior pattern. It works for this game, however. I also haven’t seen any situations where the FSM is stuck on stupid. The game mechanic has enough depth that the predictability of the guards is acceptable.

Now serving #43

I guess the only thing I can fault (although it still works well) is the “ninja fight” rules where the enemies tend to come at you one at a time. They do take turns, however, rather than waiting for the one fighting you to die before the next steps in. Again, this was matched well with the game mechanic of being able to grab people and throw them away. When you toss one dude away, his buddy will step right in. It does make the fight more manageable, however. On the other hand, there have been times when I have had more than one guy beating on me at the same time. I haven’t figured out what the difference is in those scenarios, however.

All in all, the game looks pretty good from an AI standpoint. I say that based on the fact that I haven’t noticed anything horrible about it. That’s usually a sign that things are working well. Figure that AI should be like umpires or referees in a sports game. They are necessary for the game to work smoothly, but you shouldn’t really notice that they are there.

I’m returning AC to GameFly tomorrow (although I will probably buy it because my kids are addicted to it) so it will be a bit before I follow up on this post. You can check to see if I have written anything else by clicking the Assassin’s Creed tag below.

Make sure you subscribe to the Post-Play’em feed to see more reviews and analysis.

Add to Google Reader or Homepage

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