Why the F.E.A.R AI feels so smart

And why no one beaten it since 2005

What even is a 'F.E.A.R' anyway?

Fear is the 2005 horror shooter with a scary girl (oooh) who does spooky things, like tearing your enemies limb from limb in front of you. However, I'm not going to be talking about the horror elements. Im going to be talking about the tactical AI of the enemy 'Replica' units.
This replica is unaware they are going to take a 12 gauge to the face.
The developers cleverly put us up against a army of clones so that they wouldn't have to design many enemies. So what exactly is it that keeps them so interesting to fight against throughout the whole game? Partly the level design, and partly the AI.

AI

I've read the paper on the design of the AI in fear (which you can read here) and nothing mentioned is really that advanced, but is still more complicated than most AI enemies today.
Most AI's follow a simple system of states (such as in cover, moving to point, firing at player, running away ect.) and fixed transitions between those points (if no ammo -> hide in cover, if low health -> run away) ect.
Fear instead goes for a modular approach (modular meaning like lego, pieces can fit together more easily). The AI has a list of variables called state. These represent things about the enemy and you can think of it as its current 'context', such as cover, health, ammo, enemy distance, weapon range. The enemy also has a set of actions, however these actions are defined as changes in state. You can think of them as trading variable A for variable B. The model can then chain these in a way that achieves its goals, which are also defined in state. This is called GOAP (Goal oriented action planning). This might seem complicated, so lets look at it with an example.

GOAP - example

The unit has the current state of
Name Value
ammo 0
enemy_health 100

The unit has the following actions avaliable:
Name Effect Time/Cost
reload sets ammo to 30 10
shoot reduces ammo and enemy_health by 1 3

Lets give the unit the goal of killing the enemy. The unit cannot shoot, because it has no ammo, so it will chain together the 'reload' action and the 'shoot' action to achieve its goals.
The exact algorithm used to find this chain is A*, as this allows each action to have a cost assigned. This result sounds obvious in this case, and it is, but the key advantage of this method is the extendability. Hundreds of new state and actions can be added without having to worry about how every action might transition to another. The best way to explain this diagram from their research paper.
New system on the left and old one on the right.
It does have limitations however. Firstly, the system of state only allows for single varaibles (i.e no lists). This makes it difficult for the model to comprehend multiple weapons or enemies.To counter-act this, the developer's have taped on a system that exists above it, to handle those decisions. Not ideal.
Secondly, The program becomes increasingly stupid the longer action chains are made. This is because as time passes, more unknowns are introduced (i.e the player might have moved). However, there isnt a good solution to this. Predicting into the future is inherently difficult and as game developers we don't know exactly what the player will do.
Finally, the squad-based behaviour is a simple state machine talked about before. They were clear this could have been improved, but they didn't need to.
So we just talked about why the AI is not really that advanced. Then why does it feel so smart to play against?

AI vocalisation

Tactically, announcing to the enemy what you are going to do is a horrible move. It lets them easily plan around it. However, in F.E.A.R I never felt once that this ruined the immersion that I was fighting against a smart, co-ordinated team. Messages like "We have a man down", "Going in for the flank", "He's over there", "Requesting backup", "What's your status?" are all key. These little messages let the player know that the AI is really thinking. It highlights the decisions that are being made, and best of all lets the players imagination fill in the gaps for those that aren't.
For example, flanking is never implemented as a specific behaviour. Enemies will naturally go to cover, and that cover might happen to be behind the player, due to the level design. Speech really helped highlight these actions as if they were intentional, when they were really emergent behaviour.

Level design

While I have been talking about the AI as advanced or smart, The way I would describe it in game is scary. (Which I shouldn't have to tell you is good for a horror shooter). I find myself crouching and slowly moving to get the jump on the AI, for fear that if I dont it will get the jump on me. And part of this is due to the level design.
An example of the open-ended level design. Although in this example, the player will probably only see half of the game, which is un-ideal.
Throughout about half of the game, you will be in a situation where the level is quite open ended, and by that I mean not exactly linear. At any point in the level, a AI could go back through a route and approach you from behind. I think these open-ended areas are the strongest parts of F.E.A.R and I would have liked to see more of them. I would love to see a system where a player is dropped into a indoor but still non-linear world, with squad's like these wandering around.
As for the actual environments, many players found the bleak industrial or office zones lackluster. I agree they all blended together somewhat, but I think that helped put the focus on other elements in the levels, like the enemies.

Does every game need smart AI?

No one complains about the goombas in mario for being too stupid. Plenty of enemies (especially bosses) are purposefully stupid so they can be predicatble. If the enemy is predictable, there is less suprises for the player and the player can more easily plan around them. In casual games like mario, or hardcore games like demon souls, randomness is frowned upon and a intentionally stupid AI is preferred.
Another reason is that an AI that is a perfect tactical opponent is not one that is very fun to play against. If F.E.A.R's replicas worked as a perfect special forces team, I would be dead before I got a reasonable chance to react. Games are usually about winning insurmountable odds (Most characters kill hundreds or thousands of enemies througout a campaign). While saving and loading are the main power a player has, superior decision making is also a key factor. Multiplayer games are more popular than ever, and If I wanted to play against a smart fair opponent, I would just play a game of CS-GO. What game developers are really looking for is the illusion of a smart AI. One that makes reasonable decisions, and most importantly keeps the player immersed in the illusion that they are fighting a smart threat.
The reason I dont play CS-GO.
Think of it this way. Imagine you are playing chess with a child. You could easily crush them (depending on the child), but doing it would mean they would get bored quickly and never play chess again. But if you play super poorly, and let them win, they will realise this (again dependent on the child) and the victory will feel cheap for them. The right way would be to seem smart while actually making poor decisions, so that you can be on the same level. And I believe that is the goal for AI's within games.

Is game AI dead?

Probably... The word 'AI' has already gone from meaning enemy ai and I-robot to meaning generative AI and machine learning, and I think it is very unlikely it will ever return. I don't see generative AI being used in a innovative social game in its current state, unless it gets a lot more econimcal to run the models (which is happening).
Oh well. If there is one thing you learnt from reading this article, and one thing I learnt from researching it, is that appearing smart is much more important than being smart. For game AI, that is.

On the game itself

My favourite part of this game is its tactical battles and I like to take them slowly, peeking behind cover and aiming down sights constantly. I care less about the flashy gun-fights or the horror elements, and I barely used the slow-down time mode at all, at least until the mechs start showing up. I think this genius is something its sequels missed, or more likely ignored. I'm yet to see this kind of gameplay in any other game, even in F.E.A.R's so called spiritual successor, Trepang 2. If you know of anything, please let me know, but I really think this is the most modern example of this kind of gameplay in singleplayer, and it saddens me a little.
The slow mo action felt somewhat like cheating to me.
However, on a positive, the game is very flexible. I was able to play it slow and tactically and enjoy it my way. Others can enjoy it running into enemies, blasting them in slow motion. Both playstyles are fun and valid, and if that isn't objectively good game design, I don't know what is.

Thanks!

If you read this far, I hope you found it worth your time. If you didn't, please send me a message telling me how bad or even just mediocre it was. If it was worth your time and changed your life, send me a message telling me how awesome it was. If you just scrolled to the bottom because the text wasn't stimulating enough, I cant blame you, because I probably did the same to your blog post. This is my first blog, so I think they will get better from this point. Thanks for reading.