-
Notifications
You must be signed in to change notification settings - Fork 1
SparkGame Module Status
Audience: Programmers | Mixed
Thread Context: Game modules run on the main thread via
OnLoad/OnUpdate/OnRender. SparkConsole runs a background log-reader thread and communicates over named pipes (Windows) or stdin/stdout.Platform/Backend Scope: Game module DLLs target all backends through the RHI. SparkConsole IPC is Windows named pipes with a stdin/stdout fallback. SparkShaderCompiler emits D3D11/D3D12/Vulkan/OpenGL artifacts.
This page audits the example FPS game module, the standalone debug console, and the offline shader compiler.
Naming note: The original audit referred to the FPS game as
SparkGame. The repository has since split the modules —GameModules/SparkGame/is now a thin base module (Core only), and the full FPS arena game lives inGameModules/SparkGameFPS/. This page documentsSparkGameFPSas the FPS showcase. There are now ten game modules total (SparkGame, SparkGameFPS, SparkGameMMO, SparkGameRPG, SparkGameARPG, SparkGameRTS, SparkGameRacing, SparkGamePlatformer, SparkGameOpenWorld, SparkGameVisualScript).
- DLL entry point in
GameModules/SparkGameFPS/Source/Main.cpp(DllMain). - Factory exports:
CreateModule(),DestroyModule(),CreateGameModule(),DestroyGameModule(). - Engine loads via ModuleManager, calls
OnLoad(EngineContext),OnUpdate(),OnRender()each frame. - Module presents as the engine-showcase arena game.
-
Game.cpp~840 lines,Game.h~659 lines. This is a substantial reduction from the original audit's 2,042-lineGame.cpp— the game has been split into focused units:GameSetup.cpp,GameConsoleOps.cpp,GameEngineSystems.cpp,GameMechanics.cpp,GameMode.cpp. - Sets up camera, player, projectile pool, scene manager, vehicle system, gravity, interaction, game mode, HUD, inventory, quests.
- Full console integration (teleport, spawn, clear scene, time scale, etc.).
-
Player.h~795 lines,Player.cpp~1,081 lines. - Complete first-person controller: WASD movement, jumping, crouching, sprinting.
- Physics-based with gravity, friction, stamina.
- Full weapon system:
Fire(),Reload(),ChangeWeapon()with ammunition. - Health / armor / shield with damage reduction.
- Class system (Scout, Recon, Titan) with unique abilities (jetpack, cloak, energy shield) via
ClassSystem.cpp. - Console integration via
PlayerConsole.cpp(includes memory-integrity speed/jump validation guards).
-
HUDSystem.h/HUDSystem.cpp. - Health/armor/shield bars, ammo counter, multi-style crosshair with dynamic spread, damage indicators, kill feed, hit markers, low-health vignette, weapon-switch notifications, minimap with blips, interaction prompts, scoreboard, class indicators.
- 18 weapon types (Pistol, Rifle, Shotgun, Rocket Launcher, Sniper, SMG, etc.).
- Damage, fire rate, magazine, reload time, accuracy stats.
- Integrated with Player fire/reload and the projectile pool. Projectile types: Bullet, Rocket, Grenade with physics.
-
VehicleSystem.h/VehicleSystem.cpp(~1,009 lines). - Ground (Buggy, Tank, APC, Motorcycle, Truck) + aerial (Helicopter, Jet, Dropship, Drone).
- Multi-seat system (Driver / Gunner / Passenger).
- Vehicle physics (acceleration, steering, aerial stabilization).
- Vehicle weapons fire through the projectile pool; muzzle position from seat offset + vehicle rotation; weapon type maps to projectile type.
-
Enemy.cpp/Enemy.h: archetypes (Grunt, Guard, Scout, Heavy, Sniper, Medic). - Each enemy owns a behavior tree with combat/patrol/idle branches.
- Distance-based perception, blackboard-driven targeting.
-
WaveSpawner.cpp/WaveSpawner.h: escalating waves with difficulty scaling, boss rounds, rest periods. -
LootSystem.cpp: enemies drop loot on death. -
Gap (unchanged): no NavMesh pathfinding integration in the FPS module — a repository-wide search for
NavMesh/FindPath/PathfindunderGameModules/SparkGameFPS/Source/returns no hits. Enemies move directly toward targets rather than navigating the mesh.
-
LoadScene(),SaveScene(),GetAvailableScenes(), scene creation all implemented. - Full serialization/deserialization of game objects from
.scenefiles. - Gap: no dynamic level streaming inside the module.
-
SparkConsole/src/main.cppentry,ConsoleApp.h/.cpp. - Connects to SparkEngine via named pipes (Windows) or stdin/stdout.
- Real-time engine log display with color coding.
- Command input with auto-completion and history (arrow keys).
- Built-in commands: help, clear, history, alias, exit. Game commands forwarded to the engine over the pipe.
- Background thread for log reading.
Wiring reminder (from CLAUDE.md):
ConsoleProcessManagerlaunches the subprocess and owns the pipe; it must be initialized at engine startup withProcessCommands()called each frame.SimpleConsoleis the engine-side log sink only.
-
SparkShaderCompiler/src/main.cpp. - Single-file and batch modes (e.g.
SparkShaderCompiler BasicVS.hlsl -stage vertex -backend d3d11 -o BasicVS.cso;-batch Shaders/ -backend vulkan). - Stages: vertex, pixel, geometry, hull, domain, compute.
- Backends: D3D11, D3D12, Vulkan, OpenGL.
- Preprocessor defines, include paths, optimization, debug info, reflection output.
- Delegates to
Spark::RHI::CompileShader()for cross-platform compilation.
The original audit flagged four oversized FPS files. The picture has improved after the Game.cpp split:
| File | Current Lines |
.cpp/.h guideline |
Status |
|---|---|---|---|
Game.cpp |
~840 | ~500 (.cpp) |
Reduced from 2,042; still over but split into helper TUs |
Player.cpp |
~1,081 | ~500 | Still over guideline |
Player.h |
~795 | ~300 (.h) |
Still over guideline |
Game.h |
~659 | ~300 | Still over guideline |
VehicleSystem.cpp |
~1,009 | ~500 | Over guideline (one cohesive system) |
| Component | Functional % | Key Gap |
|---|---|---|
| Module loading (DLL) | 100% | None |
| Game loop | 90% | No dynamic level transitions |
| Player controller | 95% | Simple weapon models |
| HUD system | 100% | None |
| Weapons | 100% | None |
| Vehicles | 95% | Fully armed, all weapon types fire |
| AI / enemies | 95% | No NavMesh pathfinding (straight-line movement) |
| Level loading | 90% | No streaming |
| SparkConsole.exe | 100% | None |
| SparkShaderCompiler.exe | 100% | None |
Verdict: SparkGameFPS is a complete FPS arena game — enemies with behavior trees, wave spawning, vehicle weapons, loot, progression, and quests are all wired. Both standalone tools are fully functional.
- Original entry:
.claude/knowledge/sparkgame-module-status.md(last updated 2026-03-16; vehicle weapons noted 2026-04-01). - Verified against codebase 2026-06-08.
Status changes / verifications found during freshening:
-
Module renamed/split: the FPS game is now
GameModules/SparkGameFPS/(the originalSparkGameis a Core-only base module). Ten game modules now exist. -
Game.cppshrank from 2,042 to ~840 lines — split intoGameSetup.cpp,GameConsoleOps.cpp,GameEngineSystems.cpp,GameMechanics.cpp,GameMode.cpp. -
VehicleSystem.cppis ~1,009 lines, not the 10,000+ stated in the original (likely a typo) — capabilities otherwise as described. - NavMesh gap persists for FPS enemies (verified: no NavMesh/pathfind references in the FPS module source).
- SparkConsole and SparkShaderCompiler remain 100% functional.
Published from 8fd2c5bdc5cd. Edit the canonical source in wiki/.
- Documentation
- Docs route
- Wiki index
- Guides
- Tutorials
- Samples
- Examples
- API Reference
- API route
- Reference
- Build Guide
- Dependencies
- FAQ
- Changelog
- Roadmap
- Contributing
- Code of Conduct
- Home
- FAQ
- Getting Started
- Quick-Start Tutorial
- Making Your First Game
- Making Your First Multiplayer Game
- Artist Workflow Guide
- Editor Walkthrough
- Migration Guide
- How SparkEngine Works
- Architecture Overview
- Engine Architecture Flowchart
- Creating a Game Module
- Game Modules (catalog)
- Entity Component System
- Rendering and Graphics
- Physics
- Cloth Simulation
- Audio
- Input System
- Camera System
- Scripting with AngelScript
- Visual Scripting
- AI and Navigation
- Animation
- 2D Systems
- Networking
- Dedicated Server
- Multiplayer Quick Start
- Area Server Architecture
- Scene Management
- Large World Support
- Collaborative Editing
- Coroutine System
- Event System
- Event Response System
- Job System
- UI System
- UI Layout Extensions
- Localization
- Dialogue System
- Destruction System
- Replay System
- Achievement System
- Loading System
- Mod System
- Content Delivery
- Tween System
- Memory Integrity
- Gameplay Systems
- Terrain and Procedural Generation
- Save System
- Persistence System
- Day Night Cycle and Weather
- Cinematic Sequencer
- Runtime Prefabs
- SparkEditor
- Editor Tutorials
- SparkConsole
- SparkDaemon
- Shader Pipeline
- Asset Pipeline
- Asset Validation
- Asset Migration
- Game Packaging
- Online Services
- DataTable System
- Loot and Crafting System
- CSG System
- Font System
- Timer Manager
- Movie Render Pipeline
- HLOD and World Partition
- Remote Debug System
- Selection Manager
- Asset Dependency Graph
- Editor Automation
- File Watcher
- Project Templates
- System Requirements
- VR Support
- Mobile Platform
- Accessibility
- Platform Input
- Cross-Compilation: Wine Testing
- RHI Abstraction Layer
- D3D11 Backend
- D3D12 Backend
- Vulkan Backend
- OpenGL Backend
- Metal Backend
- DXR Raytracing
- Hybrid Ray Tracing
- Upscaling (DLSS/FSR)
- Render Graph
- Shader Graph
- GPU Particles
- GPU-Driven Rendering
- Volumetric Fog
- Volumetric Clouds
- Global Illumination
- Virtual Texturing
- Water Rendering
- Clustered Lighting
- Material System
- Post-Processing
- Shadow System
- Particle System
- Decal System
- Sky and Atmosphere
- Foliage System
- Mesh Shaders
- Neural Rendering
- Configuration Reference
- Performance Tips
- Benchmark Framework
- Threading Model
- Memory Safety
- Memory Management Patterns
- Build System and CMake Modules
- Profiler and Debugging
- Performance Profiling Guide
- Telemetry System
- Golden Image Testing
- Utilities
- Testing
- Codebase Statistics
- Codebase Health
- Error Handling Patterns
- Hot Reload Overview
- Troubleshooting
- Contributing
- Workflow Patterns
- Build Optimizations
- CI Reproducible Builds
- GitHub API and PR Checks
- Git Rebase Conflicts
- Clang-Format
- Code Quality Violations
- AI Bloat Pattern
- MinGW + Wine Cross-Compilation
- Live Editor Testing
- Engine & Renderer Landscape
- DuetOS Portability Catalog
- Five-Engine Analysis
- Eleven-Engine Analysis
- ThorVG / Unity Graphics Analysis
- Advanced Techniques Catalog
- Third-Party Library Evaluation
- Engine Viability Evaluation
- Engine Feature Recommendations
- Project Recommendations
- Mac Compatibility Analysis
- Codebase Observations
- Codebase Bloat Audit
- Test Suite Audit
- Documentation Coverage Audit
- ThirdParty Dependencies Audit
- Load Test Baseline
- Gameplay Systems Status
- SparkGame Module Status
- Stub and Abandoned Features
- Memory Integrity System
- Memory Safety Evaluation
- Hardware Acceleration Systems
- Jolt Physics Integration
- GPU/CPU Separation Plan
- Daemon Services Architecture
- Reflection & Polymorphism Refactoring Plan
- SparkBuild In-Tree
- Wine No-JobSystem Breakthrough
- Wine Role and Fallback Tiers