Building believable AI in games: F.E.A.R.

Building believable AI in games: F.E.A.R.

James chats with renowned AI developer Jeff Orkin about his ideas and philosophies behind the award-winning AI he built in the Monolith Productions/Sierra classic First Encounter Assault Recon, or F.E.A.R

When you think about artificial intelligence in videogames, you might immediately think of one of the millions of creatures designed to jump out of a corridor and wail aimlessly at the player who’s lying in wait to mow them down with a sawn-off shotgun. But there’s a lot more to it than that. Maybe for some it’s enough that an enemy comes at you the moment it spots you, giving no thought to its own safety or well being. But what if that enemy could hear you coming, then sneak around to your position? What if they could radio their squad and have them take up defensive positions in ready for your approach? And what if none of that was pre-scripted, but it happened ‘naturally’ because the AI decided that was the best course of action?

A good AI should help immerse you in the game world they are in, and to get them there takes both a lot of time and developer brainpower. In order to understand more about the process of creating an immersive AI for a game, I got in touch with some people who know better than most the time and effort it takes to get it right. In this second of three email discussions with AI programmers and game developers, I ask Jeff Orkin, founder of Giant Otter Technology and former AI lead at Monolith Productions, about his prior work on the highly lauded AI enemies in F.E.A.R.

HYPER: When I put out a call on Twitter for games that people think of when it comes to memorable AI, F.E.A.R was, by far, the most mentioned. For me, I remember the tension I felt when playing it, not only thanks to the Alma and Paxton Fettel characters, but the way the enemy soldiers interacted with the player. It made each battle encounter feel suspenseful. What were the main goals you wanted to achieve with F.E.A.R’s AI?

JEFF: We wanted FEAR to feel like you were playing against a squad of real humans.  Having them constantly chatter with each other about what was going on contributed to that. We also wanted the whole game to feel like an action movie, where over-the-top dramatic things were happening around you whenever possible (that was actually the placeholder name for the project in the beginning - Action Movie).  And, we also took a lot of inspiration from the marines in Half-Life 1 - we wanted AI that felt like that, but was unscripted.

F.E.A.R’s AI was highly reactive to the player’s decisions. How much of a challenge was it to formulate the list of actions you wanted the AI to perform, as well as react to?

We had a great starting point to work from - NOLF2. The first pass on the AI was just re-implementing behaviors that worked well in NOLF2, but using a planner instead of a finite state machine. Then we expanded beyond that as we added a wider variety of enemies.  The big change to the general AI for enemies overall was the addition of the squad layer, that could coordinate a team of enemies to take turns advancing, or coordinate to have one guy lay suppression fire while others ran for cover, etc.

Given what was available to you at the time, did you run into any technical limitations? Were there things you wanted the AI to do but couldn’t make work?

Yeah, definitely.  When we were writing the new AI system, starting in 2003, it was a challenge to get the performance we needed for an FPS while up to ten characters could be running planners at once. That's what led to GOAP - which was a simplification of the planners that existed in academia, optimised for games.

There were a couple things we wanted to do, but didn't have enough time to get right. We wanted much more interaction with friendly AI, but doing that well requires solving different problems than is needed for enemy AI - more work on making sure AI don't get in the player's way, or steal the fun. In FEAR you are supposed to be part of the FEAR team, but we ended up having to script most of the parts that involved other buddy characters. The other thing was the Combat Opportunity System. I worked closely with Lead Level Designer John Mulkey on this new system that was supposed to encourage AI to do dramatic things whenever possible - like shoot up a nearby prop, or pull a lever to drop something, etc. But we found it hard to get it to work as we hoped. For example, an enemy would run into a room, and find himself so busy shooting at bottles that he would forget to target the player. It was a cool system with lots of potential, but we just ran out of time to tune it properly.

READ NEXT: Building believable AI in games: Halo

How did the Reflex Time mechanic affect the AI, if at all?

I didn't really have to think about that much.  It was kind of lower level, and transparent to the AI. The only time I remember giving Reflex Time much attention was when working the really fast alien guys, who you can't really see moving around unless time is slowed down.

How did you balance the AI with the scaling of difficulty? At higher difficulty levels did the AI simply take on super-human reaction times and higher health numbers, or was there a more fundamental difference between AI on easy or hard?

The AI system gave designers control over goal sets and actions sets, and we could modify these according to level of difficulty. I don't remember specifically how we changed things, but an example would be that on Easy, enemy soldiers wouldn't have access to some of their Dodge actions, so that would be easier. Other than that, it was mostly standard adjustments on their speed, hit points, firing accuracy, etc.

Is there a point where you can overtune the AI? Can it go too far?

Probably not. Making AI that is fun to play against requires some painstaking tuning. Great game AI is probably like 30% due to the tech, and 70% due to the love and sweat put in by developers (and a collaboration between engineers and designers, for the best results).  But the purpose of the tuning is not to make the AI as difficult to play against as possible - it's tuning to get the AI to feel dynamic, human-like, and adaptive to the player.

Are there any games you feel have made a significant step in the AI space in recent years? If so, why? If not, why not?

That is sort of a complicated question. On the one hand, I think the most notable innovations in AI in AAA action games (FPS, open world, etc) have been more about clever design, and flawless execution. I'm referring to work like Elizabeth in Bioshock Infinite, and the Nemesis system in Shadow of Mordor - so well done in both cases, but less about advanced AI, more about using current AI really well, and designing around it to get the best results. Similarly, there has been some good work on bots for MOBAs and other multiplayer games - well executed with approaches that are pretty common, like behavior trees.

On the other hand, there are some pretty exciting results coming out of deep learning research, like just recently DeepMind announced some new work on AlphaGo that learns how to play without needing historical data (recorded human games) to learn from. It's just not yet clear how much work like this impacts AAA games, as opposed to board games - basically not at all, yet. The first steps in that direction might be applications of machine learning to strategy games like Starcraft II.

I definitely think there are some big opportunities to apply AI to things like dynamic conversation between characters in games, more advanced squads and buddy characters, and AI influencing the narrative at a higher level than individual characters. I've spoken to a lot of studios recently, though, and what I'm finding is that the game industry is a victim of its own success. Projects have gotten so big and expensive that they can't take risks on something so central to the experience as the AI, so developers are just sticking with the status quo, and innovating in other ways - not AI. 

There tends to be more innovation in indie games, but they have the opposite problem - they can't afford to invest in developing advanced AI (which often also requires an investment in content creation - behaviors, dialogue, etc). It's encouraging to see big players in the industry, like Unity, working on some innovative AI, though. They recently released some examples of using reinforcement learning in Unity, and they have a planner in development for character behavior. So this may be a route to elevating the whole industry, if Unity does a lot of the heavy lifting, this can empower smaller developers to start doing more experimental things with AI in their games.


Most Read Articles

How to cast from Windows 10 to a smart TV with 5KPlayer

How to cast from Windows 10 to a smart TV with 5KPlayer

How to: Fix a stuck Windows 10 update

How to: Fix a stuck Windows 10 update

Review: Alienware AW3418DW 34-inch curved gaming monitor

Review: Alienware AW3418DW 34-inch curved gaming monitor

PC & Tech Authority and APC magazine are merging!

PC & Tech Authority and APC magazine are merging!

Would you like to receive

Our Newsletter?