Repository navigation
Troubleshooting
Common issues and solutions when building and running SparkEngine, organized by subsystem.
Test SparkConsole Standalone
cd build\bin
SparkConsole.exeExpected: "Spark Engine Console v1.0.0" banner. Try diag, help, status. Type exit to quit.
cd build\bin
SparkEngine.exeExpected:
- DirectX 11 window appears (blue background)
- SparkConsole window opens automatically
- Console shows initialization messages:
[INFO] SparkConsole system initialized [INFO] External console connection established [INFO] All engine systems initialized - Console commands respond:
help,engine_status,fps,graphics_info
Run these commands in the console to verify all subsystems:
diag # Full system diagnostic
engine_status # Overall engine health
fps # Frame rate check
graphics_info # GPU and DirectX info
audio_info # Audio system status
physics_info # Physics system status
memory_info # Memory usage
profile_report # Performance breakdown
Symptom: CMake errors about missing directories or empty third-party folders.
git submodule sync
git submodule init
git submodule update --recursiveIf submodules are corrupted, remove and re-clone:
rm -rf ThirdParty/JoltPhysics ThirdParty/entt ThirdParty/imgui
git submodule update --init --recursive --forceSymptom: Linker errors like LNK2038: mismatch detected for 'RuntimeLibrary'.
SparkEngine uses /MD (dynamic CRT). If third-party libraries were built with /MT, you get linker errors. Clean rebuild:
rmdir /s /q build
cmake -B build -G "Visual Studio 17 2022" -A x64
cmake --build build --config ReleaseSymptom: CMake Error: CMAKE_CXX_STANDARD is set to 20, but...
SparkEngine requires CMake 3.16+. Check your version:
cmake --versionSymptom: Compilation errors on std::expected, std::print, deducing this, or if consteval.
Ensure your compiler supports C++23:
| Compiler | Minimum Version |
|---|---|
| MSVC | Visual Studio 2022 17.6+ (v143, _MSC_VER >= 1936) |
| GCC | Version 13 |
| Clang | Version 17 |
Symptom: CMake error like include could not find requested file: SparkEngineTargets.cmake when configuring a standalone game project.
Cause: SparkEngineConfig.cmake exists but companion files (SparkEngineTargets.cmake, SparkGameModule.cmake) are missing -- typically from an interrupted install or pointing at a build tree instead of an install prefix.
Solution: Re-run the install step and reconfigure:
cmake --install <build-dir> --prefix <install-prefix>
cmake -B build -DCMAKE_PREFIX_PATH=<install-prefix>Tip: Include SparkEnginePreflight.cmake in your project (before find_package) for automatic detection. See Build System and CMake Modules.
Symptom: CI check-format job fails with formatting errors.
Solution: Run clang-format locally before committing:
# Check for issues
find SparkEngine/Source GameModules SparkEditor/Source SparkConsole/src SparkShaderCompiler/src \
SparkBuild/src SparkInstaller/src SparkDaemon/src SparkServer/src SparkGateway/src \
SparkCooker/src SparkWorker/src SparkAutomation/src SparkLauncher/src Tests \
-not -path '*/Metal/*' \( -name '*.h' -o -name '*.hpp' -o -name '*.cpp' \) \
| xargs clang-format --dry-run --Werror 2>&1
# Auto-fix
find SparkEngine/Source GameModules SparkEditor/Source SparkConsole/src SparkShaderCompiler/src \
SparkBuild/src SparkInstaller/src SparkDaemon/src SparkServer/src SparkGateway/src \
SparkCooker/src SparkWorker/src SparkAutomation/src SparkLauncher/src Tests \
-not -path '*/Metal/*' \( -name '*.h' -o -name '*.hpp' -o -name '*.cpp' \) \
| xargs clang-format -iSymptom: fatal error: d3d11.h: No such file or directory or similar DirectX headers.
Cause: Linux builds use stub headers from Core/Platform.h. Ensure you are not including Windows-only headers outside #ifdef SPARK_PLATFORM_WINDOWS guards.
Solution: Check that all DirectX includes are wrapped:
#ifdef SPARK_PLATFORM_WINDOWS
#include <d3d11.h>
#include <xaudio2.h>
#endifSymptom: Build fails with warnings treated as errors on Windows but not Linux.
Common MSVC-specific warnings and fixes:
| Warning | Meaning | Fix |
|---|---|---|
C4244 |
Narrowing conversion | Add explicit cast: static_cast<float>(value)
|
C4267 |
size_t to int conversion |
Use static_cast<int>(container.size())
|
C4100 |
Unreferenced parameter | Use [[maybe_unused]] or (void)param;
|
C4189 |
Unused local variable | Remove or use the variable |
C4458 |
Member hides class member | Rename local or use this->
|
Cause: Graphics initialization failure or missing DirectX runtime.
Diagnostic steps:
- Run
dxdiagto verify DirectX 11 support - Update graphics drivers to latest version
- Check Visual Studio Output window for assertion failures
- Try running as administrator
- Check for missing DLLs with Dependency Walker or
dumpbin /dependents SparkEngine.exe
Common assertions:
| Assertion | Cause | Fix |
|---|---|---|
D3D11CreateDevice failed |
No DirectX 11 GPU | Update drivers or use software adapter |
CreateSwapChain failed |
Invalid window handle | Check window creation code |
CompileShader failed |
Missing shader files | Verify Shaders/ directory exists |
Cause: SparkEngine failed to launch or crashed during startup, so the named pipe connection was never established.
Solutions:
- Check Visual Studio Output window for errors
- Verify both executables are in
build\bin\ - Run from Visual Studio with debugger attached
- Check Windows Event Viewer for crash details
Cause: Missing build output or incomplete build.
cmake --build build --config Debug
dir build\bin\*.exeBoth SparkEngine.exe and SparkConsole.exe must exist in build\bin\.
- Run
engine_statusto check system initialization - Verify the main engine loop is running (CPU usage should be active, not 0%)
- Check debug output for errors
- Try
diagfor a full diagnostic dump
Cause: Shaders failed to compile or render target not cleared.
Solutions:
- Check console for shader compilation errors:
graphics_info - Verify
Shaders/directory contains.hlslfiles - Check that the swap chain present is being called: look for
[ERROR] Present failedin logs - Try a debug build for more verbose DirectX error messages
Diagnostic: Run fps and profile_report in console.
| Profile Category | Normal Range | If Too High |
|---|---|---|
| Render | 2-8 ms | Reduce draw calls, simplify shaders |
| Physics | 0.5-3 ms | Reduce collision bodies, simplify meshes |
| Animation | 0.1-1 ms | Reduce animated entities, lower bone counts |
| AI | 0.1-2 ms | Reduce AI agents, simplify behavior trees |
| Audio | 0.05-0.5 ms | Reduce active audio sources |
Symptom: [ERROR] Failed to compile shader: <name> in console.
Solutions:
- Verify shader model compatibility with your GPU
- Check for syntax errors in
.hlslfiles - On MSVC, ensure the Windows SDK is installed (provides
d3dcompiler.h) - Use
graphics_infoto check supported shader model version
Cause: PhysicsSystem must run on the main thread only.
Checklist:
- Verify the Jolt dependency configured successfully and physics initialized
- Check that
PhysicsSystem::Update()is called each frame - Ensure physics bodies are properly registered with the system
- Check console:
physics_info
Cause: Collision mesh mismatch or time step too large.
Solutions:
- Verify floor has a static rigid body with collision shape
- Check that the collision margin is not too large
- Use fixed time step for physics: typically 1/60s
- Enable continuous collision detection for fast-moving objects
Symptom: Frame time spikes in profile_report under Physics.
Solutions:
- Reduce number of active rigid bodies (deactivate distant objects)
- Use simpler collision shapes (box/sphere instead of mesh)
- Increase the physics sleep threshold so resting objects deactivate sooner
Diagnostic: Run audio_info in console.
Checklist:
- Verify
AudioEngine::Initialize()was called successfully - Check master volume is not 0:
audio_master 1.0 - Verify sound files are loaded:
audio_list - Check system audio output device
- On Linux, verify OpenAL Soft is installed:
apt install libopenal-dev
Cause: Listener position or orientation not being updated.
Solution: Ensure these are called each frame:
audio.SetListenerPosition(cameraPosition);
audio.SetListenerOrientation(cameraForward, cameraUp);Cause: Too many simultaneous audio sources or audio thread contention.
Solutions:
- Check active source count:
audio_sources - Reduce
maxSourcesif memory is constrained - Ensure
AudioEngine::Update()is called every frame - Lower the audio quality or sample rate for non-critical sounds
Cause: Both tracks briefly playing at full volume.
Solution: Ensure MusicManager::Update(deltaTime) is called every frame so crossfade progress is updated smoothly.
Checklist:
- Verify the AI/navigation sources are present in the configured engine target
- Check that NavMesh is generated for the scene
- Verify agents have valid start/target positions on the NavMesh
- Run
ai_statusin console
Cause: Scene geometry not suitable for navmesh generation.
Solutions:
- Ensure floor meshes are marked as walkable
- Check that agent radius and height are appropriate for the geometry
- Verify the navmesh baking area covers the playable region
Cause: Tree root node not returning Running status.
Solutions:
- Check that the behavior tree is assigned to the entity
- Verify node connections in the tree
- Enable AI debug visualization:
ai_debug_draw true
Checklist:
- Verify the animation sources are present in the configured engine target
- Check that the animation clip is loaded and assigned
- Verify the skeleton bone hierarchy matches the mesh
- Check animation state machine transitions
Cause: Incorrect interpolation or missing keyframes.
Solutions:
- Verify animation frame rate matches expected rate
- Check for duplicate bone names in the skeleton
- Ensure animation blending weights sum to 1.0
Symptom: world.GetComponent<T>(entity) returns null or crashes.
Solutions:
- Verify the component was added with
world.AddComponent<T>(entity) - Check that the entity is still alive (not destroyed)
- Ensure you are using the correct entity ID (not a stale reference)
Symptom: Systems read stale data from other systems.
The ECS execution order is: Physics -> Animation -> AI -> Audio -> Lifecycle -> Render
If your custom system needs data from another system, ensure it runs after that system in the pipeline.
Cause: Networking is disabled by default.
Solution: Enable in CMake:
cmake -B build -DENABLE_NETWORKING=ON ...Checklist:
- Verify server is running and listening on the expected port
- Check firewall settings
- Verify IP address and port configuration
- Check console:
net_status
Cause: Panel initialization order or missing subsystem.
Solutions:
- Verify
ENABLE_EDITORis ON in CMake - Check that all 22 editor subsystems initialized:
editor_status - Reset panel layout:
editor_reset_layout
Cause: Scene file corruption or missing asset references.
Solutions:
- Check the scene JSON for syntax errors
- Verify all referenced assets exist on disk
- Try loading a known-good scene first
- Check console output for the specific error
Once SparkConsole is connected, these commands are available for diagnosing issues:
| Command | Description |
|---|---|
help |
List all available commands |
engine_status |
Check overall system status |
diag |
Full diagnostic dump |
fps |
Show current frame rate |
frame_time |
Detailed frame time analysis |
profile_report |
Performance breakdown by system |
| Command | Description |
|---|---|
graphics_info |
GPU info, DirectX version, resolution |
render_stats |
Draw calls, triangles, textures |
wireframe_toggle |
Toggle wireframe rendering |
| Command | Description |
|---|---|
audio_info |
Audio system status and metrics |
audio_master <vol> |
Set master volume (0.0-1.0) |
audio_sfx <vol> |
Set SFX volume |
audio_music <vol> |
Set music volume |
audio_play <name> |
Play a loaded sound |
audio_stop_all |
Stop all playing sounds |
audio_list |
List all loaded sounds |
audio_sources |
Show active audio source count |
| Command | Description |
|---|---|
memory_info |
Current memory usage by category |
memory_dump |
Detailed allocation dump |
| Command | Description |
|---|---|
physics_info |
Physics system status |
physics_debug |
Toggle physics debug visualization |
| Command | Description |
|---|---|
ai_status |
AI system status and agent count |
ai_debug_draw <bool> |
Toggle AI debug visualization |
| Command | Description |
|---|---|
dialogue_status |
Dialogue system state |
dialogue_trees |
List loaded dialogue trees |
For the engine to run correctly, these files must be present in build/bin/:
| File | Purpose |
|---|---|
SparkEngine.exe |
Main engine executable |
SparkConsole.exe |
Debug console |
SparkGame.dll |
Default game module |
And these directories should be present:
-
Shaders/-- Compiled shader bytecode -
Assets/-- Game assets (textures, models, audio) -
Data/-- Data files (dialogue JSON, scene files)
| Issue | Solution |
|---|---|
| Missing Visual C++ Redistributable | Install from Microsoft |
| DirectX 11 not available | Update GPU drivers or use WARP adapter |
| Named pipes permission denied | Run as administrator or adjust pipe ACLs |
| Antivirus blocking executables | Add build directory to exclusion list |
| Windows Defender slow builds | Exclude build/ from real-time scanning |
| Issue | Solution |
|---|---|
| SparkEditor not available | Editor is Windows-only; use console for Linux |
| SparkConsole uses stdout | Expected behavior; named pipes are Windows-only |
| OpenAL not found | sudo apt install libopenal-dev |
| Missing X11 headers | sudo apt install libx11-dev libxrandr-dev |
| Vulkan SDK missing | Install from LunarG Vulkan SDK |
GCC link errors with -lstdc++fs
|
Use GCC 11+ (filesystem is in libstdc++ proper) |
| Issue | Solution |
|---|---|
| Metal backend not implemented | macOS support is experimental |
| OpenAL deprecation warnings | Expected; SparkEngine uses OpenAL Soft, not Apple OpenAL |
| Code signing issues | Use codesign --force --deep -s - for local development |
-
Clean build:
rm -rf build cmake -B build -G "..." -DCMAKE_BUILD_TYPE=Debug cmake --build build -
Re-clone with submodules:
git clone --recurse-submodules https://github.com/Krilliac/SparkEngine.git
-
Try the minimal preset:
cmake --preset minimal cmake --build --preset minimal
-
Enable verbose logging:
# Set environment variable before running SPARK_LOG_LEVEL=TRACE ./build/bin/SparkEngine -
Check GitHub Issues for known problems.
-
File a new issue with:
- OS and compiler version
- CMake configuration output
- Full build log (if build failure)
- Console
diagoutput (if runtime failure) - Steps to reproduce
- Getting Started -- Build instructions
- Build System and CMake Modules -- Build configuration
- SparkConsole -- Debug console usage
- Rendering and Graphics -- Graphics troubleshooting and render pipelines
- Audio -- Audio system details
- AI and Navigation -- AI system details
- Entity Component System -- ECS architecture
- Physics -- Physics system details
Published from 2b03dc797148. 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
- Platform Certification
- 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
- Fuzz Policy and Parser Security
- Memory Safety
- Memory Management Patterns
- Build System and CMake Modules
- Profiler and Debugging
- Performance Profiling Guide
- Telemetry System
- Crash Reporting
- Golden Image Testing
- Utilities
- Testing
- Fuzz Policy and Parser Security
- 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