Relationships
Elves form bonds with each other through proximity, shared activities, and aesthetic affinity. These relationships affect mood and satisfaction.
Overview
Every elf maintains a list of up to 20 relationships, each with a numeric strength value ranging from -100 to +100. As strength changes, relationships cross thresholds that reclassify them into one of three types: Acquaintance, Friend, or Rival.
Two elves standing near each other and working gain small increments of strength, and the gains add up until the relationship crosses a threshold. The social system runs every 50 ticks, evaluating proximity and adjusting strength for every pair of elves.
How It Works
Bond Types
Relationships are classified by their strength value:
| Type | Strength Range | Description |
|---|---|---|
| Acquaintance | -29 to +49 | Neutral. Default state for any new relationship. |
| Friend | +50 to +100 | Positive bond. Provides mood bonuses and satisfaction gains. |
| Rival | -100 to -30 | Negative bond. Causes mood penalties when nearby. |
New relationships always start as Acquaintance with strength 0.
Source: src/sim/components.rs, Relationships::adjust -- strength clamped to -100..100, Friend at 50+, Rival at -30 or below.
Formation Triggers
Relationships shift through proximity-based delta calculations that fire every 50 ticks in the social system:
Base delta (requires Manhattan distance <= 3 between the two elves):
| Condition | Base Delta |
|---|---|
| Both actively working (not Idle) | +1 |
| Both resting or eating, distance <= 2 | +2 |
| One or both idle | 0 (no change) |
Aesthetic affinity modifier (applied on top of base delta):
| 4D Aesthetic Distance | Modifier |
|---|---|
| < 0.3 (very similar) | +1 |
| 0.3 -- 0.7 (moderate) | 0 |
| 0.7 -- 0.9 (different) | -1 |
| > 0.9 (strongly opposed) | -2 |
Aesthetic distance is computed as Euclidean distance in 4D aesthetic space (structure, tradition, emotion, social axes, each 0.0--1.0). The maximum possible distance is 2.0.
Source: crates/er-sim/src/sim/systems/social.rs, social_system -- proximity check at Manhattan <= 3, aesthetic distance thresholds at 0.3/0.7/0.9.
Social Axis Scaling
After computing the combined delta, it is scaled by each elf's Social axis (from their Aesthetic Position):
| Social Axis Value | Multiplier | Personality |
|---|---|---|
| > 0.7 | x2 | Social elf -- bonds form and break faster |
| 0.3 -- 0.7 | x1 | Balanced |
| < 0.3 | x0.5 (halved) | Personal elf -- bonds form slowly |
This means a Social elf gains +2 per working-proximity tick instead of +1, while a Personal elf only gains +0 (rounded down from 0.5). The scaling applies to both positive and negative deltas.
Source: crates/er-sim/src/sim/systems/social.rs, apply_social_axis_scale -- threshold checks at 0.7 and 0.3.
Bond Origins
Partner relationships remember how they formed. Three origins are currently tracked (Apprenticeship, SharedCrisis, and RivalryToLove), and they shift the partnership dissolution threshold up or down by bounded amounts. Four additional variants (Workshop, Revel, Critique, Rescue) are reserved for future triggers and carry no effect yet.
Origin history is a per-partnership property: only Partner relationships carry entries, and the history is cleared when a partnership dissolves. Acquaintances, Friends, and Rivals do not carry origin markers.
See Partnership Origins for the full system: triggers, the strength_min invariant that enables RivalryToLove detection, dissolution-threshold math, and the OriginSavedPartnership event that reports the mechanic in the feed.
Source: src/sim/components.rs, BondOrigin enum and Relationship::origin_history.
Relationship Affixes
Each relationship carries two boolean flags:
-
Tested: Set to
truewhen a friendship (strength >= 50) dips below 50 and then recovers back above 50. Also set during departure recovery -- if an elf nearly leaves but stays, friends who helped keep them get the Tested flag. A "Tested" bond has survived a setback. -
Fragile: Starts as
truefor all new relationships. Indicates the bond has not yet been reinforced. Set totrueon relationships where an elf recovered from near-departure without any friend support.
Source: src/sim/components.rs, Relationship struct -- tested and fragile fields.
Values & Formulas
Strength Progression Example
Starting from 0, with both elves actively working within 3 tiles and having similar aesthetics (distance < 0.3):
- Base delta: +1 (both active)
- Aesthetic bonus: +1 (affinity)
- Total per 50-tick cycle: +2 per elf (before social scaling)
- Social elf (> 0.7): +4 per cycle
- Balanced elf: +2 per cycle
- Personal elf (< 0.3): +1 per cycle
At +2/cycle, a balanced elf pair reaches Friend status (+50) in approximately 25 cycles = 1,250 ticks (~12.5 days).
Decay
Every 500 ticks, any relationship where the two elves are not within Manhattan distance 3 of each other decays by -1 strength. Neglected friendships therefore fade slowly, and it takes 500+ ticks of separation for a friend (50+) to drop back to acquaintance.
Source: crates/er-sim/src/sim/systems/social.rs, social_system -- decay branch at tick.is_multiple_of(500).
Capacity and Pruning
Each elf can hold at most 20 relationships. When the list exceeds 20, it is sorted by absolute strength (strongest bonds first) and truncated. The weakest acquaintanceships are pruned to make room for stronger bonds.
Source: src/sim/components.rs, Relationships::prune -- MAX_RELATIONSHIPS = 20.
Rivalries
When a relationship's strength falls to -30 or below, it reclassifies to Rival, and a separate set of mechanics applies: arguments at close range, public critiques during revels, escalation past -60, and reconciliation back above -30. Those mechanics, including the RivalryArgument, PublicCritique, CompetitionEscalated, and RivalryReconciled events, are covered on the dedicated Rivalries page.
This page covers the strength model that produces the Rival classification; Rivalries covers what happens once an elf is in one.
Interactions
Mood Effects
The social mood system runs every 10 ticks and applies mood modifiers based on nearby relationships:
| Situation | Mood Modifier | Duration |
|---|---|---|
| Near a friend (distance <= 3) | +3 | 50 ticks |
| Near a rival (distance <= 3) | -2 | 50 ticks |
| Near beloved (partner within 3 tiles) | +5 | 50 ticks |
| Social elf (> 0.7) with any company nearby | +1 "Enjoying company" | 50 ticks |
| Personal elf (< 0.3) alone | +2 "Peaceful solitude" | 50 ticks |
| Personal elf (< 0.3) with 3+ nearby | -1 "Too many people" | 50 ticks |
Source: crates/er-sim/src/sim/systems/social.rs, social_mood_system -- distance checks at 3 (friends/rivals) and 5 (general nearby).
Company Need
The company need (0--100 scale) is influenced by the Social axis and proximity, running every 2 ticks:
| Elf Type | Condition | Effect |
|---|---|---|
| Social (> 0.7) | 2+ elves within distance 3 | +2 company/tick |
| Social (> 0.7) | Alone | -1 company/tick (lonely) |
| Personal (< 0.3) | Nobody within distance 5 | -2 company/tick (relieved) |
| Personal (< 0.3) | 3+ within distance 5 | +1 company/tick (overwhelmed) |
| Balanced | Any | Drifts toward 50 |
For Personal elves, "company" is inverted: low values are good (solitude achieved).
Source: crates/er-sim/src/sim/systems/needs.rs, company_system.
Satisfaction
Friend count is an input to the satisfaction formula:
Satisfaction = inspiration x 0.3 + morale x 0.2 + friends x 5.0 + aesthetic_fit x 20.0 + revel_score x 0.1 + prestige x 0.15 + spike
Each friend contributes +5.0 to satisfaction. An elf with 4 friends gets +20 satisfaction from relationships alone, which can decide whether the elf stays or departs.
Mentor Bonds
Apprenticeship is a separate component, not a normal relationship. While the bond is active it does not appear in the relationship list. At graduation, the master and student exchange a permanent +15 to +25 strength delta (scaled by bond strength), almost always pushing the pair into Friend territory.
The graduation also writes a permanent TrainedBy lineage marker on the student, visible in their detail panel.
If the master's tradition axis is > 0.6 and the student's final skill exceeds the master's, the master takes a -10 relationship penalty to the student instead of the +10 a more open master would receive -- a traditional master who is surpassed treats it as a slight.
Source: crates/er-sim/src/sim/systems/apprenticeship.rs, apprenticeship_graduation_system -- bonus tiers at lines 322-324, surpass branch at line 348.
Departure Cascade
When an elf departs, remaining elves receive mood effects based on their relationship:
| Relationship to Departed | Mood Effect | Duration |
|---|---|---|
| Friend | -10 | 300 ticks |
| Rival | +3 | 100 ticks |
| Acquaintance | -2 | 100 ticks |
Close friends (strength >= 60) also enter a Mourning state for 200 ticks, gaining an additional -5 "Grieving" mood modifier. Mourning elves are drawn toward composing tributes.
Source: crates/er-sim/src/sim/systems/satisfaction.rs, satisfaction_system -- departure cascade section.
Tips
-
Cluster housing near workshops to increase proximity time. Elves who rest and work near each other accumulate relationship strength fastest (+2 base for co-resting).
-
Watch the aesthetic positions of your elves. Pairs with similar aesthetics (distance < 0.3) gain bonds 50% faster. The Aesthetic Position panel shows each elf's 4D position.
-
Social elves bond fast. Their x2 multiplier means they bond (and feud) at double speed. Assign them roles that keep them near others.
-
Personal elves need space. They bond slowly (x0.5) and are stressed near crowds. Give them solitary tasks like distant gathering.
-
Friendships reduce departure risk. Each friend adds +5 satisfaction. An elf with 0 friends and low inspiration is at high risk of leaving. Check the Satisfaction page for threshold details.
-
Watch for rival buildup. Two aesthetically opposed elves working together can drift to rivalry (-30) in about 15 cycles (750 ticks). Separate them before the -2 mood penalty applies.
-
Pruning is automatic at 20 relationships. If an elf has many weak acquaintances, stronger bonds are preserved. You do not need to manage it.
-
Friendships can become romance. Two friends who share emotional experiences accumulate romantic warmth. Friendship is a prerequisite for the SlowBurn and AestheticResonance warmth sources. Strong friends are more likely to fall in love and more likely to suffer badly if the romance ends.
-
Partnerships are protected. The
adjust()method guards Partner relationships from being reclassified by the normal social system. Only romance progression creates Partners; only romance dissolution removes them. -
Master-student bonds create strong friendships. A successful apprenticeship ends with both elves taking +15..+25 relationship -- often the largest single relationship event in the game. Pair masters and students whose aesthetic distance is small to also benefit from the post-graduation drift toward each other.