How antopilo/nuake works
Project Type & Purpose
• This is a boutique Quake-style game engine (“Nuake”) plus an integrated level editor.
• Core written in C++ (directory “Nuake”), an ImGui-based Editor in C++ (“Editor”) with a managed .NET bridge (“EditorNet”), and C#/.NET bindings for runtime scripting (“NuakeNet”).
• It embeds Wren and .NET runtimes for high-level scripting, uses an ECS, Jolt physics, PBR rendering, post-processing, navigation meshes, Quake map loading, audio, and asset conversion.
Key Components
a. Editor Layer
• Editor UI (ImGui) – “Editor/src” (Actions, Commands, Panels, Windows).
• EditorNet – .NET/C# bridge to talk to the engine via CORAL.
• Resource & FileSystem browser, Scene hierarchy, Inspector panels, Prefab editor, Settings windows.
b. Engine Core (“Nuake/src”)
• Application & LayerStack
• Core Subsystems – Rendering, Physics, Audio, UI, Scripting, FileSystem, Input, Logging, Threading.
• ECS – Scene manager, Entities, Components, Systems.
• Resource Manager – Model loading, Textures, Shaders, Materials, Prefabs, Assets serialization.
• Scripting – Wren & C# modules, NetRPC APIs, context management.
• Subsystems – EngineSubsystem, SceneSubsystem, JobSystem.
• External libs – GLFW/GLAD/GLEW, Jolt, Assimp, Recast & Detour, SoLoud, Freetype, ImGui, Tracy profiler, glm, pugixml, stb, nanosvg.
c. Managed Layers
• NuakeNet – C# runtime bindings for ECS, rendering, input, physics, scene – lives in “NuakeNet/src”.
• EditorNet – C# Editor actions, project creation, map import scripts.
d. Runtime & Asset Pipeline
• Runtime executable (“Runtime/Runtime.cpp”) for headless or build demos.
• Asset build scripts – build.sh, BuildAssets.lua, generate.bat, premake5.lua
• Resources – Scripts (Wren), Shaders, Images, Fonts, Gizmos.
Interactions & Data Flow
• Editor ↔ Engine Core
• UI events & commands → Engine API (via Coral/.NET or direct C++ callbacks)
• Scene changes, asset reimports → ResourceManager, ECS updates
• Live preview frames rendered by RenderingSubsystem
• Engine Core
• Application → initializes LayerStack → EngineSubsystems
• LayerStack updates: Input → Physics → Scripting → SceneSystems → Rendering → UI
• ResourceManager & FileSystem feed assets into Rendering, Physics, Scripting
• ScriptingEngine drives game logic, entity scripts, editor scripts
• Managed Scripting
• Wren VM & C# CLR embedded in process
• Scripts invoke Engine APIs through NetModules & native Wren modules
• External Services
• Uses Jolt for physics collision/rigid bodies
• Uses Recast & Detour for navmesh generation and AI pathfinding
• Uses Assimp for import of 3D model formats
• Uses SoLoud for spatialized audio
Architectural Patterns & Principles
• Layered architecture: Application → LayerStack → Subsystems
• Entity-Component-System (ECS) pattern for game objects
• Modular plugin style for scripting (Wren modules, C# modules)
• Dependency inversion for rendering API (RendererAPI abstraction allows different backends)
• Job system for multi-threaded tasks