Continues the modularization. Moves the four per-zone inventory
handlers into their own file:
--list-zone-meshes (WOM stats)
--list-zone-audio (WAV header parse)
--list-zone-textures (texture-ref histogram)
--info-zone-summary (BOOTSTRAPPED/PARTIAL/EMPTY status)
Each consumes a trailing --json flag the same way; consolidated
that check into a consumeJsonFlag helper at the top.
main.cpp drops 27,445 → 27,200 lines (-245). Per-zone inventory
behavior unchanged (re-verified all 4 commands).
A pre-existing duplicate --list-zone-meshes handler (the older
detailed per-mesh listing, similar to the --list-project-meshes
collision fixed in 976549fe) is now dead code in the in-line
chain since the extracted module dispatches first. Will rename
or remove that duplicate in a follow-up cleanup.
Per-pixel salt-and-pepper grain jitter (the individual sand
grains) overlaid with wide sinusoidal ripple bands aligned
along an offset that drifts smoothly across rows (the wind-
formed dune ridges). Result reads as windswept beach or
desert.
Defaults: rippleSpacing=24px, seed=1. Useful for desert
zones, beaches, oases, dungeon floors. Brings the procedural
texture pattern set to 20.
Continues the modularization. Moves --gen-zone-readme and
--gen-project-readme into their own translation unit using the
established handle<Family> dispatch pattern. Consolidated the
trailing --out flag parser into a single parseOutFlag helper
(was duplicated between the two handlers).
main.cpp drops 27,736 → 27,445 lines (-291). Behavior unchanged
(verified by re-generating README and PROJECT.md, contents
identical to pre-refactor output).
Continues the modularization. Moves the four audit handlers
(--validate-zone-pack, --validate-project-packs, --info-zone-deps,
--info-project-deps) into their own file using the same
handle<Family>(int& i, int argc, char** argv, int& outRc) pattern.
Side-cleanup: the two project-scope audits had identical
subprocess-fanout structure (enumerate zones → run per-zone
command → tally PASS/FAIL → print summary). Consolidated that
into a shared runPerZoneAudit helper. Saves ~80 lines of
duplicated dispatch code.
main.cpp drops 28,070 → 27,736 lines (-334). Audit family is
fully self-contained (~330 lines), behavior unchanged
(verified all 4 commands against existing test zones).
Continues the modularization started in 6c9ab6fa. Moves the four
pack-orchestrator handlers (--gen-zone-texture-pack, -mesh-pack,
-starter-pack, --gen-project-starter-pack) into their own file
following the same handle<Family> pattern.
Side cleanup:
- Consolidated the duplicated --seed flag parser into a single
parseSeedFlag helper
- Consolidated the std::system + > /dev/null wrap into runSilently
main.cpp drops 28,329 → 28,070 lines (-259). Pack family is fully
self-contained (~260 lines), behavior unchanged (verified by
re-running gen-zone-starter-pack and confirming 6 PNGs + 5 WOMs).
main.cpp had grown past 28k lines, with each new procedural-
generation command adding 100-200 lines to the inline if/else
dispatch chain. This commit starts breaking that up by moving
the four audio-related handlers (--gen-audio-tone, -noise,
-sweep, --gen-zone-audio-pack) into their own translation unit.
Pattern established here for future family extractions:
- Family lives in cli_<family>.{hpp,cpp}
- Single dispatch entry point: bool handle<Family>(int& i, int argc,
char** argv, int& outRc) — true if matched (writes outRc), false
to fall through.
- main.cpp's argv loop calls each family's dispatcher first and
returns its outRc on match, before the legacy in-line chain.
Side-benefit: consolidated the duplicated 25-line WAV header
writer + 5ms attack/release envelope into shared helpers
(writeWavMono16, applyEdgeEnvelope) at the top of the new file.
main.cpp drops from 28,943 → 28,329 lines (-614). Audio family
is fully self-contained (~440 lines), behavior unchanged
(verified by re-running tone/noise/sweep + zone-audio-pack).
Two cylindrical pillars hold up a curved keystone vault: the
vault is a series of N angular wedge segments tracing a half-
circle from pillar-top to pillar-top. Each wedge has inner +
outer radial faces and front/back side caps.
Defaults: 3w × 3h pillars, thickness=0.4, 12 arch segments.
The fancier sibling of --gen-mesh-portal (flat lintel) — the
archway gives a temple/cathedral aesthetic. Brings the
procedural mesh primitive set to 25.
Project-wide companion to --info-zone-deps. Fans out the
per-zone broken-reference audit across every zone via
subprocess (defers to the canonical resolution logic so
behavior stays consistent) and reports per-zone PASS/FAIL
plus a project rollup. Exits non-zero if any zone has a
broken texture reference — designed as a CI gate.
Procedural doorway: two vertical post boxes plus a horizontal
lintel box across the top. Posts run along the Z axis (so
width spans Z), the opening faces +X. Pass lintelHeight=0
to skip the lintel for two free-standing posts.
Defaults: 2.5w × 4h, post thickness 0.4, lintel 0.5. Useful
for entrances, gates, magical portals, ruins, walls. Brings
the procedural mesh primitive set to 24.
Walks every WOM in a zone, collects texture references from
each model's texturePaths, and checks whether each path
resolves to a real file. Tries 4 candidate paths per ref
(as-is, relative to zone, in textures/, alongside the WOM)
before flagging as missing.
Catches "WOM was added but its texture wasn't copied into
textures/" mistakes before runtime. Exits 1 if any reference
is unresolved — suitable for CI.
Cellular Worley noise at small grain scale: each "pebble" cell
darkens at its boundary with neighbors (the irregular bump
shading characteristic of fine-grain leather), with per-cell
tint variation so the surface doesn't read as uniform.
Defaults: grainSize=4px, seed=1. Useful for armor, saddles,
chairs, book bindings, scabbards. Brings the procedural
texture pattern set to 19.
Procedural altar: stack of N stepped cylindrical discs, each
one wider and shorter than the next so the silhouette descends
like a wedding cake. The top disc is the altar surface; base
discs widen out to anchor the structure visually.
Skips the bottom cap on every disc except the lowest (saves
~24 tris per disc since each is hidden by the next one below).
Defaults: topR=0.7, topH=0.3, 3 steps, stride=0.3. Pairs
naturally with --gen-texture-marble for a temple aesthetic.
Brings the procedural mesh primitive set to 23.
Two changes that work together:
1. terrain_mesh.cpp: bump texture-coord scale from 1× to 4× per
chunk so the texture's own pattern repeats every ~8 yards
instead of every ~33 yards. At 1×, the texture's repeat
frequency syncs with the chunk grid and any per-chunk alpha
difference reads as a hard 33-yard square. At 4× the pattern
noise breaks up the boundary line and the eye stops locking
onto the grid.
2. terrain.frag.glsl: widen the alpha-edge feather from 3 to 8
texels and use 9 taps instead of 5 so per-chunk alpha values
bleed across the chunk boundary instead of stepping. Hard
alpha steps were the second contributor to visible chunk
tiles in painted regions.
Reported by user via screenshot showing obvious chunk-grid
artifacts in painted areas of the texture-paint editor.
Per-pixel white noise heavily blurred along one axis (long
brush strokes) and lightly along the other (thin variation
across strokes), then contrast-stretched and applied as a
multiplicative tint on the base color. Result: long thin
streaks of varying brightness — the visual signature of
brushed steel/aluminum/iron.
Defaults: horizontal orientation, seed=1. Useful for armor,
weapons, machinery, sci-fi panels. Brings the procedural
texture pattern set to 18.
Project-level companion to --gen-zone-readme. Writes PROJECT.md
with a per-zone status table (BOOTSTRAPPED/PARTIAL/EMPTY plus
biome and per-category counts) and a project-level rollup
(total zones, assets, bytes). Pairs naturally with the per-zone
README — running both gives self-documenting content at every
level.
Procedural statue silhouette: square pedestal block + tall
narrow body cylinder + UV-sphere head. Reads as a statue
without needing limb geometry. The head sphere is 16×12 lat/lon
so silhouette stays smooth at distance.
Defaults: pedestal=1.0, bodyH=2.5, headR=0.4. Useful for
monuments, hero statues, plaza centerpieces, religious
shrines. Brings the procedural mesh primitive set to 22.
Writes README.md to a zone (or to --out path) with a Markdown
asset table covering textures (PNG bytes), meshes (verts/tris/
bones/batches/bytes), and audio (sample rate + duration). Reads
zone.json for the friendly map name and biome.
Saves the manual README maintenance every time content changes.
Marble pattern via warped sinusoidal veining (the canonical
"marble shader"): take a sine wave, warp its input by smooth
multi-octave noise, raise |sin| to a high power so the bright
vein bands stay narrow. Result: irregular bright veins on a
base color with low-freq variation across the texture.
Defaults: sharpness=8, seed=1. Useful for floors, statues,
cathedral walls, ornate furniture. Brings the procedural
texture pattern set to 17.
Project-wide companion to --info-zone-summary. Walks every
zone in <projectDir>, classifies each as BOOTSTRAPPED (textures
+ meshes + audio all non-empty), PARTIAL (some categories), or
EMPTY (none), and shows per-category counts in a status table
with a project total at the bottom.
Quick "what shape is the whole project in" view that pairs
naturally with --validate-project-packs (which actually loads
and verifies every asset).
Procedural fountain: low cylindrical basin with a narrower
spout column rising from its center. Solid (not hollow) for
simplicity but still reads as a fountain because of the spout
silhouette. Cylinder helper builds side ring + top/bottom
caps so basin and spout share the same construction.
Defaults: basin r=1.5 h=0.5, spout r=0.2 h=1.5. Useful for
town squares, plazas, garden centerpieces. Brings the
procedural mesh primitive set to 21.
Compact per-zone status command. Reads zone.json for the
friendly map name, scans textures/, meshes/, audio/ for asset
counts and total bytes per category, and assigns a status:
BOOTSTRAPPED (all 3), PARTIAL (some), or EMPTY (none).
Lighter-weight than --validate-zone-pack (which loads + sanity-
checks every WOM/PNG/WAV) — useful for quick "what shape is
this zone in" checks during interactive editing.
Worley-style cellular pattern: each pixel finds its nearest
"stone center" in a perturbed grid (3x3 neighborhood search).
Pixels with a small gap between closest and second-closest
center become mortar boundaries; everything else is the stone
face with per-stone tint variation and radial darkening for a
3D rounded-stone look.
Defaults: stone=24px, seed=1. Useful for streets, plazas, town
squares. Brings the procedural texture pattern set to 16.
Batch 34's --list-project-meshes (per-zone aggregate) introduced
a flag collision with a pre-existing per-mesh sorted listing
that's been in the codebase. The dispatch chain ran the new
handler first, leaving the older detail view as dead code.
Resolves the duplicate by renaming the older handler to
--list-project-meshes-detail. Both views are now reachable:
the per-zone aggregate stays under the simpler name (covers
the common "how heavy is each zone" case), and the per-mesh
sorted-by-tris detail listing is back as -detail (used for
project-wide outlier detection and mesh-sharing audits).
Procedural house: 4 outward-facing wall quads + a floor slab,
topped by a 4-triangle pyramid roof meeting at a central apex.
Eaves line up with the wall edges so the roof sits flush. Pass
roofHeight=0 for a flat-roof shed.
Defaults: 4×4×3 with 2m roof. Useful for villages, settlements,
quest hubs. Brings the procedural mesh primitive set to 20.
Project-wide bootstrap orchestrator. For every zone in
<projectDir>, runs --gen-zone-starter-pack (textures + meshes)
and --gen-zone-audio-pack (audio). Each zone gets a unique
sub-seed offset from the base seed so per-zone content reads
as distinct (rocks differ, wood grain differs).
Pairs with --validate-project-packs as the inverse: bootstrap
the entire project in one call, audit, ship.
Sine wave whose frequency glides from startHz to endHz across
the duration. Two shape modes:
linear: f(t) = f0 + (f1-f0)*t/T (integrated phase = quadratic)
exp: f(t) = f0 * (f1/f0)^(t/T) (logarithmic glide)
Same RIFF/PCM-16 mono envelope as gen-audio-tone with 5ms
attack/release. Useful for sci-fi door whoosh, alert ramps,
sliding pitch cues, and as a standard signal-engineering test
signal — all hand-synthesized open-format WAV.
Project-wide companion to --list-zone-audio. Walks every
zone in <projectDir> and reports per-zone WAV count + bytes
+ total duration, plus a project grand total. Reuses the
RIFF/WAVE header parse from list-zone-audio.
Completes the project-scope inventory trio alongside
--list-project-meshes and --list-project-textures.
Procedural round castle tower: solid cylindrical shaft with
crenellated battlements ringing the top — alternating raised
merlons and gaps. Each merlon is an extruded arc segment
sitting on the rim. Pass battlementH=0 for a smooth-topped
tower.
Defaults: radius=1.5, height=8, battlements=8, battlementH=0.5.
Useful for keeps, watchtowers, perimeter walls. Brings the
procedural mesh primitive set to 19.
Fans out --validate-zone-pack across every zone in a project
and reports a single PASS/FAIL per zone plus a summary line.
Exits non-zero if any zone fails — designed as a CI gate
before shipping a project's content pack.
Pairs with the existing zone-pack orchestrator family for
end-to-end "bootstrap → audit at project scale" coverage.
Procedural fabric: alternating warp (vertical) and weft
(horizontal) threads on a checkerboard cell grid, with each
thread shaded brighter at center and darker at edges so the
weave reads as 3D yarn rather than flat checker squares.
Defaults: thread=4px, W=H=256. Useful for banners, tapestries,
clothing, sails. Brings the procedural texture pattern set to 15.
Project-wide companion to --list-zone-meshes. Walks every
zone in <projectDir> and reports per-zone WOM count + bytes/
verts/tris row, plus a project grand total. Both human-
readable table and --json supported.
Useful for "how heavy is the entire project mesh-wise"
budgeting before shipping a content pack.
Audits a zone's open-format asset pack: counts and total bytes
for textures (PNG signature check), meshes (WOM load + sanity
check), and audio (RIFF/WAVE header check). Reports any
malformed files by relative path and exits 1 if anything is
invalid or the pack is empty.
Ties together the zone-pack orchestrator family — a CI step
can now gate that gen-zone-starter-pack output is healthy
before downstream packaging.
Procedural plank bridge: deck of N axis-aligned planks running
along the length with small gaps between, optional side rails
(top rail + 3 posts each side). Length runs along +X, width
along Z. Pass railHeight=0 to skip rails for a simpler footbridge.
Defaults: length=6, width=2, planks=6, railHeight=1. Useful for
river crossings, dungeon catwalks, scenic overlooks. Brings the
procedural mesh primitive set to 18.
Three audio-engineering noise colors:
white — equal energy per Hz (uniform random samples)
pink — equal energy per octave via Voss-McCartney 7-band
cascade (1/f spectrum, sounds like rain or wind)
brown — 1/f² spectrum via random walk (sounds like distant
surf or rumbling weather)
All written as PCM-16 mono with same RIFF header + 5ms
attack/release envelope as gen-audio-tone. Replaces typical
proprietary nature-sound MP3 placeholders for ambient zone
audio with hand-synthesized seeded WAVs.
Inventories every WAV under <zoneDir>/audio/ with stats parsed
straight from the RIFF/WAVE header: sample rate, channel count,
bit depth, duration. Both human-readable table and --json
output supported.
Completes the per-zone asset accounting trio alongside
--list-zone-meshes and --list-zone-textures.
Drops a 6-WAV starter pack into <zoneDir>/audio/: ambient-low
+ ambient-mid (drone pair, fifth interval), music-stinger,
chime, alert, click. All hand-synthesized PCM-16 mono WAVs
via --gen-audio-tone — no MP3 patent or licensing baggage.
Closes the audio side of the open-format zone bootstrap. A
fresh zone now has full coverage across textures (PNG), meshes
(WOM), and audio (WAV) from procedural generators alone.
Procedural classical column. Cylindrical shaft with N concave
flutes (radius modulated by cos² of angle×flute-count) capped
by wider disc bases above and below — basic capital + base
geometry. Defaults: radius=0.4, height=4, flutes=12, capScale=1.25.
Useful for ruins, temples, dungeons, plaza decoration. Brings
the procedural mesh primitive set to 17.
Hand-rolled RIFF/WAVE PCM-16 mono encoder — no library deps,
44-byte header written field-by-field. Supports four waveforms
(sine/square/triangle/saw), 5ms attack/release envelope to
prevent click on tone start/stop, freq 0..24kHz, duration
0..600s, sampleRate 8k..192k.
Opens a brand-new file family in the open-format ecosystem
alongside WOM/WOB/PNG/JSON. Proprietary MP3 placeholders for
zone audio can now be replaced by hand-synthesized WAVs with
no patent or licensing baggage.
Companion to --list-zone-textures. Walks every WOM under a
zone dir and reports per-mesh size, vertex/triangle counts,
bone/anim/batch counts, and texture-ref counts. Both human-
readable table and --json output supported.
Useful for "how heavy is this zone" budgeting and verifying
that bootstrapping orchestrators (gen-zone-mesh-pack, gen-zone-
starter-pack) produced what they claim.
Convenience entry point that runs --gen-zone-texture-pack and
--gen-zone-mesh-pack in sequence so a fresh zone gets a full
open-format asset bootstrap from one command. Seed propagates
to both children for reproducibility.
A new zone now goes from "just a zone.json" to "11 placeholder
assets across textures/ and meshes/" with one invocation —
zero proprietary M2/BLP imports required.
Companion to --gen-zone-texture-pack. Drops a 5-mesh starter
pack (3 rock variants + tree + fence) into <zoneDir>/meshes/ by
fanning out to the procedural --gen-mesh-* family. Each rock
variant uses a distinct seed so they read as different boulders.
Together with the texture-pack orchestrator a fresh zone can now
be bootstrapped to first-render-ready state with zero proprietary
M2/BLP imports — entirely from open WOM/PNG output.
Procedural grass texture: jittered base color + scattered short
vertical blade strokes blending toward a brighter highlight hue.
Strokes wrap on Y so the texture tiles vertically. Reproducible
from a seed.
Defaults: density=0.15, seed=1, W=H=256. Brings procedural
texture pattern set to 14 commands.
Subdivided octahedron + smooth sin-product noise displacement.
Each seed produces a unique silhouette so scattering looks
varied. Defaults: radius=1, roughness=0.25, subdiv=2 (128
triangles), seed=1.
Pairs naturally with random-populate-zone for outdoor decoration
and brings the procedural mesh primitive set to 16.
New zone-scope command that drops a 6-texture starter pack
(grass, dirt, stone, brick, wood, water) into <zoneDir>/textures/
by fanning out to the procedural --gen-texture-* family. Saves
users from sourcing proprietary art when bringing up a new zone —
the entire pack is open PNG output from procedural generators.
Adds to the gen-random-zone family of project orchestrators.
Procedural wood grain texture: vertical streaks of varying width
between two hues, plus pseudo-random knots. Reproducible from a
seed via tiny LCG (no <random> dep). Suitable for doors, planks,
fences, crates.
Defaults: spacing=12px, seed=1, W=H=256. Brings procedural
texture pattern set to 13 commands.
Procedural brick wall texture with offset rows + mortar lines. Each
row alternates by half a brick width, mortar gap appears between
rows and within each row. Useful for walls, chimneys, paths, and
medieval-zone props.
Defaults: brickW=64 brickH=24 mortarPx=4 W=H=256. Brings procedural
texture pattern set to 12 commands.
Procedural tree: cylindrical trunk (12 segments) + UV-sphere
foliage (12 segs × 8 stacks). Foliage centered above the trunk
with a slight overlap so the trunk pokes into the bottom of the
canopy.
Useful for ambient zone decoration, distant tree placeholders,
magic-grove props. The 15th procedural primitive — composite of
cylinder + sphere with everything in a single batch so it ships
as one mesh.
Args: <wom-base> [trunkRadius] [trunkHeight] [foliageRadius]
Defaults: 0.1 / 2.0 / 0.7 (3.2y total height — small/medium tree).
Pairs naturally with --add-texture-to-mesh for the bark+leaf
textures, or just one composite texture since this is a single-
batch mesh. Verified: defaults produce 143 verts / 216 tris.
Times each --audit-project sub-step end-to-end so users can see
where the slow checks are. Useful for tuning a CI pipeline: drop
the slowest check from a fast-feedback pre-commit hook, run the
full audit on push.
Reports wall-clock per step, share of total, and pass/fail status
for each. Status column means the check ran cleanly even on a zone
with content issues — bench timings are about runtime, not
correctness.
On a small test zone, items-schema and spawn-placement dominate
the share (~25% each) since they involve loading content +
sampling terrain. Format/open-only/refs/content are sub-10ms each.
Same value-noise function as --gen-texture-noise but interpolated
between two RGB endpoints rather than emitted as grayscale.
Useful for terrain detail (grass+dirt mottle), magic fog, marble
veining, or any "natural variation" pass that shouldn't be
desaturated.
Args: <out.png> <colorAHex> <colorBHex> [seed] [W H]
Defaults: seed 1, 256x256.
11th procedural texture pattern (joining solid, BW checker, color
checker, grid, vertical/horizontal/radial gradients, grayscale
noise, stripes, dots, rings).