Buildings, interiors, and seeing behind things in 3/4 and isometric view

Notes compiled 2026-11-05 for Elsewhere and the Tycho study. Target: plain JavaScript on a phone, an isometric 2:1 picture at 320x180, eight inks to a frame, everything deterministic from a seed and painted into palette-indexed buffers. Sibling notes: settlements_paths_vegetation.md (where houses go in a village), styles_resolution_perspective.md (projections), world_generation.md (Watabou, Parish & Müller). This note covers how one building is made (footprint, rooms, doors, furniture, roof), how its inside is shown, and how things are depth-sorted so a figure can walk behind and inside them.

Note on sourcing: Merrell et al. 2011, Mirahmadi & Shami 2012 (which restates Marson & Musse 2010) and Bruls et al. 2000 were downloaded and read as text (mutool). Marson & Musse 2010 itself sits behind a bot wall at Hindawi/Wiley and was not read; its method is taken from Mirahmadi & Shami’s summary and from abstracts. The Fallout 2 code is from the fallout2-ce reimplementation (alexbatalov/fallout2-ce, src/tile.cc and src/object.cc), read directly. The Ultima VII code is from Exult (gamewin.cc, objs/chunks.cc, objs/objs.cc), read directly; Exult is a reimplementation, so it shows one faithful way, not necessarily Origin’s code. Other items come from fetched pages; “(search summary)” marks claims seen only in search-result summaries. Times marked “bench” were measured with buildings_sorting_bench.js beside this note: Node v26.8.1 on a 2019 Intel i9-9880H at 2.3 GHz, one thread. No phone was measured.

1. Floor plans

Takeaway

Three families: subdivide a rectangle (treemaps, BSP), grow rooms from seeds inside a footprint (constrained growth), or fill a grid with a constraint solver (WFC, as Caves of Qud does). For a small house of 3 to 7 rooms the squarified treemap with zones (public, service, private) is the simplest that reads as a real plan: one recursive pass, microseconds, rooms near square. Doors come from a room graph laid over the adjacency of the rectangles; a corridor is needed only when a required link isn’t adjacent.

Cited findings

For Elsewhere (inference)

2. Facades and grammars

3. Roofs from footprints

Takeaway

A hip roof over any simple polygon is its straight skeleton raised by a slope; a gable is the same with the end edges made vertical. For rectangles and rectilinear footprints this reduces to formulas: a rectangle w x d (w >= d) has a ridge of length w - d at height (d/2)·tan(pitch), and the four hips meet it at 45 degrees in plan. Rectilinear footprints can be cut into rectangles, each roofed, then merged (Laycock & Day 2003).

Cited findings

For Elsewhere (inference)

Climate presets as numbers: snow (steep gable, about 50 to 55 degrees, timber, small windows, compact footprint), temperate (hip or gable about 35 to 40 degrees, plaster and tile), arid (flat roof with parapet, adobe, courtyard or L footprint, few small windows), wet lowland (stilts of about 1 m, steep thatch hip, veranda). The pitch values are design choices consistent with the trends above, not sourced numbers.

4. Furniture

5. Showing the inside

Takeaway

Two families. Separate interior maps (Stardew Valley, most JRPGs): the door is a warp; no sorting or cutaway problem, but the house’s outside and inside need not agree. In-place cutaway (Ultima VII, Fallout 1/2, The Sims, Project Zomboid, RimWorld): the inside is under the roof, and the renderer hides what’s above or in front of the player. The two classic in-place rules are a height cut (Ultima VII: hide everything above the lowest thing over the avatar’s head) and a region flood (Fallout: hide the connected roof region the player stands under). Walls in front are handled by fading (Diablo II, Fallout’s “egg”) or cutting to stubs (The Sims cutaway).

Cited findings

For Elsewhere (inference)

6. Depth sorting

Takeaway

Sorting by a key (tile x + y, or base screen y) is correct only when every object fits in one tile. Tall and multi-tile objects (houses, long walls, a tree’s crown over the next tile) break it. The general fix is a dependency graph of screen-overlapping pairs ordered by 3D box separation, then a topological sort (Lebron; Exult; Russell’s River City Ransom: Underground). Cycles are rare with blocky objects and are broken by splitting or deleting one edge. The cheaper fix used by shipped tile games is to cut big things into tile-sized slices (Diablo II’s walls in tile pieces, Stardew’s Front layer), so the key sort works again.

Cited findings

Found building the occlusion demo (measured)

For Elsewhere (inference)

Open questions