Guide
Game environmental hazard systems explained
Harbor Ruins' volcanic wing shipped with a single damage volume tagged “lava.” Standing in molten rock ticked 40 fire damage per second. Stepping on a geyser vent during a boss pull applied the same tag at 9,999 damage instant. Players died between frames and filed reports blaming desync. The real bug was taxonomy: one hazard type doing two incompatible jobs. Slow area denial and instant execution need different pipelines, telegraphs, and death messages. Until the refactor separated them, every vent death looked like a netcode failure even though the server log showed clean hits.
An environmental hazard system applies damage, debuffs, or forced movement from the level itself — lava, poison gas, radiation, electricity, crushing walls, fall distance, drowning, and scripted kill planes. Unlike enemy attacks, hazards often lack a visible attacker, so fairness depends entirely on readability and consistent rules. This guide covers hazard taxonomy, tick and burst pipelines, resistance and immunity gates, telegraph standards, fall and crush math, multiplayer authority, the Harbor Ruins volcanic refactor, a technique decision table, pitfalls, and a production checklist. Pair with health and damage, elemental damage, and status effects for the full damage stack.
Hazard taxonomy
Teams often lump every world hurtbox into “environmental damage.” Separating categories early keeps tuning, VFX, and player education honest:
| Category | Behavior | Examples |
|---|---|---|
| DoT zone | Damage per tick while inside volume; stack refresh optional | Lava pool, poison cloud, acid rain |
| Burst hazard | Single application on enter or trigger | Geyser erupt, spike trap, landmine |
| Instant kill | Executes regardless of HP (with exceptions) | Void pit, crusher at full speed, out-of-bounds |
| Movement hazard | Force, slip, or block without direct HP loss | Ice patch, conveyor, wind gust |
| Debuff-only zone | Applies status; damage optional or delayed | Radiation slow, curse altar, low-oxygen cave |
| Fall / crush | Computed from physics state on landing or squeeze | Cliff drop, elevator crush, ragdoll slam |
Each category gets its own HazardProfile asset: damage type, tick
rate, telegraph duration, kill-feed string, and whether
mitigation
applies. Mixing burst and DoT under one profile is the fastest path to
“unfair death” reviews.
Damage application pipeline
Environmental damage should flow through the same combat pipeline as enemy hits so resistances, shields, and logging stay consistent:
- Overlap detect — trigger volume, physics query, or navmesh region; server authoritative in multiplayer.
- Eligibility — ignore dead, downed, or invulnerable targets unless hazard spec says otherwise.
- Telegraph complete — burst hazards wait for windup; DoT zones may apply grace period on first enter (0.5–1s).
- Compute raw damage — flat per tick, percent max HP, or distance-scaled fall formula.
- Apply mitigation — armor, resist, hazard-specific immunity item (heat suit, gas mask).
- Apply debuff — poison stack, burn, slow; link to status system tags.
- Emit kill credit — death screen names hazard (“Volcanic vent”), not “Environment” or blank.
Log every application with hazard_id, tick index, and mitigated amount.
QA reproduces “I had full HP” disputes from one grep.
Tick scheduling
DoT zones share a global hazard tick (typically 0.5s or 1.0s aligned with
DoT systems).
Per-player next_tick_at prevents double ticks when crossing volume
boundaries rapidly. On exit, decide whether debuffs persist (poison lingers) or
clear immediately (lava heat drops).
Telegraphing and readability
Hazards without a face need stronger telegraphs than enemy windups:
- Visual — color language (orange heat, green poison), particle density ramp before burst, cracked floor before collapse.
- Audio — distinct loop for active zone; crescendo 1–2s before geyser; silence in radiation often reads as safe incorrectly.
- UI — edge-of-screen tint, hazard icon with stack count, optional DPS estimate in accessibility mode.
- Duration — instant-kill volumes require ≥300ms readable warning unless behind a one-time tutorial gate.
- Safe path — at least one obvious route; hiding the only safe tile behind pixel-perfect jump reads as trap design, not challenge.
Re-use telegraph components from attack telegraphing so players learn one visual language across enemies and world.
Fall damage and crush math
Fall damage is the most common environmental complaint because players do not see the formula. Publish it internally; surface a debug readout in playtest builds:
fall_damage = max(0, (impact_speed - safe_threshold) * scale_factor)
// Example: safe below 12 m/s, then 8 HP per m/s above
Design knobs:
- Safe drop height — rolling or slide can raise threshold; armor perks extend it.
- Cap — 50–80% max HP typical; full lethal falls reserved for intentional pits with signage.
- Downed interaction — lethal fall while downed may insta-bleedout; document in co-op modes.
- Crush volumes — use discrete states (warning, closing, closed) with damage only in closed; never crush during loading.
Link lethal falls to death penalties the same way enemy kills do. A pit that deletes progress without a clear skull marker trains players to blame the game, not their routing.
Resistance, immunity, and progression gates
| Gate type | Player affordance | Risk if misused |
|---|---|---|
| Stat resist | Fire resist reduces lava tick; capped at 75–90% | Trivializes entire biome without encounter redesign |
| Equipment slot | Heat suit, rebreather, insulated boots | Inventory check every zone entry feels tedious |
| Consumable buff | Antidote, flame ward potion, 60s duration | Running out mid-boss with no vendor |
| Ability / skill | Dodge i-frames through geyser window | Skill-only bypass excludes co-op roles |
| World state | Valve opened vents safe after puzzle | Sequence break if hazard not re-checked |
Drowning and oxygen tie to swimming systems as a specialized hazard track: breath meter, crush depth, and surface-only regen should share the same tick scheduler as poison DoT.
Multiplayer and authority
- Server-owned volumes — client VFX may lead; damage always confirms server overlap.
- Late join — sync active hazard states (vent phase, crusher position) on connect.
- Friendly fire off — hazards still damage all factions equally unless PvP zone rules say otherwise.
- Revive edge cases — rezzing inside lava must either eject to nearest safe nav point or apply grace i-frames.
- Loot on hazard death — corpse in lava should float to rim or use reclaim beacon; see death penalty docs.
Harbor Ruins volcanic refactor
Problem: one lava tag for DoT pools and instant geysers; no enter grace; death feed said “Unknown”; fire resist applied to geysers and trivialized pools unevenly.
Changes shipped:
- Split profiles:
LavaPool_DoT(35 fire / 1s) andGeyser_Burst(windup 1.2s, 120 damage, not insta-kill). - 0.75s grace on first pool enter; UI heat shimmer intensifies before tick starts.
- Geyser schedule: idle steam 3s, rumble 1.2s, erupt 0.4s active hitbox, cooldown 4s.
- Heat suit reduces pool damage 60%; geysers still punish standing on grate (25% reduction cap).
- Kill feed and death recap show hazard name + mitigated vs raw damage.
- Downed players in pool accelerate bleedout +5s per tick instead of double damage (links revive system).
- Debug command
hazard_overlay 1draws volume outlines in playtest builds.
Outcome: hazard-related unfair-death reports fell 44%; volcanic wing completion rose 19%; average time-in-pool during intentional kiting (luring adds) became measurable without mystery deaths.
Technique decision table
| Approach | Best when | Weak when |
|---|---|---|
| DoT zone denial | Routing puzzles, kiting arenas, biome identity | Precision platforming with tight timing |
| Telegraphed burst | Rhythm gauntlets, boss arena hazards | Open exploration without pattern learning |
| Instant kill plane | Clear out-of-bounds, crusher finales | Combat spaces where knockback is common |
| Fall damage curve | Vertical levels, risk-reward shortcuts | Games with floaty jump and unpredictable physics |
| Debuff-only hazard | Stealth zones, debuff-first combat | Players expecting immediate feedback |
| Enemy-only damage (no hazards) | Pure arena PvP, readable duels | Environmental fantasy biomes |
Common pitfalls
- Same tag, different lethality — split DoT, burst, and kill profiles.
- No grace on enter — one frame at volume edge applies full tick; players feel cheated.
- Hazard damage bypasses mitigation — unless designed (true void), run through resist pipeline.
- Knockback into kill plane — enemy slam near pit needs kill credit clarity or reduced pit lethality.
- Inactive VFX still damages — sync hitbox to visible effect phase.
- Crush during dialogue — pause crushers or disable damage while UI modal open.
- Poison stack from aura + cloud — one source ID or shared DR track.
- Generic death message — “You died” without hazard name blocks learning.
Production checklist
- Define hazard taxonomy and
HazardProfileassets per category. - Route all hazard damage through shared combat/mitigation pipeline.
- Global hazard tick scheduler with per-entity
next_tick_at. - Enter grace period and exit debuff persistence rules documented.
- Telegraph kit shared with enemy attacks (windup, audio, UI tint).
- Fall damage formula with cap, safe threshold, and perk modifiers.
- Crusher FSM: warning, active, safe; damage only in active.
- Resistance and equipment gates with explicit caps per hazard type.
- Kill feed and death recap show hazard_id and mitigated damage.
- Server authority for volumes; state sync on late join.
- Rez-in-hazard policy: eject, grace i-frames, or accelerated bleedout.
- QA matrix: edge enter, knockback into pit, suit expiry mid-zone, co-op rez.
Key takeaways
- Taxonomy first — DoT pools and instant killers must not share one profile.
- Hazards need telegraphs as strong as enemy windups because there is no attacker to blame.
- Run world damage through the same mitigation and logging pipeline as combat hits.
- Fall and crush formulas should be tunable, capped, and visible in playtest tools.
- Death messages must name the hazard — generic environment deaths destroy trust.
Related reading
- Game health and damage systems explained — HP pools and damage types
- Game elemental damage systems explained — fire, poison, and resist layers
- Game damage-over-time systems explained — tick scheduling shared with hazard zones
- Game death penalty systems explained — consequences when hazards kill