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.
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.
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.
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.
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.