MUD on Urbit

Weather & Day/Night

design

Status: Design Date: 2026-04-04

A world-wide time cycle with four phases and a weather system. Night is mechanically dangerous for low-level characters. Weather changes daily and affects outdoor above-ground rooms.

Day/Night Cycle

Phases

PhaseDurationReal time
Dawn30 min:00 - :30
Day30 min:30 - 1:00
Dusk30 min1:00 - 1:30
Night30 min1:30 - 2:00

Full cycle: 2 hours. Phase advances on the regen tick. When the phase changes, the world broadcasts a system message to all players:

  • Dawn: “The sun rises. Shadows retreat.”
  • Day: “The sun reaches its peak.”
  • Dusk: “The sun sets. Darkness creeps in.”
  • Night: “Night falls. The world grows dangerous.”

World-Wide Night Modifiers

These apply to all outdoor rooms (not %indoors, not %underground sector) unless the room has sheltered=true:

PhaseEffect
DawnNo modifier
DayNo modifier
DuskMob damage +10%
NightAll outdoor rooms become %dark. Mob damage +20%. Mob XP reward +20%.

The %dark flag at night means players without a light source see “It is too dark to see.” instead of the room description. This is the primary danger for low-level characters who haven’t found a lantern yet.

Night-Only Mobs

Mob resets in the area JSON can be tagged "night-only": true. These mobs:

  • Spawn only during the Night phase
  • Despawn at Dawn (removed from mob-instances, combat ended)
  • Are typically higher level than daytime mobs in the same area
  • Give the +20% XP bonus on top of their base XP
{
  "type": "mob-load",
  "mob-id": 99,
  "room": 3,
  "night-only": true
}

Room Time Config

Rooms can override the default phase behavior with a time-config object:

{
  "id": 5,
  "name": "Library of Forbidden Tomes",
  "time-config": {
    "night": {
      "description-suffix": "Shadows writhe between the shelves. Something watches from the dark corners.",
      "flags-add": ["dark"],
      "mob-level-bonus": 3
    },
    "dawn": {
      "description-suffix": "Pale light seeps through cracked windows, illuminating dust motes."
    },
    "dusk": {
      "description-suffix": "The last light fades. The books seem to whisper."
    }
  }
}

Time Config Fields

FieldTypeDescription
description-suffixstringAppended to the room description during this phase
flags-addstring[]Room flags added during this phase (e.g., ["dark"])
flags-removestring[]Room flags removed during this phase
mob-level-bonusnumberAdded to mob levels in this room during this phase
mob-damage-bonusnumberPercentage added to mob damage (stacks with world modifier)

Weather

Weather Change

Weather changes once per full cycle, at the start of Dawn. A new weather type is rolled from the probability table. Weather persists for the entire 2-hour cycle.

On weather change, a system message broadcasts to all players:

  • “The skies clear.”
  • “Clouds gather overhead.”
  • “Rain begins to fall.”
  • “A thick fog rolls in.”
  • etc.

Weather Types

WeatherChanceEffects
Clear35%None
Overcast20%Flavor text only, no mechanical effect
Rain15%Fire damage -25%. Move cost +1.
Heavy Rain5%Fire damage -50%. Move cost +2. Outdoor rooms treated as %dark.
Fog10%Flee success chance -25%. Hidden exits cannot be discovered.
Wind10%Magic damage -15%.
Storm5%Fire damage -50%. Move cost +2. Lightning damage +25%. Players in exposed rooms take 1-3 damage per regen tick.

Where Weather Applies

Weather affects a room when ALL of these are true:

  • Room sector is NOT %underground
  • Room does NOT have the %indoors flag
  • Room does NOT have sheltered: true in its weather config

Room Weather Config

Rooms can customize weather behavior:

{
  "id": 7,
  "name": "Weeping Fountain",
  "weather-config": {
    "sheltered": true
  }
}
{
  "id": 10,
  "name": "Exposed Cliff Path",
  "weather-config": {
    "storm": {
      "description-suffix": "Lightning splits the sky. The path is treacherous.",
      "damage-bonus": 10
    },
    "rain": {
      "description-suffix": "Water cascades down the cliff face, making the stones slick."
    }
  }
}

Weather Config Fields

FieldTypeDescription
shelteredbooleanIf true, weather effects don’t apply mechanically to this room
{weather-type}.description-suffixstringAppended to room description during this weather
{weather-type}.damage-bonusnumberExtra damage percentage from weather (stacks with weather base)

State

World State (in state-0)

world-phase=?(%dawn %day %dusk %night)
world-weather=@tas                        :: %clear, %overcast, %rain, etc.
phase-started=@da                         :: when current phase began

New Type

+$  world-phase  ?(%dawn %day %dusk %night)
+$  weather-type  ?(%clear %overcast %rain %heavy-rain %fog %wind %storm)

Room Type Addition

time-config=(map world-phase phase-room-config)
weather-config=weather-room-config

+$  phase-room-config
  $:  description-suffix=@t
      flags-add=(list room-flag)
      flags-remove=(list room-flag)
      mob-level-bonus=@ud
      mob-damage-bonus=@ud
  ==

+$  weather-room-config
  $:  sheltered=?
      overrides=(map weather-type weather-room-override)
  ==

+$  weather-room-override
  $:  description-suffix=@t
      damage-bonus=@ud
  ==

Tick Integration

Phase Check (on regen tick)

Every regen tick:

  1. Check if 30 minutes have passed since phase-started
  2. If yes, advance phase: dawn → day → dusk → night → dawn
  3. On phase change:
    • Broadcast phase message to all players
    • If advancing to Dawn: roll new weather, broadcast weather message
    • If advancing to Dawn: despawn night-only mobs
    • If advancing to Night: spawn night-only mobs
  4. Update world-phase, phase-started, world-weather

Combat Modifier Application

When calculating mob damage in process-one-combat:

  1. Get base mob damage
  2. Apply world phase modifier (+10% dusk, +20% night) if room is exposed
  3. Apply room time-config mob-damage-bonus for current phase
  4. Apply weather damage modifier (e.g., fire -25% in rain)
  5. Apply room weather-config damage-bonus

When calculating player damage:

  1. Get base player damage
  2. Apply weather modifier to damage type (fire reduced in rain, magic reduced in wind, lightning boosted in storm)

Room Description Assembly

In do-look:

  1. Start with base room description
  2. If room has time-config for current phase with description-suffix, append it
  3. If room is weather-exposed and has weather-config override for current weather with description-suffix, append it
  4. If weather is active and room is exposed, prepend weather flavor text (e.g., “Rain falls steadily. “)

Room Flag Override

When checking room flags:

  1. Start with base flags from room definition
  2. If night and room is outdoor/exposed, add %dark
  3. If heavy-rain and room is exposed, add %dark
  4. Apply flags-add from room time-config for current phase
  5. Apply flags-remove from room time-config for current phase

This means the flag check is dynamic — a room’s effective flags depend on the current phase.

Commands

CommandDescription
timeShows current phase and weather: “It is Night. A storm rages outside.”

No other commands needed. Weather and time are passive systems — players observe and adapt.

Impact on Existing Systems

SystemChange
Room lookup / do-lookDynamic flags, description suffixes, weather flavor
Combat tickDamage modifiers from phase + weather
Mob spawningNight-only mob spawn/despawn
MovementMove cost modifier from weather
FleeFlee chance modifier from fog
Regen tickPhase advancement, weather roll, storm damage
Room flagsDynamic effective flags (additive from phase/weather)
ImportParse time-config, weather-config, night-only from JSON
Status APIInclude phase and weather for frontend display

Frontend

  • Show current phase and weather in the status bar or header
  • Phase icon (sun/moon) next to the world name
  • Weather description in room text (appended by backend)
  • No new UI components needed — the backend handles all text modification

Not Included

  • Per-area weather. Weather is world-wide. Different areas experiencing different weather simultaneously is a future extension.
  • Seasonal events. No calendar system. Could layer on top of the phase cycle later.
  • Player weather resistance. No gear that reduces weather effects. Could add as item properties later.
  • Weather affecting NPCs. NPCs are unaffected by weather. They’re indoors in spirit.