Emotional Drift and Friendship Decay Algorithms in Games

Simulating believable emotional drift and friendship decay in life simulation games requires mathematical models that mimic the natural erosion of social bonds over time. Without ongoing interaction, real-world relationships rarely drop instantly to zero; instead, they experience a nuanced regression toward emotional neutrality. Game developers achieve this realism by combining mathematical decay functions, memory models, and state machines that balance relationship volatility with long-term stability.

Exponential and Half-Life Decay Functions

The most common baseline algorithm for relationship erosion is exponential decay, often implemented via half-life formulas:

\[R(t) = R_{\text{neutral}} + (R_0 - R_{\text{neutral}}) \cdot e^{-\lambda t}\]

Where \(R_0\) is the initial relationship value, \(R_{\text{neutral}}\) is the default baseline (usually 0 or an acquaintance state), \(\lambda\) is the decay constant, and \(t\) is the elapsed time since the last interaction.

Unlike linear decay, which reduces relationship values at a constant rate and often feels mechanical or overly punishing, exponential decay drops quickly at first and gradually levels off as it approaches neutrality. This ensures that an neglected acquaintance fades quickly, while a long-term companion stays in a "dormant" friendly state for a significant amount of time before slipping into total estrangement.

The Leaky Integrator Model

For continuous emotional states—such as mood, stress, or temporary affection—developers frequently use a leaky integrator algorithm. Derived from computational neuroscience and digital signal processing, the leaky integrator treats emotional state \(x\) as an accumulator that constantly leaks over time toward an equilibrium point:

\[\frac{dx}{dt} = -\alpha (x - x_{\text{baseline}}) + I(t)\]

Here, \(I(t)\) represents external input (e.g., a compliment, a gift, or an argument), and \(\alpha\) determines the decay rate. The leaky integrator naturally handles emotional inertia: a single massive betrayal or praise will not permanently alter the relationship unless reinforced, allowing temporary anger or excitement to naturally dissipate back to baseline.

Ebbinghaus Memory-Weighted Decay

Believable relationships depend heavily on shared history. Applying Hermann Ebbinghaus’s Forgetting Curve to an episodic memory ledger allows agents to weigh decay against the emotional intensity of past events:

\[S = e^{-\frac{t}{M}}\]

In this model, relationship strength \(S\) degrades over time \(t\), but the denominator \(M\) (memory strength) scales based on the significance of past interactions. Minor events (like a casual greeting) have a small \(M\) and are forgotten quickly, causing minimal lasting impact. Major events (such as a shared quest, marriage, or deep betrayal) have a large \(M\), heavily anchoring the relationship and dramatically slowing the decay rate.

Dynamic Decay via Trait Multipliers and Utility Systems

Static decay rates break immersion because different personalities maintain friendships differently. Modern life simulators adjust decay parameters using personality frameworks like the Big Five (OCEAN):

  • High Extraversion: Slower decay when interacting with broad networks, but higher negative drift if neglected.
  • High Neuroticism: Faster decay into paranoia or resentment rather than pure neutrality.
  • High Agreeableness: Slower decay of positive affinity and higher forgiveness thresholds.

Developers map these traits as coefficients modifying the decay constant \(\lambda\). An introverted agent might have an exceptionally low \(\lambda\), allowing friendships to resume seamlessly even after months of in-game absence, while a high-maintenance agent exhibits rapid affinity decay without frequent validation.

Probabilistic State Transitions (Markov Chains)

While affinity values often exist on a continuous floating-point spectrum (e.g., -100 to +100), social roles operate discretely (e.g., Close Friend, Acquaintance, Estranged). Developers use continuous algorithms to drive continuous variables, which then dictate the transition probabilities of a Markov chain.

Instead of an agent immediately demoting a player from "Best Friend" to "Friend" the moment a numerical score crosses a strict boundary, hysteresis is applied alongside transition probabilities:

[ Close Friends ] 
       │ 
       ▼ (Score < 60 over N days; P(decay) increases daily)
[ Drifting Apart ] 
       │ 
       ▼ (No contact threshold met)
[ Casual Acquaintances ]

Hysteresis prevents rapid cycling between states when scores hover around thresholds, while probabilistic transitions introduce natural variability, ensuring that social deterioration feels organic rather than strictly transactional.