IA Logo


IA Information
Communication

Dave Mark's books

Post-Play'em - Observations on Game AI


Posts Tagged ‘scripting’

Gears of War 2: First Look

Sunday, March 8th, 2009

In preparation for the AI Summit that I am helping put on at the 2009 Game Developers Conference, I am rapidly cranking through some of the key games of the year. So, I signed up for GameFly just so I could putz with some games in the short term. I will likely buy some of these games down the road, but the research budget for IA doesn’t cover spending $300 on games in only a few weeks!

Well, the first thing in my queue (along with Fable 2… check back later for that) was Gears of War 2. I had seen a number of the reviews in various places and I was impressed by not only what I saw but by what people were saying about it. Despite having Gears 1 sitting here, I had never really played it. (My son had.) So really, I had no idea what I was getting into.

Ok, wow.

Obviously, it is a very good looking game… but that’s not what this column is about. After watching Yahtzee’s take on the game, I was also fully prepared for plenty of “chest high walls”. Of course, there’s good reason for that given that the cover fire system is an integral part of the game. On the other hand, I have not seen the poor AI quirks that Yahtzee cracks on the same review. (Although I suppose referring to the generally satirical and sarcastic Zero Punctuation blurbs as “reviews” is a bit of a stretch now, isn’t it?)

So far the AI seems pretty solid. Now note that I have only played the opening level up to just past the epic speech (<- unintentional pun for those of you who actually pay attention to the names of the game studios who crank out your entertainment products) so I haven't experienced too much of it. However, what I have seen has been pretty decent for a shooter. The enemies are frustratingly adept at using cover. I have often found myself flanking them just so I can get a shot around whatever “chest high wall”-like object they are behind. What’s more, I have noticed that they will shoot from around different sides of the object. If the baddie is behind a desk, he may pop over it or around the side. This is a nice touch of realism that steps away from the typical method of 1-1 relationships of designer-tagged points. That is, there is no “and at this point, the AI can shoot over the object.” There seems to be simply “here’s a hiding spot… let him do what he needs to do.”

My allies seem to be pretty proficient at using the cover as well. Of course, I haven’t been paying too much attention to what they are doing since I have been concentrating more on saving my own ass. (Nota bene, I’m playing on the hard difficulty level.) However, as we move from battle to battle, I do notice that they are very conscientious of taking cover as we go… even when they are simply waiting for me to catch up.

All of this cover-taking is very refreshing in a shooter. I have (for 15 years?) been so tired of enemies (and allies) that simply stand out in the open and either wait to get shot or are so invincible that cover is unnecessary. (Yahtzee suggests this is possible in GoW2, but maybe he was on a different difficulty level than I am.)

For the most part, the animation seems clean. The transitions are pretty decent and any quirks seem to be more a result of the control system than the animation. That’s a hard problem to solve, so I don’t bitch about it too much. A better example is watching the animation of the AI characters rather than of myself. Everything seems smooth as they move, duck, fire, etc. I will pay more attention to that as I go.

I have yet to play enough to see how much of the enemy combat events are scripted and how many are dynamic. For example, early on the Locusts in the hospital are retreating… but that is obviously scripted as I have played through it three times (twice by myself and once in co-op with my son). I understand that. However, as I play on, I would like to see if there are places where the enemy retreats simply because I’m kicking his ass. I saw a lot of this in Halo 3, for example, which was controlled by Damian Isla and Max Dyckhoff’s battle management system. Given the impressive use of cover in Gears, the inclusion of a good fall back or retreat system would be cool. We’ll see.

That about covers it for the moment. More later. If you are jumping into this article, remember to check the Gears tag below to see if I have written anything else about this game.

Company of Heroes: Invisible Script Points

Sunday, February 8th, 2009

I just made another interesting observation on Company of Heroes. In the campaign scenario that comes with free download (the town of Carentan), two enemy tanks came barrelling over the bridges, busted through my defenses, and took up positions on the intersections just SE and SW (screen-relative) of my Town Hall. They then turned toward the building and started whacking on me. I dispatched those tanks right where they had turned. So far so good–great tactic.

However, a minute or so later, another tank came down the left side through about the same path as the first. He stopped exactly on the place where I had destroyed the first tank (never mind parking directly ON the smoking hulk of steel) and turned in the same manner to face the Town Hall. Wow. Serious Deja Vu, folks. It immediately jumped out at me that this tactic was exactly scripted–right down to the exact location to stop and turn.

An easy solution to this would have been to randomize the point somewhat. Use the original point as an anchor, but throw in a random displacement within a radius. Check to see if it is valid to not only sit, but to have the desired sightline, and then move to it. Rather than a single, repeated waypoint, you now have something that resembles “over there someplace.”

The unfortunately side-effect of this is that I now know that I can defend specifically against that particular point (mines? an AT weapon?) and be in business. Moreover, I know that I may have to defend against it more than once. That’s not what I play RTS games for. I want to react dynamically to the AI and have it react dynamically to me. Now this may simply be a part of the campaign mentality (which I have not always been fond of in RTS games). Just like how the Town Hall gets leveled every time at about the same time forcing me to fall back to the church. OK fine, I get it… I get it. Still, it was alarming to see them use the exact same point twice in succession.

Otherwise, it’s still a good game so far (I may have to ditch the free demo and pick this one up for real!)

Doom 3: Pretty Wind-up Toys

Thursday, December 13th, 2007

I dug out my Doom 3 again specifically for this blog. I hadn’t ever finished it when I started playing it about a year ago. It sure was purty, but it just didn’t engage me the way that I was hoping it would. Anyway, my thought as I returned to my saved progress was “pay attention to the AI so I can review it.” As I played, I became a little unsettled – not by my progress in the game, but by my progress in my quest for AI. I finally had to come to a realization that seemed almost blasphemous or sacrilegious.

Doom 3 doesn’t have AI.

Sure, I know that statement is a little over the top. Let’s face it, the AI in Doom 3is better than that of games from when I was a kid in the 80s. But that is also the heart of the problem. Doom 3′s AI isn’t much better than what was in the original Doom in 1993. Considering the related concept of Moore’s Law, you would think thought that AI would have increased at a geometric rate similar to that of anything else in computing. It is with that expectation that I claim that Doom 3 “doesn’t have AI”. Looking backwards down a Moore’s Law curve of AI, one could make the statement that the AIs in the past approach zero… therefore being zero for all intents and purposes – especially in a relative sense to where they should be today. So… my statement is now qualified somewhat. (Why do I feel like I’m going to end up having an uncomfortable beer with someone from id at the GDC in February?)

The comparison to the original Doom (or Quake, et al) is not far from the truth, however. The state machine has to look something along the lines of:

  1. Idle
  2. Agro
  3. If has ranged weapons – fire
  4. If no ranged weapons – approach target
  5. If health <= 0 then Die

That’s it. In the newer versions, you can splice in something towards the end that involves a side-step. The bad guy marines especially will do this. To me, the player, this makes me do the very involved strategic and tactical process of… uh… re-aiming my gun. Wow.

Admittedly, there are some baddies that give me more fits than others because they are not approaching me in a straight line. Lost Souls tend to zip around like gnats once they get close to you which is mildly annoying and Cacodemons will float around as you shoot them – but that means they have as much AI as a helium-filled piñata. There are other differences as well. The half baby/half fly Cherubs will back off a bit, prepare a moment, and then leap. Of course, so do the little spider things.

This is a major let down. I remember seeing some in-game clips at a game conference during an interview with Carmack. (I believe it was at E3.) The scene where the pink baddie tried to beat down the door, gave up and instead came crashing through the window was terrifying! “Wow! It gave up and used the window!” I told myself. When I played the game… and that exact same sequence happened, I realized that the whole thing was scripted. Oh. Bummer. Again, it wasn’t AI. Unlike F.E.A.R, where the agents do use their environment and re-plan when faced with obstacles such as the door above, the Doom solution was a movie crafted for my benefit.

I have been flanked by the computer, however. This I admit. Often! But that has nothing to do with the AI and everything to do with the placement of triggers. In true horror movie fashion, the computer does come up behind you often – but only because a designer placed a trigger on the floor that says “when player gets here, spawn evil dude behind him”. That isn’t AI. It isn’t even fake AI. In fact, it’s getting rather tiresome to know that every step I take is likely to generate an attack from a place I just cleared out. It makes for great anxiety and twitchyness – which is great for a horror movie. I admit that I have a good deal of tension when I play the game not knowing from which dark corner or what hidden panel I will receive the next assault. But it’s not AI. Really, it’s like making the “only average” fastball pitcher harder to hit by moving him closer to the plate or allowing him to throw from foul territory. He isn’t a better pitcher now… he just has been given an artificial advantage.

Really, the movement and attack logic for the enemy is not much more advanced than the little table-top wind-up toys. They will chatter away in my general direction, but there isn’t much purpose or reactivity to their actions. That gets very disappointing.

There does seem to be a bit of cheating going on, as well. The first time I fought a Mancubus, I was doing my best to flank him around walls. Despite having moved at least 60° off to the side, when I poked my nose around the wall to take another shot, I found he was already facing right at me. The explanation would have to be that there is omniscience on my position. Here, I had decided to do a simple, but what I thought clever, evasive maneuver only to have the game say “tough… I don’t care”. It’s deflating to have that happen.

There also may be some cheating going on for my benefit as well. This doesn’t fall exactly into AI, but it is relevant nonetheless. I swear that I take less damage per attack when I am almost dead. I haven’t done the math yet, but it seems that I can be in the teens or single-digit health for far longer than I spend in any other 10-number range. A hit that takes me down from 100 to 80, for example, may also only take me from 15 to 10. The result is that I spend a ton of time between 0 and about 40. Of course, if this is happening, this is a great device for creating tension in the game – and is a variant on rubber-banding. It’s rather artificial and arbitrary, though.

All in all, Doom 3 is a pretty game. It’s gorgeous. It’s use of dynamic lighting was cutting edge and very impressive for 2004. However, when you put it up against the interactivity and dynamicity of other shooters, there is something empty about it. It’s like trying to engage in a dialog with paintings in the Louvre. They are very impressive as art – but they aren’t going to talk back.

I have always respected John Carmack for his vision – and the “visions” that his games have provided for me. I just can’t help wondering what would happen if they were to put a bit more focus on AI. I notice on the Wikipedia site that Johnathan Wright is listed as an “AI Programmer” but that in the credits for Doom 3, he is just listed as a “programmer”. I would love to sit with him at a GDC party and have that beer. “What’s up, dog? Is there anything else you could be doing?” I can’t blame him, necessarily. Given the depth of the graphics rendering, he may very well just be out of clock cycles. *shrug* I hope that he has a better chance in the future. I would very much like to see an id offering that does “speak to me.”
Until then… there’s more than enough to challenge me elsewhere.

Call of Duty 2: Omniscience and Invulnerability

Wednesday, November 28th, 2007

I was playing Call of Duty 2 on XBox 360 last night. I’ve already gone through the full campaign on the normal difficulty and am now about halfway on “Veteran” (“…you will not survive”).

Enemy Invulnerability:
“I can’t be bothered right now.”

I was on the level where your convoy through the town in Tunisia gets ambushed. I had to start it over and over because I was getting pelted by the guys on top of the walls. I finally got down where I should hide and who I should tag first. One thing kept bugging me. There was a string of guys appearing on one wall in order. Most of them were gunners shooting at me – but there was one that had a Panzerschreck. I would try to shoot him over and over and he wouldn’t die until he had fired at one of the tanks/trucks in my convoy and blown it up. In the mean time, another one would pop up and take me down. I realized that it was pointless to try to kill this dude at all. He wasn’t going to kill me and that tank/truck was going to blow up anyway. It was part of the level.

What annoys me, however, is that it took me a number of times before I realized that, until that guy got his shot off, he was invulnerable. As soon as he was done with his job (that I was trying to prevent) he was now able to be shot. I wasted valuable time and got very frustrated by the fact that the level designers had decided that this was such a required series of actions on the level that they would break the rules.

I have found other instances where I have tried to peg some dude that was threatening me and was dead in my sights only to find that he had some sort of mission that couldn’t be stopped. That really exposes the scripting in the game. I understand why the scripting is there – and, in general, it is very well done in the game. I very much love some of the actions that happen despite the fact that I can tell you the exact line I crossed in order to trigger the action – but usually they are too fast for me to react to or something that is meant to be just watched anyway. Don’t let me point at a guy and unload an entire clip into his spleen while he doesn’t seem to care that I am there.

To me, it seems like this is a case of the “anti-sandbox” concept. Sure, a somewhat linear game like CoD isn’t meant to be a sandbox – and there are certain things that have to happen to advance the plot. That’s fine, but I always feel cheated when I can’t change the series of events even if I do the right thing to disrupt it.

Enemy Omniscience:
“Am I wearing an orange hunting vest?”

The other thing that I noticed the other day is that, while I can sneak up on some people from the side once in a while – which is very satisfying – there are other times when someone will spin 45 degrees to point right at me despite the fact that I am peeking between some crates or barrels or sandbags. It is almost as if I just barely moved into a place where the ray-trace succeeded and told the enemy that I was now visible. This is fine if I walk around the corner or pop up behind something, but it seems odd when only 2% of my body is visible. The result is that it seems like the AI is omniscient (i.e. cheating) as to my whereabouts. In some respects it creates excitement, in others frustration. I know that they aren’t trying to create Thief or Splinter Cell. Stealth isn’t the focus of CoD. Still, there are times when hiding is a requirement of the game. Don’t cheat me out of those brief moments of respite.

A possible solution to this is to measure how much of me is visible and then combine that with a coefficient based on how far “off center” I am from their current direction of vision. Perhaps another factor based on movement. I know that is a bit expensive to calculate for each AI (since their fields of view would all be different).

Another potential solution is to cast multiple rays to different parts of my body – perhaps shoulders, head and a couple of lower torso spots. If more than ONE is visible, then I can be seen. Not knowing exactly what mechanism they are using, it’s difficult to know how to improve upon it.

This is even more alarming when it is obvious that there is a bias towards firing at ME. I may have 10 squad members all hidden behind objects and taking pot shots at the enemy – or even running around in the open, but damn it if the AI doesn’t want to fire at me instead. It doesn’t happen all the time, but it is obviously biased more towards me than my squad-mates. This is an obvious design decision to make it more exciting. I understand that. However, when combined with the omniscience above, it’s kinda creepy.

[note: I've realized that waiting to write one complete writeup on a game is sometimes prohibitive - so I will write as I think of things... and tag them by game so you can find all relevant stuff]

Add to Google Reader or Homepage




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

OGDA