Compositions
Overview
Compositions are the primary creative output of an elven settlement. When an elf with the Composer role (or any elf choosing to compose) finishes a composing task, the simulation generates a unique musical work with a procedurally generated name, title, description, quality scores, and special properties. Compositions are permanent artifacts stored in the settlement's portfolio and performed at Revels.
Every composition encodes the emotional and aesthetic state of its creator at the moment of creation. Two compositions by the same elf in different moods will sound completely different.
How It Works
Composing Duration
The time to compose is determined by music skill. Higher skill means faster work, but there is a floor of 30 ticks:
Duration = max(50 - skill x 2, 30) ticks
| Music Skill | Compose Time (ticks) |
|---|---|
| 1 | 48 |
| 5 | 40 |
| 8 | 34 |
| 10 | 30 |
Source: src/sim/art.rs, compose_duration
Genre Families
Every composition belongs to one of three genre families, selected based on the composer's Aesthetic Position and Inspiration.
| Genre | Description | Selection Bias |
|---|---|---|
| Traditional | Classical forms, familiar structures | High tradition axis |
| Radical | Avant-garde, experimental | Low tradition axis |
| Pastoral | Nature-inspired, ambient | High Nature inspiration (>40) |
Genre Selection Algorithm
Genre selection proceeds in two stages: a cross-genre surprise check, then a weighted probability roll with seasonal bias.
Stage 1 -- Cross-genre surprise (8%)
Before any probability calculation, the system rolls a uniform random check. If the roll is below 0.08 (8% chance), a genre is picked uniformly at random from all three families, ignoring the composer's aesthetic position, inspiration, and season entirely. This means roughly once per 20-day session, even a deeply traditional elf might compose something radical.
Source: src/sim/art.rs, select_genre_seasonal -- if surprise < 0.08 at line 97.
Stage 2 -- Weighted probability
If the surprise check does not fire (92% of the time), base probabilities are computed from the composer's state:
| Probability | Formula | Notes |
|---|---|---|
p_radical | max((1.0 - tradition - 0.5) x 1.5, 0.0) | Rises as tradition axis falls; ~0% at tradition 0.83+, ~15% at tradition 0.5, ~75% at tradition 0.0 |
p_nature | 0.6 if Nature is dominant source AND nature > 40; else 0.1 | Requires both conditions; dominant source alone is not enough |
p_traditional | max(1.0 - p_radical - p_nature, 0.0) | Remainder after radical and pastoral claims |
All three probabilities are then adjusted by seasonal bias:
| Season | Adjustment |
|---|---|
| Winter | p_nature += 0.2 (Pastoral +20%) |
| Summer | p_radical += 0.2 (Radical +20%) |
| Spring | p_traditional += 0.1 (Traditional +10%) |
| Autumn | No adjustment (most varied season) |
After bias is applied, the three values are summed to a total and a weighted
random roll selects the genre. The probabilities are not renormalized to 1.0
before rolling -- the roll range is [0, total), so seasonal bias effectively
increases the absolute weight of one family rather than redistributing from
others.
Example at tradition=0.5, no nature dominance, Summer:
| Family | Base | Seasonal | Effective share |
|---|---|---|---|
| Traditional | 0.15 | +0 | 0.15 / 1.45 = ~10% |
| Radical | 0.75 | +0.2 | 0.95 / 1.45 = ~66% |
| Pastoral | 0.10 | +0 | 0.10 / 1.45 = ~7% |
| Cross-genre surprise (pre-roll) | 8% (uniform) |
Source: src/sim/art.rs, select_genre (base logic, lines 55--85) and select_genre_seasonal (with season, lines 89--128)
Base Types (Skill Tiers)
Within each genre, the composer's music skill determines which tier of base type is available. There are 4 tiers per genre (12 total):
| Skill | Tier | Traditional | Radical | Pastoral |
|---|---|---|---|---|
| 0-3 | Apprentice | Lullaby, Hymn, Folk Song, Ditty, Canticle, Air | Chant Riff, Drum Circle, Voice Loop, Spoken Word | Birdsong, Creek Melody, Windchime, Leaf Rustle |
| 4-6 | Journeyman | Ballad, Rondo, Serenade, Nocturne, Madrigal, Minuet | Blues Lament, Groove, Free Verse, Syncopation | Storm Song, Forest Waltz, River Suite, Dawn Chorus |
| 7-9 | Master | Sonata, Concerto, Rhapsody, Aubade, Fantasia, Elegy | Jazz Standard, Rock Anthem, Beat Poem, Fusion | Thunder Concerto, Tide Rhapsody, Season Cycle |
| 10+ | Grandmaster | Requiem, Symphony, Magnum Opus, Oratorio | Noise Symphony, Rap Epic, Punk Requiem, Ambient Opus | World Song, Elements Symphony, Celestial Harmony, Earthsong, Aurora Opus |
Source: src/sim/art.rs, select_base_type
Values & Formulas
Quality Scores
Each composition has three quality dimensions scored 0-100:
| Dimension | Driver | Formula |
|---|---|---|
| Mastery | Music skill | skill x 10 + random(-5..+5), clamped 0-100 |
| Originality | Inspiration total | inspiration_total x 0.6 + random(0..20), clamped 0-100 |
| Emotional | Net mood | mood x 0.5 + 30 + random(0..10), clamped 0-100 |
Average quality = (mastery + originality + emotional) / 3
| Average Quality | Tier Label |
|---|---|
| 90-100 | Transcendent |
| 70-89 | Masterful |
| 50-69 | Skilled |
| 25-49 | Modest |
| 0-24 | Crude |
Elegy bonus: Compositions created while an elf is mourning a departed friend receive +15 to the emotional score.
Source: src/sim/art.rs, compute_quality; src/sim/components.rs, quality_avg, quality_tier
Composition Properties
Properties are special tags earned from creation conditions. Each composition carries up to 2 behavioral properties plus an always-present seasonal property and an optional Stormborn premiere marker.
Condition properties (checked in order):
| Property | Condition |
|---|---|
| Cathartic | Composer has an active creative block |
| Transcendent | Total inspiration > 90 |
| Debut | First composition ever (empty portfolio) |
| Magnum Opus | Skill 10 AND inspiration > 90 AND mood > 50 (once per lifetime) |
| Masterwork | Skill >= 10 (if Magnum Opus not triggered) |
| Elegy | Composed while mourning a departed friend |
Compound inspiration properties (require two channels both > 30):
| Property | Channels Required |
|---|---|
| Manifesto | Rivalry > 30 AND Social > 30 |
| Obsessive | Rivalry > 30 AND Solitude > 30 |
| Communal | Nature > 30 AND Social > 30 |
| Timeless | Nature > 30 AND Solitude > 30 |
| Virtuosic | Beauty > 30 AND Rivalry > 30 |
| Sublime | Beauty > 30 AND Solitude > 30 |
| Bittersweet | Social > 30 AND Solitude > 30 |
| Enchanted | Nature > 30 AND Beauty > 30 |
| Anthem | Social > 30 AND Beauty > 30 |
Source: crates/er-sim/src/sim/systems/compose.rs; crates/er-sim/src/sim/components.rs, CompositionProperty
Seasonal Properties
Every composition automatically receives one seasonal property based on the season it was completed in. This does not count toward the 2-property cap -- it's always first in the property list.
| Property | Season | Meaning |
|---|---|---|
| Vernal | Spring | Beginnings, renewal, hope |
| Solstitial | Summer | Ambition, peak energy, glory |
| Autumnal | Autumn | Reflection, bittersweet, impermanence |
| Hibernal | Winter | Depth, memory, stillness |
Seasonal properties interact with the resonance scoring system at performance time. A Vernal composition performed in Spring gets +5 audience goodwill; the same composition in Winter gets -1.
Stormborn is a special premiere-time property. When a composition is performed for the first time during Storm weather, it gains the Stormborn property. This is permanent, rare, and stacks with the seasonal property. A "Hibernal Stormborn" composition is a winter piece that debuted in a storm -- the kind of memorable event that defines a colony's cultural history.
Source: crates/er-sim/src/sim/components.rs, CompositionProperty::for_season; crates/er-sim/src/sim/systems/revel.rs, Stormborn attachment.
Lineage Property: InStyleOf
Compositions written by an active apprentice carry an additional InStyleOf({master_name}) property -- displayed as Style: {master_name}. Like seasonal and Stormborn, it is cap-exempt: it is appended after the 2-property truncation, so it never displaces a behavioral property.
The marker is informational only -- it does not affect quality scores, audience reactions, or revel resonance. It exists to record cultural lineage: which master shaped which works. The property is attached only while the apprenticeship bond is active. Compositions written after graduation do not carry it; the lineage instead lives in the student's permanent TrainedBy component.
Source: crates/er-sim/src/sim/systems/compose.rs, lines 189-192; crates/er-sim/src/sim/components.rs, CompositionProperty::InStyleOf.
Creative Block
Three or more consecutive compositions with average quality below 50 give a 30% chance of triggering a creative block. Duration is 100 to 200 ticks (random). During a block, the elf refuses to compose and seeks a Garden instead.
Source: crates/er-sim/src/sim/systems/compose.rs, ConsecutiveMediocre, creative block trigger logic
Name Generation
Composition names follow the structure "{Prefix} {Base Type} {Suffix}".
Prefix is selected from mood tier pools, with two override conditions checked first:
| Condition | Pool | Examples |
|---|---|---|
| Night AND mood < -10 | Haunted | Haunted, Spectral, Moonlit, Shadow-woven |
| Inspiration > 70 AND mood < 0 | Fierce | Fierce, Defiant, Tempestuous, Raw |
| Mood <= -41 | Devastated | Shattered, Grieving, Tormented |
| Mood -40 to -21 | Sad | Melancholic, Mournful, Desolate |
| Mood -20 to +10 | Reflective | Contemplative, Wistful, Pensive |
| Mood +11 to +40 | Content | Serene, Gentle, Tender |
| Mood +41 to +70 | Happy | Joyful, Radiant, Exuberant |
| Mood > +70 | Euphoric | Ecstatic, Triumphant, Blazing |
Suffix comes from the dominant inspiration source:
| Source | Example Suffixes |
|---|---|
| Nature | "of the Silver Wood", "of Falling Rain" |
| Social | "of Fellowship", "of the Long Table" |
| Rivalry | "of the Challenge", "of Defiance" |
| Beauty | "of the Master's Touch", "of Perfect Form" |
| Solitude | "of Midnight", "of the Lonely Peak" |
Title Generation
In addition to the composition name, each work gets a short and long title pair. The short title is drawn from a pool matching the dominant inspiration source (e.g., "Still Water", "The Argument"). The long title appends a mood modifier (e.g., "Still Water, in the Rain").
Source: src/sim/art.rs, generate_name, generate_title
Interactions
- Inspiration -- Originality score and compound properties depend on inspiration channels
- Aesthetic Position -- Determines genre family selection and composition aesthetic snapshot
- Revels -- Compositions are performed at revels where audience reactions are computed
- Needs & Mood -- Mood drives the emotional score and name prefix selection
- Skills -- Music skill determines mastery score, base type tier, and compose duration
- Artistic Direction -- Patron direction influences which elves the curator assigns as Composers
- Seasons & Weather -- Season at completion determines the seasonal property; Storm weather during premiere can trigger Stormborn
- Apprenticeship -- An apprentice's compositions carry the cap-exempt InStyleOf({master}) lineage marker
Tips
- A skill-10 elf with high inspiration and good mood can produce a Magnum Opus -- the rarest property in the game. Protect your best musicians from mood crashes.
- Creative blocks are not purely bad: composing during a block earns the Cathartic property, which is otherwise unobtainable.
- Seasonal genre bias means Winter is the best time for Pastoral works and Summer for Radical. Plan revel timing accordingly.
- The 8% cross-genre surprise means even a deeply traditional elf occasionally writes something radical. This is intentional and can spark interesting audience reactions.
- Compositions with the Elegy property are only possible when an elf is mourning -- these tend to have very high emotional scores due to the +15 bonus.