Weather & Day/Night
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
| Phase | Duration | Real time |
|---|---|---|
| Dawn | 30 min | :00 - :30 |
| Day | 30 min | :30 - 1:00 |
| Dusk | 30 min | 1:00 - 1:30 |
| Night | 30 min | 1: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:
| Phase | Effect |
|---|---|
| Dawn | No modifier |
| Day | No modifier |
| Dusk | Mob damage +10% |
| Night | All 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
| Field | Type | Description |
|---|---|---|
description-suffix | string | Appended to the room description during this phase |
flags-add | string[] | Room flags added during this phase (e.g., ["dark"]) |
flags-remove | string[] | Room flags removed during this phase |
mob-level-bonus | number | Added to mob levels in this room during this phase |
mob-damage-bonus | number | Percentage 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
| Weather | Chance | Effects |
|---|---|---|
| Clear | 35% | None |
| Overcast | 20% | Flavor text only, no mechanical effect |
| Rain | 15% | Fire damage -25%. Move cost +1. |
| Heavy Rain | 5% | Fire damage -50%. Move cost +2. Outdoor rooms treated as %dark. |
| Fog | 10% | Flee success chance -25%. Hidden exits cannot be discovered. |
| Wind | 10% | Magic damage -15%. |
| Storm | 5% | 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
%indoorsflag - Room does NOT have
sheltered: truein 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
| Field | Type | Description |
|---|---|---|
sheltered | boolean | If true, weather effects don’t apply mechanically to this room |
{weather-type}.description-suffix | string | Appended to room description during this weather |
{weather-type}.damage-bonus | number | Extra 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:
- Check if 30 minutes have passed since
phase-started - If yes, advance phase: dawn → day → dusk → night → dawn
- 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
- Update
world-phase,phase-started,world-weather
Combat Modifier Application
When calculating mob damage in process-one-combat:
- Get base mob damage
- Apply world phase modifier (+10% dusk, +20% night) if room is exposed
- Apply room time-config
mob-damage-bonusfor current phase - Apply weather damage modifier (e.g., fire -25% in rain)
- Apply room weather-config
damage-bonus
When calculating player damage:
- Get base player damage
- Apply weather modifier to damage type (fire reduced in rain, magic reduced in wind, lightning boosted in storm)
Room Description Assembly
In do-look:
- Start with base room description
- If room has
time-configfor current phase withdescription-suffix, append it - If room is weather-exposed and has
weather-configoverride for current weather withdescription-suffix, append it - If weather is active and room is exposed, prepend weather flavor text (e.g., “Rain falls steadily. “)
Room Flag Override
When checking room flags:
- Start with base flags from room definition
- If night and room is outdoor/exposed, add
%dark - If heavy-rain and room is exposed, add
%dark - Apply
flags-addfrom room time-config for current phase - Apply
flags-removefrom room time-config for current phase
This means the flag check is dynamic — a room’s effective flags depend on the current phase.
Commands
| Command | Description |
|---|---|
time | Shows 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
| System | Change |
|---|---|
| Room lookup / do-look | Dynamic flags, description suffixes, weather flavor |
| Combat tick | Damage modifiers from phase + weather |
| Mob spawning | Night-only mob spawn/despawn |
| Movement | Move cost modifier from weather |
| Flee | Flee chance modifier from fog |
| Regen tick | Phase advancement, weather roll, storm damage |
| Room flags | Dynamic effective flags (additive from phase/weather) |
| Import | Parse time-config, weather-config, night-only from JSON |
| Status API | Include 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.