Skip to content

Latest commit

History

2,714 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Spark Engine

A C++23 open-source 3D game engine with a full RHI abstraction layer, ECS (EnTT), Jolt Physics, AngelScript scripting, and an ImGui-based editor. Originally built around first-person shooters, it now includes genre templates for RPGs, MMOs, RTS, racing, open-world, and platformers.

🌐 Website now live:sparkengine.dev

Build SparkEngineTest definitionsC++ lines of codeSource filesLicense: Spark OpenDiscord


Getting Started

SparkEngine is currently distributed as source. No versioned installer or prebuilt release has been published yet; the release-readiness gates remain authoritative. The in-tree installer documentation describes development and packaging workflows, not an available download.

Build from source:

git clone --recurse-submodules https://github.com/Krilliac/SparkEngine.git
cd SparkEngine
# Windows
.\generate.bat -g "Visual Studio 17 2022" release
.\build.ps1 -config Release -editor -angelscript
# Linux / macOS
./generate.sh release -g Ninja
./build.sh release

Visual Studio and Ninja Multi-Config builds keep binaries isolated under build/bin/<Config> (for example, build/bin/Release/SparkEditor.exe).

Requirements: MSVC 19.36+ / GCC 13+ / Clang 17+, CMake 3.25+.
See TROUBLESHOOTING.md for build issues.

Create a game module:

cmake --install build --prefix ~/SparkEngine-install
cp -r Templates/EmptyProject MyGame &&cd MyGame
cmake -B build -DCMAKE_PREFIX_PATH=~/SparkEngine-install
cmake --build build --config Release
./SparkEngine -game ./libMyGame.so

See Templates/README.md and SparkTemplates.


Editor

SparkEditor — Veyra Highlands region-map workflow

SparkEditor provides 65 dockable panels spanning scene construction, asset and shader workflows, profiling, multiplayer operations, collaboration, dedicated servers, world streaming, and live region design.

More screenshots
ScreenshotDescription
Editor overviewDocked scene, hierarchy, inspector, console, and asset-browser workspace
WelcomeWelcome screen and project setup
WindowsPanel layout — Scene, Inspector, Asset Browser, Shader Graph, Sequencer
GameObjectComponent editing and drag-drop
FPSFPS-specific tools — weapon editor, damage model, HUD builder

Live Template Showcase

These are direct 1904×1041 captures from the current SparkEngine runtime. Each project also ships with alternate wide and detail views under docs/images/model-pipeline.

First PersonThird PersonTop Down
FPS Starter live arenaThird Person Starter live portal courseTop Down Starter live combat arena
RPGMMOMultiplayer Arena
RPG Starter live villageMMO Starter live frontierMultiplayer Arena live map
PlatformerBlank 3DEmpty Project Runtime Preview
Platformer Kit live courseBlank 3D live material stageEmpty Project live origin preview
Full breadth and detail captures for every template
TemplateWide viewDetail view
FPS StarterFPS Starter wide arenaFPS Starter target detail
Third Person StarterThird Person Starter wide portal courseThird Person Starter portal detail
Top Down StarterTop Down Starter wide combat arenaTop Down Starter combat detail
RPG StarterRPG Starter wide villageRPG Starter village detail
MMO StarterMMO Starter wide frontierMMO Starter frontier detail
Multiplayer ArenaMultiplayer Arena wide mapMultiplayer Arena tactical detail
Platformer KitPlatformer Kit wide coursePlatformer Kit obstacle detail
Blank 3DBlank 3D wide material stageBlank 3D material detail
Empty ProjectEmpty Project wide runtime previewEmpty Project origin detail

Features

Rendering

Six backends via a shared RHI abstraction:

BackendStatus
DirectX 11Stable — primary Windows backend
DirectX 12Experimental — mesh shaders, DXR ray tracing, VRS
Vulkan 1.4Experimental — Linux and Windows
OpenGL 4.6Experimental — fallback on older hardware
MetalExperimental — macOS, in progress
NullRHIStable — headless / software rendering via llvmpipe

Render features include PBR materials, global illumination (DDGI, Adaptive Probe Volumes, hybrid ray tracing), forward/deferred/clustered render paths, cascaded shadow maps, GPU-driven rendering (compute frustum culling, indirect draw), virtual texturing, mesh shaders, DXR 1.1, FSR upscaling, and a 35-node Shader Graph. Post-processing covers bloom, HDR tone mapping (Reinhard/ACES/Uncharted 2), TAA, FXAA, MSAA, depth of field, motion blur, volumetric fog, lens flares, and light shafts.

Physics

Jolt Physics with rigid bodies (static/kinematic/dynamic), 15 collision shapes, 12 constraint types, raycasting, sphere/box overlap, shape casting, vehicles (wheeled/tracked), ragdolls, cloth, soft bodies, and destruction. Supports deterministic mode for replays and multiplayer.

Audio

XAudio2 3D spatial audio on Windows with Miniaudio cross-platform fallback. Distance attenuation, Doppler, pitch/volume control, master/SFX/music channels, and an object pool for source management.

Scripting

  • AngelScript — hot-reload via file watcher with state preservation, full engine API bindings, per-file module isolation, client/server context separation
  • Visual scripting — 60 node types across 8 categories, compiles to AngelScript (no runtime overhead)
  • Shader Graph — 35+ nodes, HLSL generation, live preview
  • Lua — engine bindings, Lua 5.3+ compatible

AI and Navigation

Behavior trees with blackboard, Recast/Detour NavMesh with dynamic obstacles, EQS for tactical point queries, steering behaviors (seek/flee/pursue/flock), perception (vision cones, hearing, threat memory), cover detection, formation movement, group coordination, and an AI budget limiter supporting 100+ simultaneous agents.

Networking

UDP client/server with entity replication, dirty property tracking, client-side prediction, server reconciliation, and lag compensation (hitbox rewinding, 1-second history). Message channels: Unreliable, Reliable, ReliableOrdered. Delta snapshot compression, network statistics (ping, jitter, packet loss, bandwidth). MMO-scale architecture: AreaServer + WorldServer, entity migration across server instances, per-area session management, load balancing.

ECS and Gameplay

EnTT-backed ECS with 75+ component types. Includes: FPS weapons, damage model, HUD; vehicle physics; inventory, quests, achievements, dialogue trees; ability/cooldown/trigger system; destructible objects; replay record/playback; day/night cycle; weather; 2D/sprite rendering; tween system; async coroutine scheduler; save/load with ECS-aware serialization; async database-backed persistence.

Large worlds: seamless area streaming (no load screens), floating-point origin rebasing, 100K+ entities per area.

Editor (59 panels)

Scene hierarchy, Inspector, Asset browser, Game viewport, Gizmos (ImGuizmo), Node graphs (imnodes), Animation timeline, Material editor, Visual script editor, Terrain editor, Weapon editor, Profiler, AI debugger, Physics debug overlay, Cinematic sequencer, Dialogue editor, Ability/condition editors, Destruction editor, 2D/tilemap editors, Audio mixer, Replay panel, Save system panel, Dedicated server panel, Version control integration, Build/deployment pipeline, Level streaming, Command palette (Ctrl+P), Prefab system, Event monitor, Coroutine debugger, Collaboration panel (multi-user with node locking and presence), and more. Supports collaborative multi-user editing, full undo/redo, play-mode editing, and a plugin system.

Game Module Templates

Nine complete project templates load as .dll/.so modules at runtime and build independently against the installed SDK:

TemplateHighlights
Empty ProjectClean authoring world plus an explicit runtime-origin preview
Blank 3DCamera controls, material studies, reusable primitive stage
FPS StarterWeapons, damage, ammo, crosshair, target range
Third Person StarterCharacter movement, pickups, portal objectives
Top Down StarterClick-to-move combat, enemies, arena objectives
RPG StarterVillage exploration, dialogue, quests, inventory, abilities
MMO StarterPlayer sessions, frontier objectives, area-ready gameplay
Platformer KitGravity, sprinting, jumping, hazards, checkpoints
Multiplayer ArenaTeams, scoring, sudden death, symmetric tactical cover

Quality Assurance

Tests: 6,843 test definitions across 572 files covering core utilities, ECS, physics, AI, animation, networking, gameplay, graphics, editor, and 50+ other subsystems.

cd build && ctest --output-on-failure
ctest -R "Physics" --output-on-failure # run a subset

Sanitizer CI jobs:

SuiteDetects
ASan + UBSan + LSanBuffer overflows, use-after-free, UB, memory leaks
TSanData races, deadlocks
MSanReads of uninitialized memory

Run locally:

cmake -B build-asan -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=ON \
-DCMAKE_CXX_FLAGS="-fsanitize=address,undefined -fno-omit-frame-pointer"
cmake --build build-asan && ./build-asan/bin/SparkTests

When a workflow uploads sanitizer or coverage results, they are available from that run on the GitHub Actions page. The primary Windows, Linux, and macOS lanes also retain granular JUnit XML, machine-readable JSON totals, runtime, and slow-test tables. CI rejects a missing, empty, malformed, failed, or suspiciously under-registered test run; the badge above remains explicitly source-definition based rather than claiming that every platform executed the same feature-gated cases.


Build Configuration

Key CMake options:

OptionDefaultDescription
ENABLE_GRAPHICSONRendering system
ENABLE_EDITORONImGui editor
ENABLE_NETWORKINGONUDP multiplayer
ENABLE_VULKANONVulkan backend
ENABLE_OPENGLONOpenGL backend
ENABLE_METALOFFMetal (macOS)
ENABLE_DXRONRay tracing
ENABLE_VROFFVR/AR
ENABLE_MOBILEOFFMobile features
BUILD_TESTSONTest suite
BUILD_GAME_MODULESON11 in-tree game modules
ENABLE_SERVER_PROCESSESONDedicated server, MMO gateway, daemon orchestration, and collaboration processes
ENABLE_ASSET_PIPELINE_TOOLSONDeterministic asset cooker and isolated worker
ENABLE_AUTOMATION_HOSTONBlack-box runtime automation and CI result host

Headless build (no GPU, no editor):

cmake -B build -DENABLE_EDITOR=OFF -DENABLE_GRAPHICS=OFF

System Requirements

MinimumRecommended
OSWindows 10 / Ubuntu 24.04 / macOS 12+Windows 11 / Ubuntu 24.04
CompilerMSVC 19.36, GCC 13, Clang 17MSVC 19.36+, GCC 13+, Clang 17+
C++C++23C++23
GPUAny DirectX 11 capableRTX 2080+ for ray tracing
RAM4 GB16 GB
Storage5 GB10 GB with all game modules
Build toolsCMake 3.25+CMake 3.25+, Ninja

Headless/server deployments use NullRHIDevice — no GPU required.

Platform support:

PlatformCompilerBackendStatus
Windows 10+MSVC v143 (VS 2022)DirectX 11Stable
WindowsMSVC v144 (VS 2026)DirectX 11/12Experimental
LinuxGCC 13+ / Clang 17+Vulkan/OpenGLExperimental, CI tested
macOSApple ClangMetalExperimental
HeadlessAnyNullRHIStable

Documentation

ResourceDescription
TROUBLESHOOTING.mdStartup issues, debug commands, common fixes
Feature RoadmapPlanned features
Project StatusSystem status, recent changes
API ReferenceAuto-generated symbol indexes, class hierarchy
Packaging GuideInstall layout, components, versioning
External Services & OrchestrationDedicated hosting, gateway, daemon supervision, and collaboration
Offline Cooking & AutomationDeterministic asset builds, workers, pak inspection, and runtime smoke tests
Stable Plugin ABIVersioned C plugin boundary, sidecar integrity, tasks, and hot reload
Game Module GuideBuilding standalone games with the SDK
Networking ConfigUDP, replication, MMO server setup
Wiki144+ pages covering all subsystems
DeepWikiCommunity knowledge base

Architecture

Execution order: Physics → Animation → AI → Audio → Lifecycle → Render

SparkEngine/
├── SparkEngine/Source/
│ ├── Core/ Platform.h, EngineContext.h
│ ├── Graphics/ RHI (6 backends), RenderGraph, GI
│ └── Engine/
│ ├── ECS/ 75+ component types
│ ├── AI/ BehaviorTree, NavMesh, EQS
│ ├── Animation/ Skeletal, IK, Sequencer
│ ├── Networking/ UDP, Area/World Servers
│ ├── Scripting/ AngelScript, Visual Scripting
│ ├── Gameplay/ Weapons, Quests, Inventory
│ └── 20+ other systems
├── SparkEditor/Source/ 59 dockable panels, collaboration
├── SparkConsole/src/ Standalone debug console
├── GameModules/ 11 prebuilt game modules
├── Tests/ 6,843 test definitions, 572 files
├── wiki/ 144+ wiki pages
└── docs/ API reference, guides

Contributing

  1. Fork the repository and create a feature branch
  2. Follow the coding standards in CLAUDE.md — C++23, zero warnings, RAII, const-correct
  3. Add tests for new functionality
  4. Run clang-format (enforced in CI) and ensure all tests pass
  5. Open a pull request — one feature per PR

Questions and bug reports: GitHub Issues
Discussion: Discord
Documentation: Wiki

Thanks to the Jolt Physics, Dear ImGui, EnTT, Khronos (Vulkan/OpenGL), and AngelScript teams.


License

Spark Open License 1.0 — no royalties, no fees, use for any purpose (commercial or otherwise), modify and redistribute freely.

This project makes use of AI-assisted development. All AI-generated code is reviewed and tested before merging.

About

A free, open-source C++23 3D game engine for FPS and beyond — DirectX 12, Vulkan, Jolt Physics, ECS, ImGui editor, AngelScript scripting

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

27 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages