I'm building RUSTGATE — an efficient, fully procedural Doom-like raycaster. No game engine, no 3D libraries: a custom typed-array pixel renderer (DDA raycasting), procedurally generated textures/sprites/maps, multi-floor descent, and synthesized WebAudio. Let me set up the shell first.
Shell + CSS done. Now the core utilities (PRNG, color packing) and the procedural texture factory with 32-level pre-shaded variants for fast distance fog.
Now the texture factory — 22 procedural 64×64 textures, each pre-shaded into 32 lighting levels (so per-pixel fog is just a table lookup in the render hot loop).
Fixing the truncated tail of textures.ts with the real shade-table builder:
Now the sprite factory — hand-authored pixel maps composed into animated frames for enemies, weapons, pickups, HUD face states, and FX. All baked to raw pixel arrays with a lazy per-shade cache so distance fog on sprites is nearly free.
Sprites compile. Now the audio engine — fully synthesized WebAudio SFX (no assets): guns, growls, doors, explosions, plus a dark procedural drone for ambience, with distance/pan spatialization.
Audio done. Now the multi-floor procedural level generator: rooms + corridors with guaranteed connectivity, themed wall variants, locked vaults, key-gated exit chambers, and depth-scaled population.
Removing the leftover broken pillar snippet:
Now the heart — the raycasting renderer: typed-array framebuffer, per-column DDA with two-hit door support, textured floor/ceiling casting, z-buffer clipped sprites, deferred door bands, and a particle pass.
Renderer compiled. Now the game brain — game.ts: fixed-timestep loop, player physics, enemy AI state machines, hitscan/projectile combat, doors/keys, items, barrels & chain explosions, particles, HUD wiring, automap, adaptive resolution scaling, floor transitions.
Game logic compiles. Now update the two id references to match planned DOM, then build the React shell with the full HUD and screens.
Adding key-glyph styles and a context-menu guard, then checking main.tsx:
Now generating the title-screen key art (one AI image — everything in-game is procedural):
Build passes on the first shot. Now auditing runtime logic, I caught two real bugs: a vault-door registration mismatch in mapgen (door placed at one cell, lock registered at another) and a sprite-key mismatch for the shotgun pickup. Fixing both:
Adding a safety guard for pathological room layouts (regenerate if too few rooms placed) and cleaning a leftover expression:
Making vaults actually worth unlocking — guaranteed loot inside blue/yellow vault rooms:
Two feel-critical fixes I spotted in re-review: inverted vertical mouse look/recoil sign, and the auto-quality EMA measuring vsync-capped frame time instead of actual render cost. Fixing:
Let me re-read mapgen end-to-end for a final correctness pass:
Mapgen checks out. Rebuilding to validate all edits:
Two gaps to close: the explosion sprite frames I baked are never shown (explosions only spawn particles), and pickups deserve a glow pulse. Wiring both in:
One last logic gate — enemies shouldn't remotely unlock keyed vault doors just because the player holds the key; the unlock must require the player to be at the door:
RUSTGATE is built and shipping — a complete procedural Doom-like written in raw TypeScript with zero engine dependencies, ~92KB gzipped total.
What you got
Custom raycasting engine — no WebGL, no libraries:
- Per-pixel rendering into a
Uint32Array framebuffer at 480×270 (classic Doom res), upscaled with image-rendering: pixelated
- DDA per-column wall casting with fish-eye correction, textured floor and ceiling casting, distance fog via 32 pre-shaded copies of every texture (fog is a table lookup, not per-pixel math), and per-scanline shading
- Adaptive resolution scaling — measures real render cost and steps between 560→352px widths to hold 60fps
- Z-buffer clipped sprites, deferred door-band rendering (doors rise into the ceiling with correct occlusion), billboard particles
Everything is procedural — zero art/audio assets:
- 22 texture types (tech panels, vents, hazard stripes, rust, hell marble, flesh, ritual reliefs...) generated from seeded value-noise and pixel ops
- Enemies (Trooper, Imp, Pinky, Baron) built from hand-authored pixel maps with code-composed walk/attack/pain/death frames
- Weapons, pickups, HUD face (mood/look-direction states), explosions, muzzle flash — all synthesized
- All audio is WebAudio synthesis: shotgun, growls with stereo pan/distance falloff, doors, keycards, a dark detuned-saw drone with sparse minor chimes
Multi-floor endless descent:
- Seeded room/corridor generation per depth — guaranteed connectivity (BFS), themed by sector (Orbital Foundry → Rust Warrens → Gore Cathedral), growing maps and escalating difficulty
- Doom-style structure: hunt the red keycard to unseal the exit chamber, blue/yellow vaults with locked loot rooms, carpets of enemies guarding the key and exit
- Explosive barrels with chain reactions, enemy AI (sight/hearing, chase, telegraphed attacks, pain interrupts, gibs), projectiles, hitscan combat, secrets, automap (TAB), damage/heal feedback, weapon bob + recoil, camera shake
Point it at npm run dev and click DESCEND. Best depth persists in localStorage.
Files built: index.html, src/index.css, src/game/util.ts, src/game/textures.ts, src/game/sprites.ts, src/game/audio.ts, src/game/mapgen.ts, src/game/renderer.ts, src/game/game.ts, src/App.tsx