Shipping Ella's World: Live 3D Crystal Cavern Multiplayer Raids & Retro Pixel Pets

Generating clean 3D meshes and crisp 16-bit sprite loops in an offline studio pipeline is only half the battle—turning those raw files into a responsive, multiplayer browser experience without dropping WebRTC voice calls, leaking GPU memory, or snagging players on stair edges requires deliberate runtime engineering. Following our 72-hour Blender 5.2 and Retro Diffusion R&D sprint, we mounted every generated dungeon room, rigged boss clip, and pixel-art animation directly into Ella's Starlight Glam Plaza (/ella-world): expanding the sunny hangout island with a subterranean Crystal Cavern Dungeon Wing, a co-op Server-Sent Events (SSE) Starlight Crystal Guardian encounter, floating nearest-neighbor pixel shoulder pets, and equippable 3D Glam Closet relics.

Ella's World live expansion collage showing the Crystal Cavern octagonal boss crest, nearest-neighbor Wizard Cat and Emerald Dragon pixel sprites, and four rigged Starlight Crystal Guardian animation poses
Live runtime assets now active inside /ella-world: the subterranean Crystal Cavern octagonal boss crest (top left), 16-bit Retro Diffusion sprite frames locked to nearest-neighbor filtering (top right), and the four rigged Starlight Crystal Guardian NLA clips—Boss_Idle, Boss_Walk, Boss_Slam_Attack, and Boss_Defeat (bottom).

1. One Shared World Space: Mounting a Subterranean Dungeon Without Reloading WebRTC

In browser hangout worlds where friends are already connected over peer-to-peer WebRTC voice chat and an active Server-Sent Events stream, navigating to a separate URL for an indoor dungeon tears down audio tracks, resets avatar state, and fragments the party. Instead of splitting the dungeon into a second page, we mounted crystal_cavern_arena.glb (868 KB, 16,856 triangles) inside the same Three.js scene graph at world offset CAVERN_OFFSET = { x: 72, y: 0, z: 20 }—well clear of the sunny 84m × 84m Plaza island centered at the origin.

On the Express backend (src/routes/ellaWorldRoutes.ts), we widened multiplayer position clamping from Plaza-only bounds to [-140, 140] across both X and Z axes so players exploring the cavern foyer, side vaults, octagonal boss floor, and northern Crown Sanctum broadcast full-precision coordinates to friends without truncation. Players can cross between the outdoor plaza and the subterranean wing in three ways: walking through the glowing East Plaza Crystal Portal Arch at (x = 28, z = 18), clicking the 💎 Cavern warp pill in the top HUD, or pressing the G keyboard shortcut—with a matching Return Starlight Portal inside the cavern foyer at (x = 72, z = 24.6).

Architecture diagram of Ella's World unified Plaza-to-Cavern coordinate space, 64-box collider solver, minimum-penetration push-out, and subterranean fog transition
Unified coordinate topology and BlockyWorld3D capsule physics: portal warps translate avatars to (72, 0, 20) inside a single WebGL context while smoothly interpolating sky colors, fog density, ceiling camera height, and 64 axis-aligned collision volumes.

Minimum-Penetration AABB Push-Out and Automatic Stair Step-Up

Whereas the outdoor plaza relies primarily on flat platform tops and elevated sky-obby pads, an enclosed dungeon requires solid perimeter walls, structural columns, doorways with 2.75m vertical clearance, and multi-tread stairs leading up to the Crown Sanctum dais. When headless Blender compiled crystal_cavern_arena.glb, it simultaneously emitted crystal_cavern_arena.colliders.json containing 64 right-handed +Y Up axis-aligned bounding boxes tagged by semantic role (floor, stair, wall, pillar, and prop).

Inside BlockyWorld3D (public/ella-world/js/world3d.js), we extended the 60 Hz character controller for a 1.80m-tall, 0.30m-radius player capsule across three coordinated passes:

  • Minimum-Penetration Horizontal Push-Out: Whenever a player's XZ capsule overlaps a wall, pillar, or solid prop volume whose vertical span intersects the body, the solver computes penetration depth along all four cardinal faces and resolves exclusively along the shallowest axis—allowing avatars to slide smoothly along angled pillars and doorway jambs without corner jitter.
  • Seamless Stair Tread Step-Up: When approaching a stair collider whose top surface sits within 0.48m above the player's current foot height, vertical support automatically elevates onto the tread without requiring manual jumps, making the northern sanctum ascent effortless during active boss movement.
  • Subterranean Atmosphere & Ceiling Camera Clamping: Crossing into the cavern interpolates scene background and exponential fog from bright daytime sky (#7dd3fc / #bae6fd) into deep amethyst-indigo cavern shadow (#0c0a1d / #1e1b4b), while clamping the third-person orbit camera below the 4.2m stone ceiling beams so geometry never occludes the player's view.

2. Co-Op Starlight Crystal Guardian Raids Over Server-Sent Events

At the center of the octagonal starlight crest stands the Starlight Crystal Guardian (starlight_crystal_guardian.glb, 2.5 MB, 10,958 triangles, 23 deform bones with zero unweighted vertices). Rather than building a punishing combat system with complex weapon hitboxes, we designed an approachable, kid-friendly obby-raid encounter built around timing, movement, and teamwork.

System diagram of Ella's World co-op Guardian SSE state machine, 4 Starlight Rune Pads, shockwave jump check, and nearest-neighbor pixel shoulder pets
Multiplayer encounter loop and sprite companion pipeline: POST /api/ella-world/cavern coordinates shared shield HP and rune cooldowns over SSE while THREE.AnimationMixer drives rigged boss actions and THREE.NearestFilter renders crisp 16-bit shoulder pets.

Shared Shield Authority, Rune Pads, and Shockwave Jump Telegraphing

To keep every connected friend synchronized without writing high-frequency combat churn to disk, the server maintains an authoritative in-memory memCavernRaidState object exposed via GET /api/ella-world/meta and mutated through POST /api/ella-world/cavern:

  • Four Starlight Rune Pads (rune_nw, rune_ne, rune_sw, rune_se): Positioned around the octagonal crest perimeter, each glowing cyan rune pad triggers a vertical starlight beam when stepped on, depleting 25 points from the Guardian's 100 HP crystal shield and entering an 8-second per-pad recharge cooldown so one player cannot stand motionless on a single pad.
  • Expanding Purple Shockwave Rings (Boss_Slam_Attack): Every 5.6 seconds while patrolling, the Guardian turns smoothly toward nearby challengers, cross-fades its THREE.AnimationMixer into Boss_Slam_Attack, and launches an expanding violet shockwave ring across the arena floor at 6.4 m/s out to an 11.6m radius. Players who jump (Spacebar, clearing y > 0.35m above the floor) soar cleanly over the ring; grounded players caught in the wave experience a gentle radial knockback impulse.
  • Victory Sequence & Instant Rematches: Dropping the shield from 100 to 0 transitions bossState to defeated, cross-fades the Guardian into its kneeling Boss_Defeat NLA clip, illuminates the golden Crown Sanctum beacon, bursts celebration confetti, awards +5 bonus Starlight Coins, and broadcasts a party chat announcement naming the player who struck the final rune—with a one-click Rematch button ready whenever the group wants another round.

3. Rendering 16-Bit Retro Diffusion Shoulder Pets Inside 3D WebGL

One of our favorite visual contrasts in this update is pairing smooth, stylized 3D Dress-to-Impress avatars with authentic 16-bit pixel-art companions generated by our local 4 GB GPU Retro Diffusion LoRA and K-Centroid pixelizer. By default, WebGL trilinear mipmapping blurs low-resolution pixel art into soft smudges the moment a billboard scales in perspective.

Animated 6-panel Retro Diffusion pixel sprite showcase featuring Wizard Cat, Baby Emerald Dragon, Mini Crystal Guardian, Arcane Swiftness Potion, Cyber Sentinel Helmet, and Starlight Coin
All six palette-locked pixel animations brought into /ella-world: four equippable floating shoulder companions (Wizard Cat, Baby Emerald Dragon, Mini Guardian, and Cyber Sentinel) plus interactive world pickups (Arcane Swiftness Potion and Starlight Coin).

Zero-Blur UV Strip Stepping & Promise-Deduplicated VRAM Caching

To preserve razor-sharp pixel edges at every camera distance while keeping memory overhead negligible when ten friends stand on the same fashion runway, createCrispPixelStripTexture() in world3d.js enforces three WebGL texture rules:

  1. Strict Nearest-Neighbor Filtering: Every sprite strip sets magFilter = THREE.NearestFilter, minFilter = THREE.NearestFilter, generateMipmaps = false, and SRGBColorSpace, guaranteeing crisp square texels with zero mipmap bleeding.
  2. Dynamic Frame-Count UV Windowing: Horizontal sprite sheets arrive as either 4-frame spin/bubble strips (1024×256, 3.8–4.6 KB PNGs) or 6-frame ping-pong character strips (1536×256, 5.9–12.4 KB PNGs). The loader inspects img.naturalWidth / img.naturalHeight on load, sets tex.repeat.set(1 / frameCount, 1), and advances tex.offset.x = frameIndex / frameCount at 7.5 fps while floating beside the avatar's left shoulder on a gentle sinusoidal hover curve.
  3. Two-Tier Singleton Image Deduplication: Concurrent calls to loadPixelStripImage() share a single in-flight Promise (pixelImagePromises) and decoded HTMLImageElement cache (pixelImageCache), preventing duplicate HTTP downloads or dynamic canvas allocations inside the render loop.
Expansion System Runtime Asset / Endpoint Footprint & Geometry Gameplay & Technical Role
Crystal Cavern Wing crystal_cavern_arena.glb + .colliders.json 868 KB · 16,856 tris · 64 AABBs Subterranean dungeon at (72, 0, 20) with wall push-out & <= 0.48m stair step-up.
Starlight Guardian Raid starlight_crystal_guardian.glb + /api/ella-world/cavern 2.5 MB · 10,958 tris · 23 bones · 4 clips SSE-synced 100 HP shield, 4 Rune Pads (8s cooldown), and jumpable shockwave rings.
Pixel Shoulder Pets wizard_cat, emerald_dragon, crystal_guardian, cyber_helmet 3.8–12.4 KB PNG strips (256×256 frames) THREE.NearestFilter UV-stepped 3D billboards synced via /api/ella-world/avatar.
Pickups & Vault Buffs starlight_coin (8 spots) & arcane_potion 4.1–4.6 KB PNG strips + HUD GIF pills Collectible Plaza/Obby/Cavern coins + East Vault 25s speed (+34%) & jump boost.
3D Cavern Relics obsidian_crown, prism_wings, guardian_aura Procedural & rigged attachment groups Equippable Glam Closet Tab 6 rewards + 💎 Crystal Cavern Guardian runway theme.

4. Glam Salon Closet Expansion, Modern Accessible UI, and Automated Verification

Every dungeon reward feeds right back into the social heart of Ella's World—the Dress-to-Impress fashion runway and Glam Salon Closet. Opening the closet now reveals a dedicated sixth tab (🐾 Pets & Relics) alongside a one-click Cavern Champion signature preset (crystal_guardian_queen) and a new 💎 Crystal Cavern Guardian runway judging theme. Players can mix any of the four pixel shoulder companions and three 3D Cavern Relics (Obsidian Sanctum Crown, animated flapping Prism Crystal Wings, and orbiting Starlight Crystal Shards) with both Stylized 3D rigged outfits and Classic Blocky avatars.

On the frontend HTML and CSS layer (public/ella-world/index.html and css/styles.css), we built the raid HUD and closet tabs using modern native browser primitives: the Guardian's shield bar uses a semantic <progress id="guardian-shield-progress" max="100"> element with separate cross-browser ::-webkit-progress-value and ::-moz-progress-bar rules so assistive technologies announce live shield percentages naturally, while inactive Glam Closet tab panels use hidden="until-found" with aria-selected roving tab state.

End-to-End Verification Receipt: Prior to zero-downtime Blue/Green deployment on webdesigner.la, we expanded src/routes/__tests__/ellaWorldRoutes.test.ts to 14 integration tests verifying backward-compatible avatar persistence, widened [-140, 140] coordinate broadcasts, full 4-rune multiplayer shield depletion, per-rune cooldown enforcement, victory coin bonuses, rematch resets, and binary .glb / collider / sprite asset integrity—passing all core platform and 130-domain snapshot gates cleanly.