Tuesday, March 26, 2019

#NOTGDC Voices of F.E.A.R.

Voices of F.E.A.R.

Chances are if you are reading this article you already have a passing interest in the AI of Monolith Productions 2005 classic F.E.A.R. First Encounter Assault Recon. While FEAR is best described as a mid 2000s video game love-letter to imported asian cinema, it's mostly remembered for its horror thematics and Artificial Intelligence (although, I think there are other interesting things happening in this game too). Most of video game AI itself is about building the actions and reactions that an AI agent or NPC has and telegraphing those actions to the player. One of the most common ways to do this is through the sounds and ‘barks’ of the AI agent.


This blog post will take a look at sounds and barks used by AI agents to communicate with the player with a particular focus on FEAR, but comparing with other games as well.

Basic trends

There are some commonalities in most AI barks (including FEAR). They are short, often less than 3 seconds. They are often recurring; used/reused as reactions to the player often including whenever the AI agent changes state. They often contain multiple versions of the same line (3-5 seems most common) or they only play on a random roll (50% of the time when all conditions are met). Later systems tend to have ‘call and response’ barks. They don’t contain ‘plot’ information or critical narrative information (such as changes in the objective or an increase of dramatic steaks).


Essentially the barks are encounter oriented; and based on what an agent could say in a variety of likely situations. They are also targeted at human depicting AI agents, humans have a lot of different things to say while animals or aliens would not. However these other AI agents may not be expected to behave intelligently as more ‘human-like’ AI Agents.


Numbers

Agents in different games have different numbers of audio barks, FEAR (2005 - fps) has around 300-400 barks for their AI agents. Deus Ex (2000 - fps/rpg/is), Bioshock Infinite (2013 - fps/rpg),  Splintercell: Blacklist (2013 - stealth action) has about 75-100 per agent, although it’s a little hard to determine due to the extraction method used. Neverwinter Nights has a little less than 50 barks (2002 - crpg) on its more advanced agents but leverages UI and other systems to communicate states. Doom 3 (2004 - fps) is on the extreme low end with ~30 or less audio barks for many of its AI agents.


An interesting point a reference is that there are ~35 hand signals for dismount operations in Training Circular (TC) 3-21.60, which is military manual on the proper hand signals to be used in wartime scenarios by the United States Armed forces. As this is information deemed critical enough to be communicated through hand signals, I think it’s worthy of study for anyone looking for a communication model. It should be noted that this TC was not available during the release of FEAR.


Differences in FEAR

FEAR distinguishes itself from the audio barks most obviously by number of barks it has, however the specificity of certain audio barks is also important. Most games use general terms in audio barks to denote location, but FEAR has a long list of very situational places terms. They also respond to possible player tactics and weapon with very specific terms. When the AI agents search for the player, they again have very specific location terms they can use. In addition to these specifics FEAR calls out player and agent tactics as most other games do. There seem to be general fall back audio barks for the specific instances as well, which are similar to what is seen in most games. However one difference is that the AI agents in FEAR also have some interaction options that other games don’t always give their agents.


It's important to note that one of the criticisms of FEAR was that its environments were very similar. It almost entirely took place in office blocks and warehouses. This meant that a lot of audio cues could be reused and certain locations like labs and offices were very common. Also, since the soldiers are ‘clones’ they can all sound the same with no variation in their voices. As far as enemy types involved in FEAR, there are only Replica Troopers (the AI agent analysed), Heavy Armor, Powered Armor, Assassins, Turrets, UAVs, Assassins, and Spectres appear in the game. This seems to be a little sparser than some games, but not by much.


But the counter point is that other games (and even FEAR itself) have enough space for voice lines with multiple characters using a large amount of audio barks. Bioshock:Infinite has 10 possible voice sets for some variations of it’s basic AI agents. So while 3-400 audio lines may seem excessive, it is likely no different as a size consideration as long as there are lines to say.


Voices of Fear Spreadsheet

I have collected and transcribed every general voice file used by the basic AI Agent in F.E.A.R. for analysis. I also made up some categories roughly based on how common I felt these audio barks would be played. The rough categories are (in order of possible frequency) interjection, multi, command, situational, specific item, armor*, turret* and hurt/death. Interjections are generally an audio bark of the AI Agent swearing. Multi are audio barks that likely fit a wide variety of situations, or those situations are going to be common. Commands are likely to be said the the AI agent and can be said at almost any time with little context. Situational audio barks are generally a response to a possible situation. Specific item is an audio bark that calls out something specific, generally a detail that keeps the audio bark from being used in many different scenarios.  Armor and turret audio barks didn’t seem to fit well into the model and are related specifically to the Powered Armor and Turret enemy types (They could be categorized as Specific Items). Hurt/death are noises the AI agent makes when they die. Asterisks (*) generally denote me being unable to transcribe what is being said.



Individual notes (appendix)

I don’t have time to break down of every title I looked at but I do want to make some comments about some particularly interesting facts that I found about the content of the audio barks. I think there are a lot of interesting things to take away.



  • Almost every game has some sort of vocalization to communicate the awareness that the AI agent has of the player. There is almost always an unaware and an aware state and audio barks that play during the transition between those.
  • Every game has particular callouts around mechanics, especially if those are specific states the the ai agent, the player, or objects. A notable example of this in Dishonored, where AI Agents patrolling a ‘wall of light’ will notice and mention if someone tampered with it. They may even notice if a player steals or otherwise moves their weapons.
  • Not many games do this but there is an audio bark for protecting ‘your commander’ in Dishonored. Some AI Agents organize into squads or have commanders or similar units. This is especially true if destroying these units can cause the squad to panic.
  • The AI Agents of Half-life 2 are known for being hard to understand, with heavily ‘radio filtered’ voices and coded terms. This is often cited as a reason the AI is lackluster.
  • All AI agents say something before they throw a grenade, but in Splinter Cell: Blacklist they tend to also say why type of grenade they will throw.
  • Splintercell: Blacklist has lots of non-specific dialog for its AI agents, however it does make some exceptions for the player being in vents or for the player being above the AI agents.
  • Bioshock infinite’s AI Agents and Audio barks seemed to follow the following states as per their files (* denotes optional). The method of extraction has made it difficult to get named audio files from most games.


airborne
charge
charge close
combat enter
damage
death
effort grunt
emotion scream
emotion surprise
flush
*gammareact close
*idle
move to cover
reload
searching enter
severe pain
suppress
suspicion enter
target no LOS
taunt
*creepy taunt

For Additional Researching



An indepth look at the AI of the original Half-life (from a source code perspective).


A comparison of Half-life FEAR and Half-life 2 AI


An analysis of Spec Ops: the Line's AI

Monday, September 24, 2018

The Three 'E's of Encounters

Encounters

Ok, before you correct me, I know that you spell the word ‘Encounter’ with only two Es but that's not the point. When designing an encounter there are three angles you should consider to get the most out of the encounter, the Enemies, the Environment, and the Events. Thinking about these things is a great way to flesh out encounters beyond something as simple as ‘2d6 wolves’ which tends to end up a pretty stale encounter, especially the second time around.


Varying the types of enemies always creates a more interesting encounter

Enemy

When it comes to enemies the most interesting encounters often use multiple enemies together. It's important to consider what types enemies the players is in conflict with. That same wolf encounter becomes a lot more interesting if a Dire-wolf is thrown into the mix (or even better, Werewolf or Bargeist). A mix of tanking, supporting, ranged, and melee and whatever other roles are created for combat can really create interesting moments for players and show what is interesting about those enemies.

It's also important to consider the goal of these enemies. Are they mindless monsters that fight to the death? Are they worried about self preservation and are they gonna flee if they leader dies or the fight turns against them? Also how do these Enemies prioritize their actions? Do they try to kill all intruders or do they defensive and do they draw back when they are losing to try to hold out as long as they can? Enemies don’t stand around and wait, they guard, they sleep, they invade, they travel. A bunch of wolves and a Dire-wolf is probably hunting, and they will probably flee if their leader or enough wolves die. Injured wolves will probably try to stay out of the fight.

Where enemies are placed also is important to a good encounter. Are the enemies in a good position to show off their talents or are they in an area where their spears and bows are useless? The placement of enemies can also create opportunities for players to use their abilities to gain the upper hand or make it more difficult for them to sneak up and surprise. Our wolves probably don’t want to all be seen at once and probably will try to encircle whatever ‘prey’ they find so it can't get away. This of course leads us to consider the...

Not shown; the several hours hike to get here.

Environment

The environment where the encounter takes place is can turn a simple encounter to an entrancing one. Fighting a tough dude is just a tough fight but fighting a tough dude at the Preikestolen in Norway is a totally epic fight. Static environmental pieces help limit movement and create areas of advantage for players and enemies to try to control. Cover can limit the effectiveness of ranged weapons and create safer areas, difficult terrain can slow players and enemies leaving them vulnerable. The advantages and disadvantages of individual positions can keep players moving and tactics changing. Environments also can include interactable elements. They can be simple traps, to spillable liquids, to starting fires. Each of these represent choices the player or enemy can make to influence the environment. Other advantages in the environment can be weapons and items that players can, even doors that players can open, close, lock or barricade. Our 2d6 wolves and Dire-wolf encounter changes a lot when the wolves can travel and attack through a thorny hedgerow the players can't follow through, and a cart of rotten barrels the players can tip over for cover and concealment against the seemingly endless wolves come out of the woods.


Lightning strikes are maybe a little too cliche of a random event


Events

During an encounter, events can occur to to change the conditions of the fight. Maybe when the fight starts it begins to rain, the ground becoming muddier and harder to move through as players and enemies fight. Maybe lighting flashes and illuminates the darkness giving a brief indication of what hides in the darkness. Maybe the cave is collapsing, or it's not a cave at all. These events generally occur outside the fight and are outside of anyone’s control, events are things that just happen.

What events really can do is add another dynamic to a fight to break stalemates and add an unexpected element to strategies. Once a player thinks they have it figured out, the event can show them a twist. It can also help to change a fight that is slow battle of attrition, to one where the player has a chance or realizes they are in over their head. A lot of games have waves of enemies that help an encounter, especially with a boss, change from predictable slow win, to being ‘reset’ to something more interesting. Our dire wolf encounter might start as a storm brews and rain falls. Wolves might keep pouring out of the thorny hedgerow like like the endless rain until we manage to kill the Dire-wolf, the ground becoming a torn up, impassible mass of mud as we churn through it in combat.

Our Dire-wolf encounter is looking pretty snazzy, but is too snazzy?

Words of Warning

So we got a pretty awesome Dire-wolf encounter figured out. It's got a Dire-wolf leading some wolves and their coming at you from all along a hedge. There is a wagon to tip over to make a wall for you to put your back to. It starts to rain so the ground gets muddy as we fight making it hard to move as more and more wolves come out… it's pretty badass!

This is a great encounter, but did we go too far? Is this supposed to be the climax of an adventure or… are we just some bros traveling roads? The purpose of the Dire-wolf encounter was really to show how this model takes a simple, boring concept of 2d6 wolves and changes it into something spectacular. But if the purpose of this encounter is to makes a random encounter to spice up a trek, 2d6 wolves and a Dire-wolf would be enough. Maybe the hedgerow of endless wolves is a great way to show how dangerous the road is.  You can just take parts of the formula, you don't have to fully use and fully rely on it, as a matter of fact, it might be a little overwhelming for a player to constantly deal with all this epic-ness. You could go really overboard and have like 5 different enemies and tons of intractable and then a storm starts but then undead rise from the grave and there is an earthquake as you fight on the side of a volcano and also there are bees… My point is that there can be too much. Don't over do it (or maybe just overdo it once).

While this is a formula, you shouldn't over rely on it. Understand that choosing to just have one type of enemy is fine, but its still a choice. If the goal of your encounter is to introduce that enemy then by all means, just use one enemy. You can use a simple or boring environment if there are other things you want to show off. Not having an event can be just as tense as having one. Doing nothing with the Enemies, Environment, or Events in an encounter is still using them, it's just choosing them to be nothing. And that choice can be made to highlight or help reinforce the purpose of why the encounter was made in the first place.

Encounters can be conversations too!


Beyond Conflict as Combat


Often games show conflict as combat. But you can still use these same principals with other systems that model conflicts. Enemies might be individual npcs that must be debated or convinced, the Environment might be the setting and social situation the characters are in and Events might be things that happen during the conversation. There can be a lot more to this than just action movie fights. But action movies are cool so it's a great way to frame things right now.

*Wolves get a lot of bad publicity, and undeserving so. The origin of the 2d6 wolves encounter comes from a D&D module, the Curse of Strahd. It being a particularly boring random encounter, in an otherwise well regarded module. Wolves are actually an important part of our ecosystem and not a statistically significant threat to livestock. They also can not spontaneously generate from thorny hedgerows. In case, you know, you mistook this article as being scientifically accurate or something.