Relationships

Elves form bonds with each other through proximity, shared activities, and aesthetic affinity. These relationships shape mood, satisfaction, and the social fabric of your settlement.

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.

Relationships form gradually. Two elves standing near each other and working gain small increments of strength. Over time, those small gains accumulate until a bond crystallizes. 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:

TypeStrength RangeDescription
Acquaintance-29 to +49Neutral. Default state for any new relationship.
Friend+50 to +100Positive bond. Provides mood bonuses and satisfaction gains.
Rival-100 to -30Negative 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):

ConditionBase Delta
Both actively working (not Idle)+1
Both resting or eating, distance <= 2+2
One or both idle0 (no change)

Aesthetic affinity modifier (applied on top of base delta):

4D Aesthetic DistanceModifier
< 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: src/sim/systems.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 ValueMultiplierPersonality
> 0.7x2Social elf -- bonds form and break faster
0.3 -- 0.7x1Balanced
< 0.3x0.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: src/sim/systems.rs, apply_social_axis_scale -- threshold checks at 0.7 and 0.3.

Bond Formation Origins

Relationships track how they originally formed, which affects affixes:

Formation OriginTrigger
WorkshopProximity while both are composing or building
RevelBond formed during a revel event
CritiqueBond formed through artistic disagreement
RescueBond formed when one elf helped another in need

Source: src/sim/components.rs, BondFormation enum.

Relationship Affixes

Each relationship carries two boolean flags:

  • Tested: Set to true when 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 is one that survived adversity.

  • Fragile: Starts as true for all new relationships. Indicates the bond has not yet been reinforced. Set to true on 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. This means neglected friendships slowly fade, though it takes 500+ ticks of separation for a friend (50+) to drop back to acquaintance.

Source: src/sim/systems.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. This means the weakest acquaintanceships are pruned to make room for stronger bonds.

Source: src/sim/components.rs, Relationships::prune -- MAX_RELATIONSHIPS = 20.

Interactions

Mood Effects

The social mood system runs every 10 ticks and applies mood modifiers based on nearby relationships:

SituationMood ModifierDuration
Near a friend (distance <= 3)+350 ticks
Near a rival (distance <= 3)-250 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: src/sim/systems.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 TypeConditionEffect
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)
BalancedAnyDrifts toward 50

For Personal elves, "company" is inverted -- low values are good (solitude achieved).

Source: src/sim/systems.rs, company_system.

Satisfaction

Friend count feeds directly into 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 be the difference between staying and departing.

Departure Cascade

When an elf departs, remaining elves receive mood effects based on their relationship:

Relationship to DepartedMood EffectDuration
Friend-10300 ticks
Rival+3100 ticks
Acquaintance-2100 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: src/sim/systems.rs, satisfaction_system -- departure cascade section.

Tips

  • Cluster housing near workshops to maximize 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 are relationship engines -- 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 get stressed near crowds. Give them solitary tasks like distant gathering.

  • Friendships prevent departure. Each friend adds +5 satisfaction. An elf with 0 friends and low inspiration is at serious risk. Check the Satisfaction page for threshold details.

  • Don't ignore 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 kicks in.

  • Pruning is automatic at 20 relationships. If an elf has many weak acquaintances, stronger bonds are preserved. You don't need to manage this.