FEAR, HL2, AI, and only doing cool stuff when the player is looking

(gravis did a comment on my FEAR post so long he made it a post, and now I’m doing that with that post, and this ends up being about all kinds of things)

Half-Life 2 (and maybe 1, but I don’t think so?) had a trigger type called trigger_look, which was like a regular trigger, but it only executed if you were both standing in the trigger and looking at the specified entity. They used it heavily for Gman stuff – in HL2, if you walk backwards into an area you’re supposed to see the Gman in, and then turn around, that’s when he straightens his tie and walks away, he only does it if you’re looking.

I remember thinking this was incredibly cool at the time, and it was, not for the ability to do that check necessarily, but for exposing it to level designers as a trigger type – a coder at Valve saw the problem of “player isn’t looking when the cool thing happens” and provided LDs (who were the ones making all the scripted sequences) with an easy way to say “wait til the player’s looking, then do it”. It’s a level of facilitation by code of LD that, these days, you’re surprised (and often pathetically grateful) when you see it.

HL2, while I have my issues with it, was a rare case of a sequel seeing a lot of the core concepts that worked in the first one, which are hardly ever the ones that players notice, and digging deeper into those. The “do cool thing only when player is looking” stuff is everywhere in HL2 – if an NPC’s bullet is going to miss its target and hit an explosive barrel, only do that when the player’s gonna see it, otherwise the player doesn’t know why the thing is on fire. The fast zombie only leaps at you when you’re looking at it. The Strider only fires its big alt-fire cannon when someone’s gonna see.

While the AI in HL2 was, for me, a big miss (and I did a youtube video about it) this “look trigger” stuff is, I reckon, a big piece of the oft-neglected puzzle of making game AI feel smart, a goal which I’ve come to reckon is basically at odds with how most games are produced (at least beyond indie, indie being usually not where a ton of AI work gets done).

There are a ton of games, real expensive AAA games, with what you’d call, if you were a person who writes AI, really good AI, but players don’t note the AI, and have no stories to tell about it.

The last two Splinter Cell games are like this – the AI is doing cool, impressive things, and nobody is impressed; it comes across as serviceable. Nobody says it’s bad, nobody says it’s good. But the very first time you play a level of those games, you are impressed. You’re impressed when you’re hanging off the side of a building, and an alerted guy who thought he saw you running towards the window a second ago actually bothers to stick his flashlight out the window and check the side of the building. That’s incredibly cool, the first time. It stops being cool the same mission, because they do it constantly, even if they never find you there. Suddenly we’re living in a world where the outside upper wall of a multi-storey building is the first place you look for an intruder. Everyone knows that!

The issue is rarity: behaviours are cool because they’re rare. AI looks smart when it deals correctly with an unusual situation. Like in FEAR, the way a scared soldier who’s the last in his squad will throw himself onto his belly to crawl under a truck, and this only happens when there’s a scared last guy in the squad and he doesn’t think you can see him and there’s a truck. You can easily never see this happen!

But the way big games are produced, if a thing is cool, it cost money, it continues to cost money to keep it working, and you better justify that investment by putting the Thing on the screen whenever you can. What’s the point if nobody sees it, right? But actually, what’s the point if everyone sees it all the time.

I reckon the best approach to making smart, reactive-feeling AI in a real-time game that people relate to, remember, talk about, get freaked out by (especially, but not necessarily, in an action or horror thing) is to really budget and stagger out your cool behaviours, the way some of your smarter games will handle dynamic dialogue (eg Left 4 Dead) such that they’re genuinely rare – one-offs, even – and making sure that when they do execute, they have the player’s attention. There was a pre-release interview about Half-Life 2 where some dev said the zombies were so smart, they could encounter a locked door, punch out the little window in the door, reach through and unlock it from the inside. That didn’t ship, but imagine if it did, and then they made it super unlikely? Wouldn’t that be the coolest fuckin’ thing that ever happened to you?

in reply to @joewintergreen’s post:

blazehedgehog

The horror was something that built up for me over time. It was a nice contrast to horror games where the scares peak and then it turns in to a lukewarm action game. FEAR felt backwards in a good way — great action where you slowly feel the atmosphere creep over you. Great vibes of being somewhere you’re not supposed to be after hours.

Geight

I feel like whether horror elements land or not comes down to player interpretation: It’s either “this little girl isn’t scary, I just took down a whole army” or “I just took down a whole army and I still can’t frag this little girl, I’m terrified”

MrWildBunnycat

I played F.E.A.R when it came out, I was a late teen who hadn’t played any horror games before that (and there hadn’t been any horror FPS games like that before). It was a visceral experience – I was so immersed it was like I was there. The graphics blew me away at the time, but I had only just gotten an upgraded PC around that period; I would stand under a light and turn my viewpoint around, mesmerized by the bump mapped textures on the guns and the mind blowing parallax mapping from the decals.
The story kind of flew over my head mostly, but I loved the sense of being in a X-Files like setting. The scares genuinely terrified me (especially the one where you go down a latter and the animation makes you look up, if you know you know), but I kept pushing driven by morbid curiosity.
Weirdly enough, I wasn’t initially blown away by the combat. I found it tedious and it interrupted the part that I actually liked most – the suspense, mystery and horror. While I really enjoyed shooters, I wasn’t very good at them, so what I tended to do is abuse the slomo ability. I would just hide in a corner until it recharges, then activate it and gun everyone in the head. Years later I learned a more “proper” way to play the combat for a much better experience – ignore the slomo! The (still awesome) environmental destruction and John Woo “if you shoot a stack of paper it must explode into 10 stacks of paper” particle effects create an amazing action set piece every time.
I love F.E.A.R. I still replay it once every few years. Every time I gain an appreciation for some elements that don’t notice or completely take in with each consecutive playthrough. And while the scares don’t phase me as much as they used to, the final escape with the ghosts still gets me a bit tense. It aged like fine wine.

in reply to @cathoderaydude’s post:

AmanitaVerna

because in 2005, videogames didn’t know which direction you were looking.

The fun part of this misconception is that FPSes/TPSes have to know which way you’re facing in order to render things from your perspective. They always know where you’re looking, and determining if you can see something would be a simple raycast (after checking to see if you’re close enough to bother, because a squared distance check is cheaper than a raycast), but in this case it sounds like that wouldn’t even be necessary, since they could just trigger the animation when you reach/approach the top of the ladder. There’s no need to check where you’re facing if you can only be facing one direction.

joewintergreen

What Gravis is talking about is whether the Design of the game is Aware of where the player is looking. He’s functionally correct (maybe not to the year), games were generally not doing anything with that until around this time.

in reply to @joewintergreen’s post:

staryoshi06

I remember one time I was playing Halo 2, at the part where the marine is driving around in that empty gauss hog. While I wasn’t looking, the marine was killed and an elite climbed up into the gauss hog turret to use it against me, something they almost never do (both due to lack of opportunity and story reasons). That was a pretty cool rare moment.

johnnemann

As I’m sure you know, FEAR is famous in game AI circles for using/inventing GOAP planning, which is one of my favorite pieces of game tech ever invented. It’s not been used super widely even since then, and tbh I think FPSes are not the strongest place for it to shine. But it is what enables stuff like your examples!


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *