Sokoban

Four boulder puzzles, mapped from the start.

The terminal shows this in words, not as a letter.
Terminal
Sokoban in Codex, first person
Codex: first person

Builtneeds review1 change builtSeen on some levelsLast touched November 27, 2026: a change of its own was written or changed. Commit 4859035a8.

In the terminal

Each level is drawn whole the moment you arrive (premapped: walls, floor, boulders and the pits or holes all shown). Lit. Two maps per level. Boulders '0' (or the player's boulder symbol) must be pushed into the row of pits (lower two levels) or holes (upper two); pushing diagonally fails ("The boulder won't roll diagonally on this floor."), squeezing past boulders is limited, teleport is blocked; cheating costs Luck silently. Each level has a ring, a wand and food; the top has a treasure zoo and the prize on a burned Elbereth with a cursed scroll of scare monster. 3.7 gives Sokoban its own wall glyphs (gray by default, blue in IBMgraphics, bright blue in the tiles) and lets the maps be flipped.

Quotes from NetHack

Sokoban (Japanese for "warehouse keeper") is a transport puzzle in which the player pushes boxes around a maze, viewed from above, and tries to put them in designated locations.
dat/data.base: sokoban
2 more quotes
There is a special multi-level branch of the dungeon with pre-mapped levels based on the classic computer game "Sokoban."
doc/Guidebook.mn:2179, troff quotes rendered as plain quotes
In case you haven't played the game Sokoban, you'll learn quickly. This branch isn't particularly difficult, just time consuming. Some players may wish to skip this branch.
dat/soko4-1.lua:6, level-file comment

In Codex

Each branch in its tiles' stone, Mines cracked rock, Sokoban blue, Gehennom red brick, Ludios brown.

Builtneeds review3D form

Based on the real thing: The Mines are rough orange-brown rock, unworked, split along its bedding by dark cracks. Sokoban's walls are blue dressed blocks laid in level courses. Gehennom's are dark red brick, burnt and rough. Fort Ludios's are brown cut blocks, a fort's masonry.

Details

N-102, D-61 (the director, 2026-10-30: "Yes, for every player"). Each wall is drawn in the wall set the core drew it in (protocol 4's Glyph.walls), whatever its glyph's color and the player's symset; the floor, and the rock shown beside the map, door frames and stair flights, take the level's stone: the set most of the walls the map shows carry (nh_site::Site::wall_set, tested), the Dungeons' until a wall is shown. Colors and patterns come from the DevTeam's wall tiles (win/share/other.txt 199-242), toned to the caves' light (N-252, round two): the Mines orange-brown unworked rock in lumps half again as deep as the Dungeons', in a texture of their own (nh-scene texture.rs rock: bands falling from upper right to lower left, split by deep dark cracks, lit pale along each crest, one band warmer than the next, after tile 199), no ore; Sokoban blue ashlar, blocks half a square long and a third tall, laid level with no lumps, in a blue with little red so the torch leaves it blue (232-242: the Dungeons' bricks in blue); Gehennom dark red brick, two thirds of a square long and half tall, laid level, matte (210-220); Fort Ludios brown cut blocks laid level in the tile's brown, one block in two carrying a small ragged ochre-gold nugget, paler along its upper crest, dark at the rim where it is set, matte (221-231, texture.rs knox, N-2390). The cut blocks' joints are dark (darker than the brick under the torch, measured in the frame) and shallow and ease into the block, each block and each broad patch of wall a little lighter or darker than the next, and each block lit pale along its top edge as tiles 210 and 232 light theirs. The Dungeons stay as they were. Nothing glows. When the level's stone becomes known (its first walls shown) the level is built again in it. Off (branch_stone = false): the Dungeons' gray everywhere. By the torch Sokoban's walls keep their blue (N-244, dungeon.branch_stone_keeps_its_hue, 0.85): the warm torch passes little blue, so the walls came out gray up close while blue from above (first-person wall OKLab C 0.017 against 0.044 from the director's view). After the light, the stone shader holds a wall's OKLab fullness along its own hue (its color by the explored map's light less a gray stone's) to at least 0.85 of what it shows along it by that light, at the same lightness, keeping the torch's warmth across it; only for a hue across the wheel from the room's warm light (blue), only on walls, and by view as share times (1 - the camera's height), so the high views and the floor's pool of torchlight are as they were. Gray, brown, red, yellow and plum stone are unchanged (gallery-branches: Gehennom close third C 0.038 at 0 and at 1). 0: as the torch mixes it. Remembered walls keep their stone's color (N-2394, light.remembered_walls_keep_their_color, 1.5; D-62 names remembered floor gray, not walls): out of sight, remembered stone drains toward gray at its own lightness (light.remembered_color); a wall gets the drained color back (up to 1), and above 1, from the high views only, its color is pushed further from gray at its own lightness so it holds under the explored map's cool light (stone.wesl's drain lets a wall's share pass 1), while remembered floors still go gray as the terminal draws them (nh_plays materials::remembered_color, tested). Measured far walls from the director's view with it on against off: Gehennom (50, 29, 33) against (40, 32, 37), the Mines (57, 35, 32) against (47, 39, 41), Ludios (57, 40, 40) against (48, 43, 46). The lowered tops (walls cut down for the camera) keep their stone's own color: the remembered level's stain, drawn where rock hides known floor, steps back while walls are lowered, in the close views only, by the deepest cut, as the ceiling does (N-5342, light.remembered_steps_back_from_lowered_walls, 1; nh_plays materials::steps_back, tested).

Id
codex.branch_stone
Exact state
Built, not reviewed
Playtests
gallery-branches, gallery-ludios
Settings
dungeon.branch_stone, dungeon.branch_stone_keeps_its_hue, light.remembered_walls_keep_their_color, light.remembered_steps_back_from_lowered_walls
Code
crates/nh-site/src/lib.rs, crates/nh-scene/src/build/terrain.rs, crates/codex-client/src/surface.rs, crates/codex-client/src/draw/world.rs, crates/nh-scene/src/stone.rs, crates/nh-scene/src/stone/dungeons.rs, crates/nh-scene/src/stone/mines.rs, crates/nh-scene/src/stone/gehennom.rs, crates/nh-scene/src/stone/ludios.rs, crates/nh-scene/src/stone/sokoban.rs, assets/shaders/stone.wesl, crates/nh-plays/src/picture/view/materials.rs, crates/codex-client/src/draw/stone.rs, crates/nh-scene/src/texture.rs, crates/codex-client/src/draw/standard.rs
N-102DoneThe branches in their own stone
N-252Built, not reviewedThe branches' stone, round two

Accepted pictures and playtests

A change to how this looks is compared with these pictures before it is accepted.

  • Sokoban in Codex, first personfirst person
  • Sokoban in Codex, close third personclose third person
  • Sokoban in Codex, director's viewdirector's view
  • Sokoban in Codex, map viewmap view
Gallery scene gallery-branches, sokoban. Accepted November 21, 2026. Renderer: NVIDIA GeForce GTX 1660 Super.

Playtests: gallery-branches, gallery-ludios

Planned and proposed

In progress A condition or a place changes the squares, the light, the plays and the camera together.

Left to do: Blindness over the whole place judged with frames, the scene's spell lights, and a second condition or a place's own look.

Details for builders

Id: sokoban. Lexicon subjects: place.sokoban.

Design notes from NetHack

Each level is drawn whole on arrival: walls, floor, boulders, and the pits or holes.

A row of pits to fill with boulders; two scrolls of earth near the start.

Holes '^' in place of pits; an unfilled hole drops the hero to the level below.

A lit zoo of sleeping monsters on gold behind closed doors; entering it gives "Welcome to David's treasure zoo!"

Backlog rows

N-102DoneThe branches in their own stone
N-252Built, not reviewedThe branches' stone, round two
X-63Built, not reviewedChanges to the whole drawing
X-340Built, not reviewedA place's lanes and the picture's, out of the trip