FRAGMENT: PROTOCOL — System Design & Architecture
1. Executive Summary
FRAGMENT: PROTOCOL is an in-browser 3D cybernetic roguelite inspired by Balatro and Slay the Spire. Built on Astro 5, PlayCanvas WebGL2 engine, and Bun runtime, it operates with zero external CDN dependencies, fully localized assets, and client-side code obfuscation.
2. Core Architectural Components
2.1 Procedural Map Generation Engine
The map generator produces 5-act directed acyclic graphs (DAGs) using Mulberry32 PRNG. Each act contains 15 tiers with path connectivity validated via depth-first search (PathValidator).
2.2 Protocol Tag Synergy Stacking Engine
Protocols grant active and passive passive bonuses across 8 protocol tags (THERMAL, EMP, VIRAL, VOID, KINETIC, CHAOS, UTILITY, PRIME). When threshold counts of 2, 4, or 6 matching tags are accumulated, synergy amplifiers trigger automatically.
3.3 Parry & Combat Finite State Machine
Player combat incorporates a frame-precise parry window (0.2s duration) that reflects damage, staggers enemies, and triggers time-dilation matrix slow-motion.
3. Data & Storage Pipeline
4. Key Performance Metrics & Limits
- Target Frame Budget: < 16.6ms (60 FPS on mid-tier integrated graphics).
- Audio Pipeline: WebAudio Oscillator Synthesizer (0 external MP3/WAV assets required).
- Obfuscation: AST transformation via
javascript-obfuscatorduringLOCAL_BUILD.