IA Logo

IA Information

Dave Mark's books

Post-Play'em - Observations on Game AI

Posts Tagged ‘steering’

Splinter Cell: Conviction – First Look

Sunday, July 10th, 2011

I’ve been putzing with Splinter Cell: Conviction on and off in recent weeks. As a side note, my use of it has mostly been “off” because I find it frustratingly difficult, even on “normal”. That being said, I’m impressed with the game as a whole.

Too often in games can we do stuff that is completely ridiculous and people don’t even react at all.

One of the first thing I noticed was how “by-standers” react to me. If I’m crawling around on a wall or doing something else “odd”, they will turn and look or making some snarky comment. I like that in a game. Too often in games can we do stuff that is completely ridiculous and people don’t even react at all. In order to facilitate this, I assume that actions and/or locations were simply flagged as “odd” and broadcast to the people in the area.

Similarly, I like how the “Thief-like” environmental triggers can arouse the attention of the bad guys. The voice acting in this case really sells it. They are often very subtle about it, saying things like, “hey… I’m gonna go check something over there.” It could have been done in a more heavy-handed way (e.g. “I heard something over there.”)… but the way they did it almost projects how the AI is actually questioning itself. The minor difference makes you (the player) think more “I need to be more careful” rather than jumping straight to “Oh shit!”

Anyway, that isn’t what I was wanting to write about…

No Rails Here!

Obviously, being the type of game that it is, there are more than a few opportunities to lie in way for people. Early on, there was a point where I was waiting for a guy who was unaware of me. I found myself falling back on old gaming mentalities and trying to detect his “patrol route”. That has long been a staple of games—to the point where it has been ingrained in me.

I kinda just had to mentally will him in my direction.

Needless to say, the baddie didn’t follow a pattern of any sort. I kinda just had to wait him out and mentally will him in my direction. Plenty of that time was spent watching him not move at all. I actually wondered for a while if he was a static set-piece rather than an ambulatory one. He wasn’t… he was just alternating between hanging out and wandering around. It really did a good job of selling the idea that this guard was that reasonable mixture of responsible and bored to tears.

On the other side of the coin, when the guys are actually searching for me, the game does a good job of making them look reasonable in their search for me, but also looking somewhat unpredictable. They don’t do the standard “run right toward where the player should be” gameplan once they lose track of me. That would be too silly. Once they have “lost me”, however, they don’t just go searching around willy-nilly; they keep to a reasonable area. That makes for a lot of tense moments when you are holed up in a corner!

While they are searching, the agents do a good job of looking around with that slightly spooked feeling. They will swing their flashlights around—sometimes in radical changes of direction like they are either surprised by a noise or trying to catch me by surprise. I actually found myself just watching the AI search for me to see what all they would do. (Well… the fact that I was on the outside of a windowsill with nowhere to go was a factor.)

Down in Front!

The combat AI seems solid. Their reactions are decent and they usually take cover fairly well. I don’t believe they use cover quite as well as what I have been seeing in Gears of War 2 (which I am finally almost done with). Sometimes they seem to be on the wrong side of it. Not on my side, mind you… just on perhaps the 90° side of things rather than opposite me.

A guy ran up and hid along the side of the couch that I was crouching behind.

On the other hand, the enemies don’t seem to do as much pointless running around as they did in Gears. They might want to consider more than simply cover points, though. There was one moment where a guy ran up and hid along the side of the couch that I was crouching behind. I was so startled that he would run up to get within point-blank range of me that I was very taken aback.

They don’t seem to use their environment in as dynamic a way as F.E.A.R. did, but it doesn’t set them back. In fact, if they were flipping couches and knocking over bookshelves, it might have looked a little contrived.

You Really Get Around!

The pathfinding is decent (thanks, I’m sure, to the excellent navmesh work of my buddy Martin Walsh). I believe there was one moment early on where I saw someone backtrack 2 steps before doing a turn the other way as if he was on a grid. That may have been something else, however. I just remember noticing it because I knew ahead of time that the game was on a navmesh.

While the local avoidance on the streets seems OK, I think that the “personal space” buffer could have been increased slightly. People coming the other direction weren’t steering to go around me soon enough. That’s minor, though.

When I make Sam stop and reverse direction quickly while running, the animation reminds me a lot of the same action in Assassin’s Creed. I have to wonder if that is a coincidence or not.

All in all, I’m quite pleased with it so far. I do need to pay a bit more attention to the AI in the combat situations. On the other hand, the fact that I’m so distracted with staying alive means that the enemies are certainly doing their job well!

Gears of War 2: Cover vs. Running Around

Sunday, June 12th, 2011

The recent E3 (2011) reminded me that it was time to catch up on some games. Additionally, it reminded me that I really want to comment on the AI of the games that I play—something that I haven’t been doing as much of lately… at least not on here. So, after having not touched it for a while (2 years!), I picked up my copy of Gears of War 2. (Thanks again to Epic AI Programmer, Matt Tonks, for providing me with a copy of the game.)


The AI in Gears 2 actually uses cover in a reasonably intelligent manner.

It took me a while to get back into the groove of the control system—most notably how to use their cover system. At the time, using cover that way was a fairly fresh idea. It has been utilized in plenty more games since then, of course. Even better was how the AI was using cover. Unlike other games that I have played where the AI either subscribes to the “Doom model” of standing out in the open, or half-heartedly takes cover, the AI in Gears 2 actually uses cover in a reasonably intelligent manner.

For example, compared to how the AI in Mass Effect used cover as two ends of a shooting gallery path, the AI in Gears 2 seems to take advantageous cover and keep it. This really adds some nice depth to the game in that, often, the only way to solve the resulting stalemate is to flank them so that their cover is less useful.

I can’t just sit there and play Whack-a-Mole.

Their “pop-outs” to fire on me are quite unpredictable which is frustrating (in a good way). Additionally, if the cover is long enough for them to move behind it, they seem to do so. Again, this is one of those things that, unless I was running a video recording, it would really be hard to discern in the middle of a firefight. What I do know, is that I can’t just sit there and play Whack-a-Mole with someone who is in cover—waiting with my cursor positioned perfectly so that when they pop up, I can pop them. That has always been a tactic that my slow thumbs relished because it was so simple to defeat. If the enemies are moving and popping up at unpredictable intervals, I either can’t anticipate where or when they will do so, or I simply get anxious and move on to another target that is visible.

As a follow -up to that last point, it is often hard to switch from one target to another in time because their exposure is so limited. They truly do only “pop out” rather than “come out and remain a really obvious, easy-to-hit target.” All of this serves to create a very frenetic atmosphere in the combat… even the “trench warfare” combat that could normally get pretty stale.


Unfortunately, there is some issue I take with the combat AI. Sometimes, both friend and foe seem to get into a mode where they are dashing around in odd ways. This seems related both to target selection (and by this I mean not just who to shoot but where to go) and idle situation positioning. In the former, it seems similar to what I experienced with Dragon Age: Origins. In that case, enemies would run past one of my allies—completely ignoring them—in order to get to me.

It simply doesn’t make tactical sense to leave your group like that.

In this situation, it isn’t necessarily limited to the enemy having an unhealthy preoccupation with me. My allies will run off into combat way out in front of what are obviously established lines. This surprises me quite a bit when I’m looking way downrange from our location (even sniping) and suddenly see one of my allies appear in my scope. It’s not as if I am holding back—often there is combat happening directly in front of us. In a game where one of the mechanics is being “revived” by one of your allies, it is disturbing when one of them runs so far afield. Even without that mechanic, the nature of this game is one of squad tactics. It simply doesn’t make tactical sense to leave your group and go deep into a group of enemies like that.

The issue (both friend and foe) could be solved by a better decision selection algorithm that takes into account proximity better. This could be achieved in two ways — first by scoring individual choices better (e.g. including better opportunity cost for cover points), or on the whole by including influence mapping. Certainly, influence mapping would then be rolled up into the decision-making process, but you could manage better mathematical decisions without necessarily inducing the overhead of an influence map.

There is no concept of “personal space“.

When the characters are supposed to be idle, I’ve had a number of situations occur where my allies were simply not paying attention to me or other allies. They will bump into me in an open area obviously trying to get to a spot on which I’m already standing or at least near to it. There is no concept of “personal space” even to the point of them trying to be in my space.

Sure, much of this could be solved by the inclusion of simple steering and separation algos, but I have to wonder if the decision of where to go isn’t being locked in too early and therefore overriding the sensibility of how to get there. What was a legitimate destination when you started there became a poor choice by the time you were half-way. Therefore, you either look like an idiot going there in the first place or, once you get there, you immediately change your mind and go someplace else. This would certainly lead to some of the “running around” behaviors as well. The solution partially lays in updating your target location often. Sometimes, changing your target location is really not that big of a deal anyway. If your goal is simply a random walk, your destination is unknown to the observer and largely irrelevant anyway.

Working Together

One thing that I haven’t seen (yet?) is a good sense that the enemy is working together. I mentioned this in my First Look post on the game over 2 years ago. Having played plenty of Halo 3 and Halo: Reach, I’m used to seeing the “organized fall-back” behavior that was built into their enemy AI. Not seeing it here in Gears 2 is actually kind of startling by its absence. Certainly building in that kind of behavior goes beyond the AI brain of the characters. It needs to be designed into the levels, etc. That may not have even been an option for the Gears team much less a consideration. I just wanted to point out that I “felt” it not being there.

Anyway, I’m not done with Gears of War 2, so if anything else comes up, you will see it here.

Dragon Age: Origins – Don’t Crowd!

Tuesday, May 25th, 2010

OK, so it has been a little longer than “later this week” for getting to Dragon Age: Origins commentary. I can’t believe I wrote my first look post back in late February. Of course what that really means is that I’m burning some serious GameFly time on this one title… and it’s not like I’m playing it much. My son has managed to get all the way through it, however.

Still, there are some things I noticed as I was going through (which, admittedly, is not all that far yet). One was an odd happening in the Ostagar camp. I was cruising around looking at things and talking to people. As I was standing there talking to Duncan (and a couple of others), a camp soldier of some sort came and stood near us. From the looks of it, he was supposed to be dealing with another person there, if I recall correctly. This didn’t really catch my notice until a 2nd soldier came up and attempted to stand in the same spot and talk to the same person. They jostled each other for a bit until the first one walked away – apparently on a random patrol route.

…a 2nd soldier came up and attempted to stand in the same spot…

I believe that it was the random patrol routes that caused this issue in the first place. My guess is that the guard logic simply selects a new destination and heads out in that direction. If, for some reason, there is someone already there, it doesn’t detect this or care… it simply continues to try to get to the node.

There are a few ways to either avoid that or fix it. First, the goal nodes could be reserved and released as they are selected and then left. The problem with this solution is that a goal node would be “out of commission” from the moment someone reserved it to the time they left it. If they were coming from all the way across the map, that node would be off the market for quite some time without actually being used. Additionally, it would prevent someone from heading in that direction until the original occupant actually left.

A lot of work to make the camp “feel alive” went down the drain…

A more realistic solution would be to simply be aware of other people. If there is someone on your “spot”, don’t actually try to move onto it. This could be done by simply stopping short of your intended goal (e.g. stand next to him) or by using some local avoidance. The later is probably better because collision avoidance should be part of the movement scheme anyway for other reasons.

Anyway, the result of this was that it was a jarring cancellation of my suspension of disbelief. Because it was right next to me and in view, I couldn’t help but notice that these two dolts were climbing all over each other. A lot of work to make the camp “feel alive” went down the drain right there.

Half Life 2: Movement on Rails

Monday, February 9th, 2009

OK, I admit that I had not gotten around to playing Half Life 2 until now. (It’s part of my post-book writing, pre-GDC ramp up.) I am not terribly far into it. I am alternating between riding my airboat (kinda fun!) and having to stop and do the various side-tasks.

So far the enemy AI is decent, although bland. (I’m playing on Normal, if that matters.) I’ve noticed a little ADD in the soldiers, however. They can sometimes forget where I am (or just was). If they are supposed to be looking for me, it isn’t working.

Another annoyance was the rails that the background people are walking on. During some of the opening scenes, when I was in the middle of a large room, people would walk straight through me. At one point, I didn’t notice what had happened right away other than that I was jostled out of the way. However, only about 15 seconds later, while I was standing in the same spot in the middle of the room, another person walked down that exact same line. I looked around a little to see if there was an obvious path that I was on but I didn’t see one. It looked like they were simply going from one point of interest to another and didn’t care that I was in the way.

Possible solutions involve the addition of a steering behavior on top of the standard pathfind. Even just the addition of a vocal cue of “excuse me” or “look out” would have softened the blow somewhat. Instead, the citizens came off as completely mindless.

On a positive note. The manhacks are convincing in their movements, though. They remind me of how difficult it is to control those little remote-control helicopters… which I suspect is the effect they were after.

(Remember to click on the tags below to see more about my observations of Half Life 2.)

Add to Google Reader or Homepage

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