[Major Feature] WebAssembly/Emscripten build target for browser deployment #158
Labels
No Label
Alpha Release Requirement
Bugfix
Demo Target
Documentation
Major Feature
Minor Feature
priority:tier1-active
priority:tier2-foundation
priority:tier3-future
Refactoring & Cleanup
system:animation
system:documentation
system:grid
system:input
system:performance
system:python-binding
system:rendering
system:ui-hierarchy
Tiny Feature
workflow:blocked
workflow:needs-benchmark
workflow:needs-documentation
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Depends on
Reference: john/McRogueFace#158
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Vision
Compile McRogueFace to WebAssembly, enabling:
Dependency Analysis
Major Technical Hurdles
1. SFML Replacement Required
SFML explicitly declined Emscripten support for 3.x (deferred to 4.x with potential Vulkan backend).
Options:
2. Game Loop Architecture Change
Browsers require cooperative multitasking — no blocking
while(true)loops.Requires refactoring
GameEngine::run()to support both models.3. Python-in-WASM Integration
CPython compiles to WASM (PEP 776, build guide), but with limitations:
Key concerns:
McRFPy_API) needs adaptation4. Filesystem Virtualization
All file I/O must go through Emscripten's virtual filesystem:
--preload-fileor asyncfetch()scripts/directory bundled into WASMfopen()becomes async or pre-bundled5. Asset Loading & Binary Size
Requires asset optimization strategy (lazy loading, compression, LOD).
Implementation Strategy
Phase 1: Renderer Abstraction (see #157)
Create
RenderBackendinterface that decouples from SFML:SFMLBackend— current desktop implementationSoftwareBackend— for true headless (#157)VRSFMLBackendorSMKBackend— for WASMThis is shared prerequisite work with #157.
Phase 2: VRSFML Evaluation
Phase 3: Python-in-WASM Prototype
McRFPy_APIbinding approach worksPhase 4: Game Loop Refactor
emscripten_set_main_loopPhase 5: Asset Pipeline
Phase 6: Build System
Relationship to Other Work
Scope Assessment
This is a v2.0+ project requiring:
The renderer abstraction work (#157) is the highest-leverage first step — it unblocks both headless and WASM paths.
References