Fear Modeling

As part of Outer Colony’s multifaceted approach to human behavior modeling, various emotional states influence the actions and decision making processes of NPCs. One of the most important of these emotions is fear.

A video demo showcasing some advanced aspect of

Summary

  • Fear in OC is modeled as an anticipation of a negative event.
    • When an NPC experiences fear, it’s in response to some specific, negative negative event that’s foreseen. An example of such an event is the death of the NPC, which can be described as the NPC’s fear of death.
    • In order to experience fear, an NPC needs both to consider some event to be negative, and to anticipate the event’s occurrence with some non-trivial likelihood.
  • NPCs don’t just perceive the world around them, but also project likely future events to improve their decision making capacities. Projection in reasoning is an essential component of fear. Projection refers to an NPC’s capacity to assess its current situation and try to foresee events that might occur in the future.
    • For example, if an NPC is harvesting crops on a sunny, calm day, it projects a low likelihood that it’s about to die. If an NPC is in battle and its position is being overrun, it can understand this situation as meaning that it is likely to die.
  • Valuation of the negative event that’s projected is the second essential component of fear. The extent to which an NPC values whatever may be lost in the negative event influences how afraid the NPC can become and what the NPC will do in response to this fear.
    • For example, if an NPC is a selfish hedonist, it’s likely that this NPC will value its own life above all else. If an NPC has been raised in a culture of self-sacrifice, death may be less frightening than other concerns, like dishonor.
  • Fear influences behavior primarily through the goal selection process, changing the states that an NPC wants to achieve. If fear becomes extreme, it completely overwhelms all other concerns and becomes the sole driver of behavior.
  • The specific actions undertaken in response to fear depend on the type of negative event that’s anticipated. In response to fear, an NPC will choose whichever plan it deems best at preventing the negative outcome.
    • For example, if an NPC’s fear of death in battle becomes too great, it may choose to flee or surrender in order to avoid that negative outcome.

Fear Inducing States

At the foundation of Outer Colony’s fear model are the negative states that NPCs can perceive. These comrpise a discrete collection of states that NPCs can understand (and usually understand) as being undesirable. Fear inducing states include:

  • Death: Most NPCs don’t want to die, and dying is almost invariably viewed as frightening.
  • Capture and Imprisonment: Incarceration, especially at the hands of an enemy that’s perceived as brutal, is frightening.
  • Harm of Loved Ones: The thought of important members of an NPC’s social network being harmed can be frightening. Capture and incarceration of loved ones or the death of loved ones can inspire fear, and whether capture or death is perceived as worse depends on circumstances.
  • Dishonor: The thought of betraying an NPC’s core values can cause fear. Fiercely principled NPCs in a militaristic society, for example, can regard dishonor via surrender as far worse than death.

As NPCs perceive the world around them, they constantly evaluate their current situation to determine the likelihood of realizing these states in the future. This projection of the future is the impetus for fear.

Projecting Negative States

A key aspect of the AI in Outer Colony is its capacity not only to perceive its current situation, but to assess aspects of that situation in order to project states that may arise in the future. The easiest way to understand projection is by example, and a straightforward case of projection forms the basis for fear of death.

When an NPC is in combat, its environmental awareness processing kicks into overdrive. It is constantly perceiving and processing a huge set of variables to determine the best course of action. This perception includes the number of known, hostile contacts, the quality of their equipment, the accuracy of incoming fire, and other combat related information. The same assessment is made for friendly forces that the NPC is aware of. All of this information is combined and distilled to a single value, which tells the NPC “How screwed am I right now?”

Suppose that a combatant is manning an isolated defensive fire position with only his single fire team in the immediate area. Suddenly, his position starts to take very accurate suppressing fire from an enemy machine gunner, and he sees a dozen more enemies start moving alongside his position to outflank him. In the next moments, two of his fellow soldiers are cut to pieces as they attempt to return fire. Our combatant knows, from his perception of his situation and the events that he’s just witnessed, that he has virtually no chance for survival if he fights on. This projection of imminent death in his future drives the fear.

Fear Levels

FearData

Fear data can be viewed like other individual metrics.

How much fear does an NPC experience under a given set of circumstances? The level of fear exerts a variable influence on the NPC’s goal selection process, so being moderately afraid versus being insane with fear is an important distinction.

It’s also important to keep in mind that a specific experience of fear is very individual. Each NPC will experience fear differently, even if exposed to identical circumstances. There are a great many factors that affect the level of fear that an NPC feels, and just a few of these are described below:

  • Personality is important to the experience of fear.
    • For example, deeply neurotic NPCs tend to experience fear more sharply than emotionally stable ones.
  • Specific experiences and memories can aggravate or mitigate levels of fear.
    • For example, NPCs that have already experienced combat in the past are less prone to the effects of fear in battle than inexperienced ones.
  • An NPC’s personal values and culture can exert a large influence on how frightening a specific state is considered.
    • For example, NPCs in cultures with no nuclear families can’t fear the loss of a husband, wife, or child the same way that an NPC from a different culture can.
    • Fear of capture is governed largely by an NPC’s views on the notion of surrender as well as its views of the enemy. If an NPC comes from a society that values fighting to the death, surrender can be perceived as immensely shameful, and the associated dishonor can even be considered worse than death. If the NPC considers his enemy to be completely barbaric, then the fear of slavery or tortue in the enemy’s hands can also be considered worse than death.
  • Fundamental states, like sleep deprivation, can contribute to fear levels.
    • For example, if an NPC is desperately sleep deprived, its sense of fear will be hightened, and the NPC will be more prone to fear induced madness.

Like most aspects of OC’s AI, the fear system interacts with many other subsystems in a variety of synergistic and antagonistic ways, designed to organically produce interesting results.

Fear Inspired Actions

What can an NPC do when it experiences fear? Actually, the mechanism for generating behaviors in response to fear is exactly the same as it is for generating normal behaviors.

When fear becomes the dominant aspect of an NPC’s reasoning, it will select a goal that is intended to prevent the fear inducing state from being realized. NPCs know which actions actions will result in which states, and this knowledge is used to generate plans that will yield positive outcomes. If an NPC’s fear of death takes over its goal selection process, it’s going to select the best actions possible to avoid death. In battle, this usually involves fleeing or surrendering. The NPC will instantly consider its options, usually preferring to flee, if possible. Oftentimes, no safe path of escape is available, and in this case, since attempting to flee would also result in likely death, surrender is considered the more desirable course of action.

Sometimes, NPCs will undertake actions that seem “insane” or irrational in response to fear. Really, though, no course of action selected by an NPC in OC is ever irrational. The NPC applies the same algorithms and numeric processes  to decision making that it always does, and the weights it assigns to actions and outcomes are always equally rigorous.

It’s those weights, though, that can vary greatly with specific NPCs and circumstances.

For example, suppose that an NPC is one of the last surviving soldiers of his colony’s militia. Nearly all of his able bodied comrades are dead, and a violent, brutal, sadistic enemy force is about to descend on what’s left of his settlement. Suppose also that he has a family, and that he’s terrified at the thought of their fate. This NPC might seek out his family members and mercifully execute them as part of a murder-suicide before the enemy force captures them. Check out the demo video at the top of this article to see precisely this rare, but possible, scenario.

Why would any NPC ever do this? It seems insane. But really, it’s a value-driven decision that arises organically from the system, and there’s no way for me to prevent this without imposing artificial constraints. NPCs can believe, based on values and perceptions of other cultures, that capture at the hands of a particularly brutal enemy will result in a tremendously bad state, be it through violence, subjection to hard labor, or re-education and mutilation of values. NPCs know that death is an alternative to this state: that being dead is a way out, and that the state of death precludes these other states. NPCs can also care very deeply for their families and desire very strongly that they not be subjected to a fate worse than death.

Under these circumstances, murder-suicide can result. Is it insane? Most people, and most NPCs in cultures that are like western civilization on earth, would say “yes”. But it’s a value judgement, and these values are culture-specific. Under extreme circumstances, it’s a profoundly difficult, moral question in the real world. And in the same way that people in comparably impossible circumstances in real history have been forced to answer the question, so, too, do NPCs in OC have to answer the question: by assessing situations, weighing alternatives, and making value judgements to select the course of action that they think is right.

This is a part of what makes OC’s AI interesting. Certainly, it can’t come close to the depth and nuance of the real human experience, but it tries. It tries to model as many aspects of the real human experience as possible, and as imperfect as it may be, it can yield these sorts of interesting results in extreme circumstances. Results that can resonate with real people, and maybe inspire some introspection about our real values and real decision making processes.

And this is why, I think, Outer Colony’s AI represents a quantum leap beyond what’s implemented in many other games. It’s a system that organically gives rise to entities that can make complex, moral judgments, based on culture, personality, experiences, and other aspects of human nature.

And as another gear in that cognitive machine, OC’s model of fear is built to be as fun, interesting, and compelling as possible.

Posted in NPCs, Uncategorized