IA Logo


IA Information
Communication

Dave Mark's books

Post-Play'em - Observations on Game AI


Posts Tagged ‘target selection’

Skyrim: It’s a Free-for-All!

Sunday, January 1st, 2012

Just had a battle out on the plains west of Whiterun. It was bad enough that I got jumped by a dragon. Then, the dragon flew a ways away and started chillin’ a nearby mammoth. Lydia and I continued to take potshots at Mr. Dragon (Mrs. Dragon?) while the mammoth ineffectually stared down its assailant. Eventually, the mammoth started running (right past me and Lydia!) and the dragon seemed to give up on it.

Unfortunately, I soon realized that there were a couple of mages wandering around the area who, for some reason, apparently decided that Lydia and I were far more menacing than the circling beast. And then¬†there was the skeleton — who may or may not have been the product of the mages who started attacking me. By the time I dispatched the skeleton, the dragon had gotten bored with whatever it was he (she?) was fighting nearby and came back to visit. This all came to a rather unfortunate end… but that’s not what I came to tell you…

“There seems to be a serious lack of proper prioritization of targets.”

The point of all of this is that there seems to be a serious lack of proper prioritization of targets. For example, despite the fact that a mammoth might look awful tasty to a dragon, said morsel is not going to be able to attack you. Better to dispatch the pair of annoyances that are pumping arrows into you and come back for the hairy buffet later.

The same can be said for the mages. If there is a dragon cruising around, it seems rather silly to attack two relatively harmless bipeds. In fact, the chances of defeating the dragon (and therefore surviving) would go up considerably if it was attacked by a group rather than by a couple of individuals. An additional bonus would be that the dragon might take such a toll on your secondary opponents that it leaves you an advantage you might not otherwise have.


Obviously the target selection algorithm doesn’t take a lot of this into account. It’s really a matter of mathematical modeling. Ironically, it is the same sort of modeling that goes into non-combat games such as The Sims.¬†The good news is that it is relatively simple to put together and can adapt to pretty much any situation that your NPCs find themselves in. It can also be ¬†tied into the entire combat selection system so that the possible actions could include not attacking anyone at all (even running away, if necessary).

For those that are curious as to how such utility-based systems can be built, it is pretty much the entire point of my book, Behavioral Mathematics for Game AI.

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.

Summary

“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!

 

Add to Google Reader or Homepage

Latest blog posts:

IA News

IA on AI

Post-Play'em




Content ©2002-2010 by Intrinsic Algorithm L.L.C.

OGDA