Skip to content
[SYSTEM CLOCK :: 10/21/2026, 12:36:11]
██████╗  █████╗ ██████╗ ████████╗ ██████╗ ███╗   ███╗███████╗
██╔══██╗██╔══██╗██╔══██╗╚══██╔══╝██╔═══██╗████╗ ████║██╔════╝
██████╔╝███████║██║  ██║   ██║   ██║   ██║██╔████╔██║█████╗  
██╔══██╗██╔══██║██║  ██║   ██║   ██║   ██║██║╚██╔╝██║██╔══╝  
██║  ██║██║  ██║██████╔╝   ██║   ╚██████╔╝██║ ╚═╝ ██║███████╗
╚═╝  ╚═╝╚═╝  ╚═╝╚═════╝    ╚═╝    ╚═════╝ ╚═╝     ╚═╝╚══════╝

▎ Software Project Organization ▎

>RADTOME ARCADE ENGINE // BUILD 2.5.0

SELECT SIMULATION CABINET

⚡ 3D WALL OF SOUND RADIO// STEREO PANNING & MUTRON AUTO-WAH
Touch of Grey — Grateful Dead (I Will Get By)
TOUR QUEST [1/5]:GATHER LOT GRILLED CHEESE

Steer Jerry Ant towards the yellow Grilled Cheese or blue Sugar Crystals. Harvest with [SPACE] or Click, then walk back to the Steal Your Face nest entrance!

Follow Yellow ArrowTARGET: Lot Grilled Cheese
JERRY HP:100%
QUEEN BERTHA:250 HP
NARC QUEEN:200 HP
COSMIC ENERGY:100%
BEARS:25vs22 NARCS
GOOD VIBES:70
CLICK & HOLD ANYWHERE TO STEER JERRY ANT
TAPERS (LOT FOOD & MIRACLES):50%

Gather grilled cheese, mushrooms, and lay scent trails.

SPINNERS (DANCING BEAR WARRIORS):30%

Defend the lot from Narcs and swarm the Ticket Scalper.

TERRAPINS (STATION EXCAVATORS):20%

Excavate chambers in subterranean Terrapin Station.

SYSTEM ARCHITECTURE::HTML5 CANVAS & REACT 19::PRODUCTION FIELD NOTE

Engineering High-DPI Swarm Simulations & 2D Physics in HTML5 Canvas & React 19

A technical retrospective on building multi-agent stigmergy simulations, procedural chiptune audio synthesizers, and 60 FPS physics loops directly in the browser DOM with zero external physics or media libraries.

// ARCHITECTURAL OVERVIEW & DECLARATIVE REACT BRIDGING

Developing interactive browser games inside modern component libraries presents a fundamental architectural challenge: reconciling React's declarative, asynchronous reconciler with the imperative, synchronous 60 FPS animation loop required by HTML5 Canvas rendering contexts. In naive implementations, binding physics calculations to React state triggers frequent re-renders, causing garbage collection spikes and dropped frames during intensive projectile and agent simulations.

In both Formica: Cyber Colony and Catapult Chaos, the architecture cleanly decouples simulation logic from component lifecycle management. React 19 manages high-level application state—such as caste production ratios, high scores stored in local storage, responsive UI mode switches, and full-screen transitions—while the physics simulation runs autonomously through mutable references (useRef) inside an uninterrupted requestAnimationFrame loop.

Multi-Agent Swarm Intelligence & Stigmergic Pheromone Diffusion

In Formica: Cyber Colony, autonomous worker behavior does not rely on computationally expensive A* global graph searching across thousands of coordinates. Instead, the simulation models natural stigmergy: decentralized coordination through spatial environmental modification.

When a worker ant discovers food, it deposits a decaying scalar pheromone vector along its return route:

// Pheromone Gradient Evaluation in Autonomous Foraging let bestPheromone = null; let maxStrength = 0; for (const ph of pheromones) { if (ph.team === ant.team && ph.type === "food" && ph.layer === ant.layer) { const d = Math.hypot(ph.x - ant.x, ph.y - ant.y); if (d > 10 && d < 90 && ph.strength > maxStrength) { maxStrength = ph.strength; bestPheromone = ph; } } } if (bestPheromone) { ant.angle = Math.atan2(bestPheromone.y - ant.y, bestPheromone.x - ant.x); ant.vx = Math.cos(ant.angle) * ant.speed; ant.vy = Math.sin(ant.angle) * ant.speed; }

This allows organic ant highways to materialize dynamically without central orchestration, scaling smoothly to hundreds of concurrent entities at 60 FPS.

High-DPI Canvas Backing Store & Delta-Time Clamping

Modern user displays range from standard 60Hz 1080p monitors to 120Hz ProMotion screens and high-density Retina mobile devices. Rendering on high-DPI displays without physical coordinate normalization results in blurry pixelated graphics and uneven velocity vectors across different client hardware.

To achieve crisp visual fidelity, the canvas backing store buffer is dynamically scaled against the display's native pixel density:

// High-DPI Canvas Backing Store Normalization const dpr = window.devicePixelRatio || 1; canvas.width = rect.width * dpr; canvas.height = rect.height * dpr; ctx.scale(dpr, dpr); canvas.style.width = `${rect.width}px`; canvas.style.height = `${rect.height}px`;

Furthermore, frame timing is stabilized using delta-time calculation (dt = Math.min((currentTime - lastTime) / 1000, 0.033)). Clamping dt to a maximum threshold of 33 milliseconds prevents the "spiral of death" when backgrounding browser tabs, guaranteeing consistent simulation physics across all devices.

Procedural Audio Synthesis via Web Audio API AudioContext

Traditional web games rely on heavy external MP3, OGG, or WAV audio assets. This introduces latency during initial asset loading, bandwidth bloat, and CORS security issues. RadTome Arcade games eliminate external sound dependencies by synthesizing all audio procedurally via the browser's native AudioContext.

The sound engine builds sound effects dynamically using oscillator nodes, convolver impulse responses, and gain envelopes:

  • Formic Acid Spray (Hiss): White noise buffer fed into a bandpass filter sweeping from 3200Hz down to 1400Hz with high resonance (Q=4.0).
  • Mandible Snap (Bite): A rapid sawtooth pitch bend dropping from 420Hz to 90Hz within 70 milliseconds with exponential gain decay.
  • Multi-Track Chiptune Jukebox: 3-voice procedural compositions including "Colony Awakening" (120 BPM subterranean groove), "War of the Mandibles" (142 BPM battle drums), and "Spider Stalk" (130 BPM tension rhythm), rendered via real-time sub-oscillator synthesis.

// FREQUENTLY ASKED QUESTIONS // ARCADE ENGINE

[ FAQ SCHEMA SYNCED ]

Q1::How does Deadhead Ants: Shakedown Colony simulate stigmergy and procedural Grateful Dead audio?

The simulation combines decentralized multi-agent stigmergy (foraging tapers depositing shakedown scent trails) with a 100% procedural Web Audio API synthesizer rendering six Grateful Dead classics in real time with zero external audio assets: Touch of Grey, Shakedown Street, Fire on the Mountain, Friend of the Devil, Truckin', and Casey Jones.

Q2::How does the subterranean Terrapin Station excavation grid work?

The underground nest is modeled as a 2D tile matrix consisting of empty chambers, soft diggable earth, dense clay, and bedrock barriers. Players and Terrapin digger castes modify the grid dynamically through raycast excavation checks, enabling custom chamber expansion for Queen Bertha's nursery and Scarlet Begonias food pantry.

Q3::How does Catapult Chaos 3D project perspective coordinates on HTML5 Canvas?

The engine projects 3D spatial coordinates (X, Y, Z) onto the 2D canvas via pinhole perspective mathematics: `scale = focalLength / (focalLength + Z)`. Coordinates scale non-linearly towards the horizon, adjusting projectile radius, particle size, and spike geometry as the cat travels into the screen.

Q4::How does Neon Survivor's bullet-heaven auto-battler work?

Neon Survivor is an endless arena survival game in the bullet-heaven genre. Twin-stick controls: aim with your cursor and your weapons (pulse gatling, 5-way scattergun, orbiting SHOGUN RING blades, periodic nova blast) auto-fire toward your aim point. Dashing (SPACE/SHIFT) grants brief invincibility. Destroyed enemies drop XP shards that level you up, letting you draft 1 of 3 random upgrades (damage, fire rate, projectiles, magnet radius, pierce, regen) to shape a unique build every run. Chain kills for a combo multiplier, and a CRUSHER mini-boss spawns every 45 seconds.

Q5::How is audio synthesized without downloading external MP3 or WAV files?

Sound effects (mandible bites, 13-point lightning wah bursts, earth digging) and the full Grateful Dead jam (Jerry's Mutron III auto-wah lead, Phil's tube bass, Bob Weir's rhythm guitar, a Hammond B3 pad and the Bill & Mickey drum circle) are generated entirely at runtime through the browser's native Web Audio API (`AudioContext`). Multi-voice detuned oscillators, parallel body/quack filter paths, tempo-synced delay buses, shared tube-saturation amp heads and synthesized drums run in real time with zero external audio asset downloads.

Q6::How does the Doom Runner 2.5D raycasting engine render textured walls, floors and billboard sprites?

The renderer writes into a low-resolution 32-bit framebuffer in three passes. First, floor and ceiling are ray-plane cast: one world-space sample per pixel, sampled from a procedural 64x64 texture and distance-shaded toward the fog colour. Second, a DDA grid march runs once per screen column, producing a per-column depth buffer as a free by-product. Third, sprites are billboarded, depth-sorted back-to-front and clipped column-by-column against that depth buffer, which is what keeps monsters correctly occluded by walls.

Q7::Where does the Doom Runner heavy metal soundtrack come from if it loads no MIDI files?

Three grooves (132, 140 and 145 BPM) in drop D / E minor are sequenced by a look-ahead scheduler running off the AudioContext clock rather than chained setTimeout calls. Rhythm guitar is a dual detuned sawtooth pair with a square sub-octave, pushed through a shared waveshaper overdrive curve and a resonant lowpass; the lead adds a sustained >=200ms envelope so riffs stay singable; the bassline is sub-heavy square + triangle doubling the riff two octaves down. Kick, snare and hats are pitch-dropping sines and filtered noise, mixed under the melodic bus.

Q8::How does BEAT BLOCK synchronize falling block gravity and timing judgements with the Web Audio API clock?

BEAT BLOCK treats the AudioContext clock as the master conductor. Instead of estimating delta times via requestAnimationFrame, the look-ahead scheduler emits tempo anchors that map audio playback time to exact fractional musical beats. Gravity steps occur on exact beat subdivisions, and player moves (rotations, hard drops, holds) are judged against the nearest beat with millisecond-precision windows (PERFECT <= 50ms, GREAT <= 100ms).

Q9::How does the BEAT BLOCK dynamic synthwave soundtrack layer instruments procedurally?

The procedural synthwave engine structures songs into 6 dynamic stems: Kick + Gated Pad (lowpassed), Octave Bass (ducked by sidechain), Gated Snare & 16th Hats, Ping-Pong Arpeggio, the Lead Supersaw Hook, and FEVER Countermelody. As players land on-beat moves and clear lines, the Groove meter unlocks higher tiers, opening filter sweeps and fading in instrument buses in real time without audio glitches or external samples.

Published by Rad Tome, Lead Systems Architect & Founder
✓ Validated against HTML5 Canvas, Web Audio API & Schema.org Specifications