Environment & Hazards

Weather systems, atmospheric conditions, environmental hazard zones, and their effects on entity fatigue, temperature, and survival.

What this uses

src/sim/hazard.ts src/sim/weather.ts src/sim/thermoregulation.ts src/sim/biome.ts src/sim/nutrition.ts src/sim/disease.ts docs/validation-thermoregulation-core-stability.md docs/validation-hazard-fatigue-drain.md

Environmental effects are applied per-tick. Hazard zones have physical extent (radius_Sm) and intensity (intensity_Q). Effect rates scale linearly with proximity. Weather affects thermoregulation which feeds into fatigue and consciousness.

Weather conditions

static preview
Clear
+18°C
Overcast
+12°C
🌧
Heavy Rain
+8°C
🌫
Dense Fog
+5°C
Blizzard
−15°C
🔆
Extreme Heat
+42°C
🌀
Hurricane
+22°C
💧
Extreme Humidity
+35°C
Rarified Atmosphere
−5°C
thermalDelta_Q/s
−200
fatigueInc_Q/s
q(0.001)
sensorPenalty_Q
q(0.30)

Diffuse cloud cover. Slight temperature drop; minor sensor attenuation from reduced contrast.

To add a custom weather condition: define it in src/sim/weather.ts, write a test in test/sim/weather.test.ts, then open a pull request ↗ with the title feat: add [NAME] weather condition.

Hazard zones — built-in profiles

🔥CAMPFIREfire · 3 m · 1 h
fatigueInc_Q/s
q(0.020)
thermalDelta_Q
+1000 ≈ +5.4°C/s at full
surfaceDamageInc_Q/s
q(0.005)
diseaseExposureId
none

Campfire-sized heat source. At full intensity (centre), drains 2% fatigue per second, pushes surface temperature +5.4°C/s, and inflicts minor skin damage. Effects fall off linearly to zero at radius edge.

RADIATION_ZONEradiation · 50 m · permanent
fatigueInc_Q/s
none
radiationDose_Q/s
q(0.010)
thermalDelta_Q
none
diseaseExposureId
none

Permanent contaminated zone (e.g. reactor core, ancient curse site). Accumulates radiation dose at 1% Q/s at centre. Host applies cumulative dose effects (nausea, fatigue, long-term organ damage) separately. No thermal or immediate surface damage.

MUSTARD_GAStoxic_gas · 20 m · 30 min
fatigueInc_Q/s
q(0.010)
thermalDelta_Q
none
radiationDose_Q/s
none
diseaseExposureId
marsh_fever

Heavier-than-air toxic gas cloud. Drains fatigue at 1%/s at centre, falls off with distance. Critically: exposes entities to marsh_fever disease — entities inside the zone on each tick have a chance to contract it via deriveHazardEffect.diseaseExposureId. Duration 30 min then dispersed.

ACID_POOLacid · 2 m · 2 h
fatigueInc_Q/s
q(0.005)
surfaceDamageInc_Q/s
q(0.015)
thermalDelta_Q
none
diseaseExposureId
none

Small caustic pool (industrial spill, alchemist's lab, volcanic acid lake). Primarily causes surface damage (1.5%/s at full) — much higher than campfire. Also drains fatigue from chemical burn pain. Very small 2 m radius: step in and step out quickly or suffer permanent scarring.

🌨BLIZZARD_ZONEextreme_cold · 100 m · 6 h
fatigueInc_Q/s
q(0.008)
thermalDelta_Q
−2000 ≈ −10.8°C/s at full
surfaceDamageInc_Q/s
none
diseaseExposureId
none

Mountain blizzard or arctic exposure. Large 100 m radius represents the storm envelope. Rapidly drops body temperature: −10.8°C/s at centre pushes entities into hypothermia within seconds unless clothed. Fatigue drain models shivering and wind-chill exertion. 6-hour duration covers a full storm event.

Create / import custom hazards

Define a custom hazard zone and save it to localStorage, or export it as a TypeScript snippet to add to src/sim/hazard.ts via pull request.

To add a custom hazard to the codebase: download the .ts snippet, add it to src/sim/hazard.ts, write a test in test/sim/hazard.test.ts, then open a pull request ↗ with the title feat: add [NAME] hazard profile.

Try this

  1. Import built-in zones: import { CAMPFIRE, RADIATION_ZONE } from '@its-not-rocket-science/ananke/hazard'
  2. Each tick: call computeHazardExposure(dist_Sm, zone) for each entity/zone pair. Apply the returned Q to deriveHazardEffect.
  3. Use isInsideHazard(x_Sm, y_Sm, zone) for broad-phase filtering before computing exact effects.
  4. Step zone duration: stepHazardZone(zone, elapsedSeconds). Check isHazardExpired(zone) to remove finished zones.
  5. See docs/validation-hazard-fatigue-drain.md for calibration against real fire/cold exposure data.