Skip to content

SparkGame Module Status

github-actions[bot] edited this page Aug 23, 2026 · 1 revision

SparkGame Module & Tools 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.

Overview

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 in GameModules/SparkGameFPS/. This page documents SparkGameFPS as the FPS showcase. There are now ten game modules total (SparkGame, SparkGameFPS, SparkGameMMO, SparkGameRPG, SparkGameARPG, SparkGameRTS, SparkGameRacing, SparkGamePlatformer, SparkGameOpenWorld, SparkGameVisualScript).

SparkGameFPS — Example FPS Game Module

Module Loading: Working (100%)

  • 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 / Game.h: Functional

  • Game.cpp ~840 lines, Game.h ~659 lines. This is a substantial reduction from the original audit's 2,042-line Game.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.cpp / Player.h: Functional (95%)

  • 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).

HUD System: Functional (100%)

  • 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.

Weapons: Functional (100%)

  • 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.

Vehicles: Functional (95%)

  • 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.

AI / Enemies: Functional (95%)

  • 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/Pathfind under GameModules/SparkGameFPS/Source/ returns no hits. Enemies move directly toward targets rather than navigating the mesh.

Level Loading: Functional (90%)

  • LoadScene(), SaveScene(), GetAvailableScenes(), scene creation all implemented.
  • Full serialization/deserialization of game objects from .scene files.
  • Gap: no dynamic level streaming inside the module.

SparkConsole — Standalone Debug Console: Working (100%)

  • SparkConsole/src/main.cpp entry, 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): ConsoleProcessManager launches the subprocess and owns the pipe; it must be initialized at engine startup with ProcessCommands() called each frame. SimpleConsole is the engine-side log sink only.

SparkShaderCompiler — Offline Shader Tool: Working (100%)

  • 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.

Anti-Bloat Status

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)

Summary

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.

Source & Freshness

  • 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 original SparkGame is a Core-only base module). Ten game modules now exist.
  • Game.cpp shrank from 2,042 to ~840 lines — split into GameSetup.cpp, GameConsoleOps.cpp, GameEngineSystems.cpp, GameMechanics.cpp, GameMode.cpp.
  • VehicleSystem.cpp is ~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.

Related Pages

SparkEngine Wiki

Website Entry Points

Getting Started

Engine Subsystems

Gameplay & Tools

Platform Support

Graphics

Advanced

Development & Process

Research & Analysis

Engineering Notes & Audits

Specifications

Reference

Clone this wiki locally