fog of war
What stands where the map shows nothing yet.
Builtneeds review2 changes builtSeen all the timeLast touched December 2, 2026: a change of its own was written or changed. Commit 1f6ad3fb8.
In the terminal
Unexplored squares are blank (a space), and so is solid rock the hero has never seen into; a lit room's out-of-sight floor stays remembered (dark_room).
Quotes from NetHack
Show out-of-sight areas of lit rooms (default on). Persistent.
Decisions
Unexplored space is mist, not rock.
Codex draws itThe hero's light burns the mist off, thinner with distance.
Codex draws itFull text
Fog of war is burned off by the hero's light: the mist thins continuously with distance from the hero (shader), instead of each square opening on arrival.
Backlog decisions: D-21In Codex
Seen from high up, walls, doors and mist shrink toward the floor so you can see into rooms.
Builtneeds reviewCamera or view
Details
Seen from high up (the map view, the director's wide shot; N-57), walls, doorway lintels, doors, bars and mist shrink toward the floor together by how high the camera is, to walls_from_above of their height, so rooms can be seen into; a falling door is cut too; the fog thins to haze_from_above and the ambient light rises to faint_light_everywhere_from_above. Flights of stairs keep their full height (the hero stands on their steps; N-64). N-2790: a lumpy cave wall cut lower is not squashed about its foot (which moved its bumps and left a ledge up to a tenth of a square along the edge it shares with a whole neighbor): it is drawn with a shell built to the cut's height from the same field of bumps, in lumpy_walls_cut_in_steps steps of its height (32; 0 squashes it as before), stretched the little rest of the way (`draw/walls.rs` `Lumpy`). Its top's rise is lowered by the same share, so a wall cut low keeps no ridge standing over the letters beyond it (batch 12: a `(` in gallery-hallucination's map view was cut in half).
- Id
codex.cutaway- Exact state
- Built, not reviewed
- Playtests
journey-game,gallery-forms- Settings
views.walls_from_above,light.haze_from_above,light.faint_light_everywhere_from_above,views.lumpy_walls_cut_in_steps- Code
crates/codex-client/src/draw/view/cutaway.rs,crates/codex-client/src/draw/things.rs,crates/nh-plays/src/shot/pose.rs,crates/codex-client/src/pov.rs
| N-57 | Done | A high diagonal overview camera |
Unexplored space near the known map is dark drifting mist that the hero's light burns away.
In progressCamera or view
Details
Fog of war (D-11): every unexplored square (and solid rock shown as blank stone) within fog_of_war.depth squares of a known open square is a block of dark drifting mist a little taller than the walls, its faces only toward open squares, textured with wispy alpha that drifts slowly; the hero's light burns it off continuously (a shader: gone within fog_of_war.cleared_around_you, thickening over fog_of_war.clearing_edge_softness beyond), instead of each square opening on arrival (D-21). The unknown is dark paper (N-284): behind everything (the clear color), what far things fade into (the haze) and the mist's own color are one warm ink, light.darkness_color (0.045, 0.037, 0.030), at L* about 3 so the HUD keeps its contrast. It is the unknown, so no light reaches it (N-275: the light over the known map and the ambient used to reach it through the standard lighting, and it drew as a slate slab with stepped edges round every room seen from above): its own near-black color, tinted warm by the torch only close to the hero (torch_tints_it, fading out over torch_tint_reach squares and lower down more than up), and it casts and takes no shadow. Walking a dark corridor the unknown ahead deepens into darkness with distance instead of standing as a lit face that jumps a square at every step (N-276). From the high views it keeps from_above of its thickness, so the rooms beside it show. No line runs along its edge (D-75). On the known side the light dies away before the unknown (N-276): every wall and floor is drawn in the stone material (stone.wesl), which reads a texture of the map, one texel a square (stone.rs squares: known, which includes rock shown beside a corridor since its walls are built from it; how the map shows it; and how many squares it is from the unknown, a breadth-first search counting diagonals), blends the distance between squares' centers and, over the last light_dies_over_squares before the edge on an S-curve (0.7: the outer part of the last squares, so every square the map shows keeps its light at its middle and a dark room's floor around the hero stays in sight, N-708), takes the lit stone light_dies_before_the_unknown of the way into the unknown's own color (all the way by default, so the known ground meets the dark with no seam), evenly in stops rather than in linear light, so the lantern-bright floor a square ahead dims as the eye expects instead of staying a bright patch with an edge (N-276, after the orchestrator's first-person look: the corridor ended in a dark doorway a square ahead). Only the map decides where: nothing is lit or implied beyond a square it shows. Each square's distance from the unknown, as the shader reads it, eases toward the map's over fog_of_war.comes_out_of_the_dark_seconds a square (N-708, Danny: "I see a wall in front of me and then it disappears or a floor tile is missing in first person"): ground the map has just shown rises out of the dark and the dusk ahead moves on with the hero, instead of the whole front jumping a square at every step and darkening the wall just shown; a new level sets it at once. A passing symbol the core draws for a moment (a shield's sparkle, a dig beam, a boomerang, sent as terrain) stands over the ground and is never taken for it (N-708): the stairs or doorway under it are there again after it. Walking the stairs, all mist is cleared so the walk stays visible. Unknown space further out is plain darkness. A square where the map shows a monster or an object over ground it has never shown (a monster seen down a dark corridor or sensed by telepathy, a warning, gold detected in the rock) has no mist of its own: its letter stands on black as the terminal draws it, in a well whose sides are the mist around it, so it reads from the high views too; nothing is drawn under it and it opens no mist around it (N-96). It settles onto the floor only once the ground at or beside it has been shown (X-632, D-127: Codex never draws floor the game has not shown), or when it lies among things that what the map shows closes in on every side, one of them beside shown ground (a shop full of wares, seen for the first time). It does not stop the camera unless camera_avoids_fog. Light that isn't the hero's burns it off too, where the map shows lit squares (S-10, D-129): beside every square the map shows as lit floor in sight (a lit room seen through its door from a dark corridor, floor a lamp lights), the mist thins, fully at the lit square and less with each step away, gone fog_of_war.lit_floor_clears_it squares out (0 now: the mist is the unknown's own dark over the unknown, so its thinning cannot be seen until N-2530 gives it a look; 1.5 is the designed reach); it eases in and out over about a third of a second as squares come into and leave sight, so nothing pops. The map never says whose light lit a square, so this is the light field's room term (draw/sources/mist.rs, a reader of nh_plays::sources): Codex's own lights (the torch, a play's light, lava's glow past its own square) clear nothing, and the hero's own ring is left to the hero's light, so a dark room opens no wider round the hero. At 0 the mist is as before.
- Id
codex.mist- Exact state
- In progress
- Playtests
gallery-dark-corridor,journey-game,gallery-sensed- Settings
fog_of_war.show,fog_of_war.depth,fog_of_war.thickness,fog_of_war.drift_speed,fog_of_war.cleared_around_you,fog_of_war.clearing_edge_softness,fog_of_war.torch_tints_it,fog_of_war.torch_tint_reach,fog_of_war.from_above,fog_of_war.light_dies_before_the_unknown,fog_of_war.light_dies_over_squares,fog_of_war.comes_out_of_the_dark_seconds,fog_of_war.lit_floor_clears_it,light.darkness_color,camera.camera_avoids_fog,dungeon.wall_height- Code
crates/nh-scene/src/build/terrain.rs,crates/nh-site/src/lib.rs,crates/codex-client/src/draw/mist.rs,crates/nh-plays/src/picture/view/materials.rs,crates/codex-client/src/draw/materials.rs,assets/shaders/mist.wesl,crates/nh-site/src/sight.rs,crates/codex-client/src/draw/stone.rs,assets/shaders/stone.wesl,crates/codex-client/src/draw/sources/mist.rs,crates/nh-knobs/src/fog_of_war/mist.rs,crates/nh-plays/src/underway/squares.rs
| V-5 | Built, not reviewed | Mist is burned off around the hero (D-21), thick further out. |
A square's mist sinks into the floor and vanishes when the map reveals it, and new mist rises.
BuiltTransition
Details
Off by default (fog_sinks_seconds = 0, since the hero's light clears mist instead): a square's mist sinks flat and vanishes over fog_sinks_seconds when the map reveals it, and mist that appears where the map was just revealed (not where a level was loaded) rises into place from the floor. While it rises or sinks it is cut low with the walls from high up, where they make way for the camera, and by each level's hand-over on the stairs walk (X-79).
- Id
codex.mist_fade- Exact state
- Built
- Playtests
gallery-dark-corridor- Settings
fog_of_war.sinks_away_seconds- Code
crates/nh-plays/src/fade.rs,crates/codex-client/src/draw/mist.rs,crates/codex-client/src/draw/things.rs,crates/codex-client/src/draw/world.rs
Accepted pictures and playtests
A change to how this looks is compared with these pictures before it is accepted.
gallery-dark-corridor, dark corridor. Accepted November 21, 2026. Renderer: NVIDIA GeForce GTX 1660 Super.gallery-dark-door, dark door. Accepted November 21, 2026. Renderer: NVIDIA GeForce GTX 1660 Super.gallery-sensed, sensed. Accepted November 21, 2026. Renderer: NVIDIA GeForce GTX 1660 Super.gallery-dark-room, dark room. Accepted November 21, 2026. Renderer: NVIDIA GeForce GTX 1660 Super.Playtests: journey-game, gallery-forms, gallery-dark-corridor, gallery-sensed
Planned and proposed
In progress For each square, the light that falls on it, summed from every source the game shows.
Left to do: The torch as a source is round 2, then room light by region, lamps and lit monsters.
















