SimHacker avatar

buff

Temporary effects system — curses are just shitty buffs

by SimHacker|Open Source

✨ Buff

"All effects are buffs. Some are just shitty."

Target: Characters Only

Buffs only apply to characters, never rooms directly.

If a room needs buffs (e.g., "haunted", "poisoned air"), create a "room spirit" character:

  • room/dark-cavecharacter/dark-cave-spirit
  • Buff the spirit, not the room
  • Keeps buff system simple: one target type, one closure signature

MOOLLM K-Lines

K-LineWhy Related
simulation/Buffs live in simulation state
time/Duration measured in simulation turns
needs/Buffs affect need decay
character/Buffs stored in character state
cat/Cats can grant charm buffs
dog/Dogs grant loyalty buffs
persona/Personas grant buffs
yaml-jazz/Semantic buffs (LLM interprets)
examples/adventure-4/Grue-repellent in action

Full Spec: SKILL.md

Overview

Temporary effects system. Buffs modify stats, abilities, or behavior. Curses are just negative buffs — no separate system needed.

Quick Example

buff:
  name: "Caffeinated"
  source: "Espresso"
  effect: { energy: +2, focus: +1 }
  duration: 5  # simulation turns

Key Concepts

ConceptDescription
Numeric{ energy: +2 }
Semantic"feeling lucky" (LLM interprets)
MixedBoth stat mods and vibes
DurationTurns, natural language, or conditional
StackingSame source refreshes, different sources add
SynergiesSome buffs combine into stronger effects

Lifecycle Hooks

Buffs have three lifecycle hooks, written as natural language prompts and compiled to JS:

HookCompiles ToWhen It Runs
startstart_jsBuff activates on character
simulatesimulate_jsEach simulation tick
is_finishedis_finished_jsReturns true → buff ends
buff:
  name: "Poison"
  start: "Character turns green, loses 1 HP immediately"
  simulate: "Lose 1 HP per tick, emit groaning sound"
  is_finished: "Character HP below 10 OR 5 ticks have passed"
  tags: [curse, damage-over-time]

Closure signature: (world, subject, verb, object) => { ... }

  • subject = the character with the buff
  • Body-only in YAML, engine wraps with signature

Standard Character Properties

Buffs modify these standard character stats:

Sims-Style Needs

PropertyRangeDecayDescription
hunger0-100-1/hrNeed to eat
energy0-100-2/hrTiredness, need for sleep
social0-100-1/hrNeed for interaction
hygiene0-100-0.5/hrCleanliness
bladder0-100variesBathroom urgency
fun0-100-1/hrEntertainment need
comfort0-100contextPhysical comfort

Mind-Mirror Stats (Cognitive/Emotional)

PropertyRangeDescription
focus0-100Concentration, attention span
mood-100 to +100Emotional state (negative=sad, positive=happy)
stress0-100Anxiety level
creativity0-100Creative thinking capacity
confidence0-100Self-assurance
patience0-100Tolerance for delays/frustration
curiosity0-100Drive to explore/learn

Combat/Adventure Stats

PropertyRangeDescription
hp0-maxHealth points
damagenumericAttack power
armornumericDamage reduction
speednumericMovement/action rate
luck-100 to +100Chance modifier

Room Spirit Properties

When a room has a "spirit" character, buff its stats to affect the room:

Spirit PropertyAffectsExample
production_speedWork rate in roomFactory spirit +20% = faster crafting
error_rateMistake probabilityHaunted spirit +30% = more accidents
comfort_bonusComfort granted to visitorsCozy spirit +15 comfort
mood_influenceMood effect on occupantsCreepy spirit -10 mood
discovery_chanceFinding hidden thingsMysterious spirit +25% secrets
danger_levelHazard intensityCursed spirit = traps more deadly
# Example: Haunted Library Spirit
character:
  id: library-spirit
  name: "Spirit of the Old Library"
  location: room/old-library
  
  # Base stats (affected by buffs)
  production_speed: 100    # Books found per search
  error_rate: 5            # % chance of disturbing something
  mood_influence: -5       # Slightly creepy
  discovery_chance: 20     # Good for finding secrets
  
  buffs:
    - id: poltergeist-activity
      effect: { error_rate: +15, mood_influence: -20 }
      simulate: "Occasionally knock books off shelves"

Sources

SourceExample
InteractionsPetting cat → joy
ConsumablesCoffee → energy
LocationsPub → comfort
ItemsLamp → grue immunity
PersonasTheme-specific buffs

Buff Library

Pre-made buffs ready to use! See buffs/INDEX.yml:

# Reference from any character
character:
  buffs:
    - ref: skills/buff/buffs/INDEX.yml#fire-resistance
    - ref: skills/buff/buffs/INDEX.yml#haste
    - ref: skills/buff/buffs/INDEX.yml#grue-repellent

Categories in library:

  • Elemental resistances (fire, cold, lightning)
  • Movement (haste, water-walking, slow-fall)
  • Perception (darkvision, true-sight, detect-magic)
  • Stealth (invisibility, silence)
  • Combat (berserker-rage, stoneskin)
  • Adventure-4 specific (grue-repellent!)

Tools Required

  • file_read — Read buff definitions
  • file_write — Update buff state

Relationship to Mount

LayerPurpose
BuffGame mechanics — stats, durations, stacking, chains
MountSkill overlays — personality modification, room zones

Buffs are for numeric/semantic effects (energy +2, "feeling lucky"). Mounts are for skill attachment (NO-AI-JOKING™ on Pee-wee).

They can work together: a mounted skill might grant buffs, or a buff might reference a skill.

See: mount/ for skill mounting, NO-AI Brand for mounting philosophy.


See SKILL.md for complete specification. See buffs/INDEX.yml for the buff library.