This page describes the standalone procgen.html runtime: an endless,
full-viewport Lemmings run with procedural terrain streaming, no HUD/minimap,
and no MIDI UI.
- Pick exactly one compatible visual style/theme for a seeded run, then keep the run visually coherent with that style's real terrain/decor pieces.
- Run full-viewport canvas mode with hidden GUI/cursor and endless spawning.
- Stream level pieces to the right while keeping camera follow smooth.
- Track progression from the live rightmost viable lemming frontier, not from lemming id or selected-lemming state.
- Use minimal assists for generated local challenges without turning procgen into constant AI control.
- Keep long-run memory bounded for generated chunks, frontier tracking, and assist decisions.
- Game type:
OHNO. - Level width:
65535. - Level height:
DEFAULT_LEVEL_HEIGHT. - Release rate:
50, release count:50, save requirement:0. - Time limit:
INFINITE. - Ground height:
4. - Initial ground width:
280. - Camera follow smoothing: frame-time-based interpolation.
- Seeded randomness:
?seed=<value>controls deterministic style selection, terrain placement, lookahead variation, and assist decisions.
- Build an
EditorLevel, set procgen headers, and place one entrance gadget. - Convert via
loadEditorLevel, then load intoGamethroughGameFactory. - Set
view.endless = trueso release never stops. - Pick one style compatible with the active pack path. The selected style is the run's theme and is exposed in debug/E2E state.
- Resolve a procgen seed from
?seed=...(fallback: stored value or timestamp), derive independent RNG streams for style and terrain/AI, and persist the active seed for replayability.
- Terrain comes from the selected theme's actual asset catalog:
- ground-capable terrain pieces for the walkable route.
- sparse decorative terrain pieces away from the active route.
- simple obstacle shapes only when they are compatible with the route and the current assist budget.
- Piece placement maintains a stable baseline path with bounded rises, dips, small gaps, small barriers, and safe landing surfaces.
- Decoration must stay readable: avoid dense clusters around the active route, overlapping decorative clutter, and pieces that obscure the next challenge.
- Generated chunk tracking is bounded. Keep recent chunks/pieces for debugging, but prune old entries once they are far behind the frontier.
- The frontier is the rightmost viable live lemming position.
- A viable lemming is active, not removed/disabled/dead/exploded, has finite coordinates, and is not stale-stuck behind the active route.
- If the previous frontier dies, turns around, or gets stuck, recompute from the current live set instead of following its id.
- Selected lemming changes do not affect frontier calculation.
- The generator extends terrain when the distance from frontier to generated end drops below a safe threshold. Threshold variation is allowed, but it must stay inside fixed min/max bounds and never allow lemmings to reach an ungenerated edge.
- Assist decisions are local and budgeted.
- Small gaps should prefer the minimum useful builder action.
- Small barriers should prefer bash/dig/mine only when a local scan indicates a real obstruction.
- Safe drops should avoid spending a skill; intentional risky drops can assign a floater before splat range.
- Traversable terrain should produce a no-op decision and no skill spend.
- Repeated failed attempts on the same lemming/challenge should be cooled down.
- Generated local gaps emit bounded challenge certificates. The local tactical solver verifies those certificates synchronously during generation; rejected gaps are simplified or replaced with extended terrain according to the solver fallback decision.
- Dynamic non-gap assists also emit compact local challenge certificates for barrier clearing and unsafe falls. These certificates record synchronous accept/extend/replace/simplify decisions for debug and review, but they do not mark a run solved; runtime replay remains the only full-route authority.
- Hazard scans use a rebuilt hazard index instead of per-scan trigger-set allocation.
- Gap backlog pruning runs even with no active lemmings to avoid stale growth.
- Terrain stamping reuses cached destination typed-array views per level buffer.
- Asset-piece selection avoids temporary filtered arrays in hot paths.
- Debug lists for recent chunks, generated pieces, assist decisions, and per-lemming trackers are fixed-size rings or pruned arrays.
window.__E2E__.getState().procgen is the stable procgen debug surface. It
should remain compact and JSON-safe:
selectedTheme: style/theme selected for this run.seed: normalized procgen seed.generatedEndX: current generated terrain extent.frontier: rightmost viable lemming summary withx,y,id,reason, andtick.lookahead: current lookahead distance, threshold, and distance to generated end.recentChunks: bounded list of recent generated route chunks.recentCertificates: bounded list of recent local challenge certificate decisions, including source, result type, fallback action, and assist reason when applicable.certificatePolicy: explicit certificate semantics. Its scope islocal-tactical,fullLevelSolvabilityisfalse, and procgen must not claim a generated run or level is solved from these checks alone.- E2E/debug URLs can force deterministic certificate coverage with
gapChance,gapMinWidth,gapMaxWidth,recentCertificateLimit, andprocgenCertificateVerificationquery parameters. recentPieces: bounded list of recent stamped pieces, including style/theme.recentAssists: bounded list of recent assist decisions and no-op scans.trackingSizes: sizes of cooldown, stuck, gap, chunk, piece, and assist tracking structures.
This state is for tests and local debugging. It is not a save format.
e2e/procgen.spec.jsverifies readiness, endless spawn progression, and camera advance. Productization coverage also verifies one selected theme, frontier/generated-end debug state, and bounded tracking summaries.- Unit tests in
test/procgen-controller.test.js,test/procgen-terrain-stamper.test.js, andtest/procgen-asset-manager.test.jscover stability/perf-sensitive behavior. npm run capture:e2e:procgencaptures the procgen viewport, canvas/runtime rects, the frontier area, and newest generated pieces into ignoredtemp/e2e-captures/for visual inspection.
This checkpoint productizes themed piece streaming, frontier-driven lookahead, minimal assists, and local certificate checks for generated gaps, non-gap barriers, and unsafe falls. The checks are bounded and local: terrain generation can simplify or replace local chunks, dynamic assists only record their local decision, and the runtime replay verifier remains authoritative for complete solutions.