EchoQuest v0.19.9: Client Rendering Pipeline
Bundles 1–3 of the performance plan optimized the server: profiling, AI tick rates, and network protocol. Bundle 4 turns to the client. Every frame, the browser was updating every entity on the map, allocating fresh objects for every damage number and VFX effect, and redrawing the entire fog of war. This release fixes all of it.
Camera-Viewport Entity Culling
The game world can have 30+ enemies, a dozen NPCs, resource nodes, remote players, and minions. Previously, every entity ran its full update() every frame — health bar positioning, animation state, name label updates — regardless of whether the player could see it. Now the game caches the camera viewport bounds at the top of each frame and skips entities outside a 200px margin. Off-screen entities have their UI elements hidden to prevent orphaned health bars. On a busy map where the player can only see ~8 of 30 enemies, this skips work for the other 22 every single frame.
Object Pooling: Damage Numbers
Every hit in combat used to create a new Text object, tween it upward for 800ms, then destroy it. In heavy combat with 5+ enemies and critical hits, that meant 10+ text allocations and destructions per second — creating visible GC stutters. Now the game pre-allocates a pool of 30 Text objects at map load. When a damage number is needed, it grabs one from the pool; when the tween finishes, it goes back. Zero allocations during combat.
Object Pooling: VFX Effects
The same allocation problem existed for visual effects. Each ability — firebolt, frost nova, chain lightning, whirlwind, shield bash, and 20+ more — created fresh Graphics, Circle, or Line objects per activation, then destroyed them on completion. With abilities firing every 1–2 seconds, that’s constant churn. Now three pools (Graphics, Circle, Line) are pre-allocated. All 24+ VFX methods pull from the pool and release on completion. The pool sizes are configurable and overflow-safe: if the pool is exhausted, new objects are created on demand.
Incremental Fog of War
EchoQuest’s fog of war tracks which tiles the player has seen (explored) and which are currently visible. Previously, every time the player moved one tile, the system cleared the entire fog texture and re-drew every explored tile and every visible tile from scratch — including string-parsing each tile key with split(’,’).map(Number). With 2,000+ explored tiles, this meant 2,000+ fill operations and string allocations per step.
Now the system tracks the previous set of visible tiles and computes the delta: newly visible tiles get erased (clear fog), newly hidden tiles get drawn back (dim to explored opacity). A typical tile-step changes 20–40 tiles at the edge of the vision cone instead of reprocessing all 2,000+. The string-based tile keys are replaced with fast integer encoding.
Health Bar Dirty Flags
Every entity (enemies and remote players) called setPosition() on three objects (name label, health bar background, health bar fill) and recalculated health bar width every frame. For idle enemies standing still at full HP, this was pure waste. Now each entity tracks its last known position and HP. Position updates only fire when the entity moves; width recalculation only fires when HP changes. Combined with viewport culling, an idle off-screen enemy does zero work per frame.
Mobile Rendering Reduction
Mobile devices run the same game but with weaker GPUs. This release adds a device-aware rendering config: mobile gets half-sized object pools (still plenty for phone-sized combat), fog of war raycasts at 4-degree steps instead of 2 (90 rays vs 180), and non-essential VFX effects (war cry rings, sanctuary auras, iron skin glows) are skipped entirely. Combat-critical effects like firebolt and frost nova still play. Desktop rendering is completely unaffected.
Impact
The combined effect is smoother frame rates across all devices, especially during heavy combat on large maps. GC pressure from object churn is eliminated, fog of war scales with visibility changes rather than total explored area, and mobile devices get a rendering budget tuned to their hardware. This completes Bundle 4 of the 9-bundle performance plan.
Try the EchoQuest Demo — free in your browser. Full game coming to Steam.