Skip to content

francesctr4/Nous-Engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

468 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nous Engine

A multithreaded, Vulkan-based game engine developed in C++

GitHub repo size

C++23 SDL3 Vulkan

CLion CMake vcpkg


Showcase


Enhancing Software Performance through Multithreading and Parallel Programming Techniques

This repository contains source code developed as part of my Bachelor's Thesis (TFG):

Author: Francesc Teruel Rodriguez (francesctr4 on GitHub)
Created: 11/07/2025
Published Version: v0.3

License: CC-BY-NC-SA License
Attribution-NonCommercial-ShareAlike 4.0 International

Copyright (©) 2025 Francesc Teruel Rodríguez


Contributing

Pull requests are welcome! If you'd like to suggest improvements, add features, or report issues, feel free to open a GitHub issue or PR.


📚 Table of Contents


Changelog

Version 0.5 - Scripting System and Major Improvements (Current)

The v0.5 release introduces major architectural improvements, new Scripting System, and powerful tooling upgrades across the entire engine:

Scripting System

  • Dynamic scripting using DLLs with an exposed EngineAPI (create, edit and recompile scripts on engine runtime).
  • Hot reload support for instant iteration.
  • Jobified script dynamic library recompilation.
  • Engine bindings for function usage on scripting.

Project Structure & Build System

  • Project files and folders reorganization.
  • Modularized into multiple CMakeLists.txt using a clean recursive structure.
  • Engine executable split into, editor executable and game executable with DLL + LIB layers (EditorApp.exe / GameApp.exe).
  • Clear separation between Editor, Game, and Engine Core.
  • Updated internal structure documented with a Lucidchart diagram.

Editor & Tools

  • Expanded Logger system with channel-based filtering.
  • Complete refactor and improvements to the Event System.
  • New console window with new log channels and multiple ways to filter logs.
  • Scene serialization supporting Save/Load (jobified).
  • New hierarchy and inspector windows for ECS (Scene, GameObjects and Components).

Custom Memory Manager Improvements

  • Upgraded Memory Manager and DynamicAllocator to fully support polymorphic types.
  • New Memory Window to monitor tagged allocations in real time.
  • New STL allocator integrated inside STL containters (e.g. NOUS_Vector).
  • MemoryTag refactor using magic_enum library for reflective memory tagging.

Testing & Documentation

  • Added unit testing support with GoogleTest.
  • Integrated CTest target for automated test execution.
  • Doxygen script for automated documentation generation.
524456215-10bad943-3cfd-486b-b90c-26f49455ecc9

Version 0.4 - After Bachelor's Thesis Delivery

  • Development Environment: Migrated project to CLion for improved cross-platform IDE support.
  • Build System: Rebuilt the project using CMake with support for vcpkg (manifest mode) and CMake presets.
  • Dependency Management: All third-party libraries are now handled through vcpkg, simplifying setup and updates.
  • Cross-Platform Foundations: Refactored the codebase to begin supporting Linux and macOS, in addition to Windows.
  • Library Updates:
    • Upgraded from SDL2 → SDL3
    • Replaced MathGeoLib → glmath for math utilities
  • CMake Minimum Version: Now requires CMake 3.21 or higher

Version 0.3

  • Bachelor's Thesis: Final Delivery.

Version 0.2

  • Bachelor's Thesis: Delivery 2.

Version 0.1

  • Bachelor's Thesis: Delivery 1.

Dependencies

Important

For Windows Development and Execution

  1. Visual Studio Community 2022: Download and install Visual Studio Community 2022 with the following workloads:

    • Desktop development with C++
    • Make sure to include the latest C++ toolset and Windows SDK.
  2. Vulkan SDK 1.3.296.0: Download and install the Vulkan SDK 1.3.296.0. This provides the Vulkan runtime, headers, and tools (like glslc for shader compilation).

  3. CMake (≥ 3.21): Build system.

  4. Ninja: Build generator (specified in CMakePresets).

  5. C++23 Compiler: e.g., MSVC, GCC ≥ 11, Clang ≥ 14...

  6. vcpkg: Clone the repository on the same parent directory as this project (e.g. Nous-Engine/../vcpkg).

Additional Dependencies (Managed by vcpkg)

The project uses vcpkg to manage the following dependencies. They will be automatically installed and built when configuring the project with CMake.

  • SDL3 (with Vulkan support enabled)
  • Vulkan (Headers and libraries)
  • Assimp (Asset import library)
  • Dear ImGui (with features: docking-experimental, SDL3-binding, SDL3-renderer-binding, Vulkan-binding)
  • STB (Single-file image loading library)
  • Parson (Lightweight JSON library)
  • Tracy (Profiling tool)
  • GLM (Mathematics library for graphics)
  • gtest (Unit testing framework)
  • magic-enum (Header-only enum reflection library)

To install all required dependencies in classic mode:

vcpkg install vulkan sdl3[vulkan] assimp imgui[docking-experimental,sdl3-binding,sdl3-renderer-binding,vulkan-binding] stb parson tracy glm gtest magic-enum

Nous Engine v0.3

Context

Multithreading is a powerful yet complex area of software development, especially when applied to game engines. While professional ones include advanced multithreading systems, their internal implementations are rarely shared publicly. Moreover, existing tutorials often lack depth, leaving many developers unprepared for production level usage.

This project aims to bridge that gap by providing a beginner-friendly and practical introduction to multithreading, answering essential questions around performance, architecture, challenges, and limitations. The goal is to create a custom solution built from scratch, offering a solid starting point for developers interested in concurrent programming and game engine architecture on how to use multithreading effectively.

The practical part of the bachelor's thesis consists on developing a multithreaded game engine written in C++, featuring a Vulkan-based renderer to take advantage of its multithreading affinity. The chosen approach for the multithreading implementation is a thread-based job system built on top of a thread pool.


Features

Nous Engine is a modular C++ game engine with a focus on multithreaded performance and low-level rendering control. Below is an overview of its key features:

Core Engine Architecture

  • Modular engine structure (Renderer, Resource Manager, Input, etc.)
  • Thread-based Job System built on top of a Thread Pool
  • Memory management system with custom allocators and tagging
  • Event system for module communication
  • Logging and assertion utilities

Rendering & Graphics

  • Vulkan renderer backend
  • Camera controls
  • Offscreen rendering support (Scene and Game viewports)
  • 3D Geometry, Material and Texture loading

File & Resource Management

  • Resource manager with support for meshes, textures, and materials
  • Custom file system and serialization for accessing engine assets

Editor & Debugging Tools

  • ImGui editor UI
  • Asset browser for visual resource management
  • Debugging tools for multithreading and resources

Build & Development

  • Custom script to build the engine

Third Party Libraries

SDL2 - Download

Vulkan - Download

Assimp - Download

ImGui - Download

stb_image - Download

MathGeoLib - Download

Tracy - Download

Parson - Download


Third Party Assets


Installation

Important

In order to download and execute the engine you have to Download the Latest Release and extract the zip.

It is recommended that you extract the zip on the parent folder of the disk, so that the path doesn't get too long.
(e.g. D:\Nous-Engine-v0.3)

In this case, the executable path will be as follows:
D:\Nous-Engine-v0.3\Nous-Engine\Nous-Engine.exe


Controls

Camera

The 3D editor camera supports smooth navigation using a combination of mouse and keyboard inputs. Controls are only active when the scene viewport is hovered.

Input Action
Right Mouse Button (RMB) + W Move Forward
Right Mouse Button (RMB) + S Move Backward
Right Mouse Button (RMB) + A Move Left
Right Mouse Button (RMB) + D Move Right
Right Mouse Button (RMB) + E Move Up
Right Mouse Button (RMB) + Q Move Down
Shift (Hold while moving) Speed Boost
Right Mouse Button (RMB) + Mouse Drag Rotate Camera
Alt + Right Mouse Button (RMB) + Mouse Drag Orbit around target (origin)
Middle Mouse Button (MMB) + Mouse Drag Pan camera (move on X/Y axes)
Mouse Wheel Scroll Zoom In / Out

Multithreading

Multithreading

This tool provides real-time visibility into the Job System and thread pool usage in the engine. It is divided into two main sections:

  • Job System Overview
  • Job Queue

Job System Overview

This section displays the current state of the thread pool and job processing.

Label Description
Max Hardware Threads Number of hardware threads detected on the system (std::thread::hardware_concurrency() - 1).
Total Worker Threads Number of active worker threads in the pool (excluding the main thread).
Total Jobs Total number of jobs currently being handled or queued.
Active Threads Visual indicator showing how many threads are actively running jobs (green bar).
Thread Count Spinner Lets you configure the number of worker threads. Setting it to 0 disables multithreading.
Resize Pool Button Applies the new thread count, resizing the thread pool at runtime.
Multithreaded Mode Indicates if the job system is currently in multithreaded mode.

Thread Table

Displays the current state of each thread (including the main thread).

Column Description
ID Unique identifier for each thread.
Name Friendly label for the thread (e.g., Main Thread, Worker Thread 1, etc.).
State Thread status — either RUNNING (executing a job) or READY (idle).
Current Job The name of the job currently being executed. None if the thread is idle.
Time (s) Duration (in seconds) the current job has been running / has taken to complete.

Job Queue

This section lists all pending jobs that are waiting to be assigned to threads.

Column Description
Job Name The label of the pending job, useful for tracking or debugging.
(count) Displays the number of currently queued jobs.

Dynamic Thread Scaling

You can dynamically resize the thread pool using the spinner and Resize Pool button.

  • Setting the worker count to 0 switches the system to single-threaded mode.
  • The thread count can be adjusted in the range: [0, (std::thread::hardware_concurrency() - 1) * 2]

Debug Keys

These shortcuts trigger test jobs and resource loading using the job system for debugging and performance testing.

Key Action Description
F1 Submits a job to load Lagiacrus Head mesh and material.
F2 Submits a job to load Cypher mesh and material.
F3 Submits a job to load Queen Xenomorph mesh and material.
F4 Submits a job to load Wolf mesh and material.
F5 Submits 4 staggered jobs, each loading a mesh and material with delays.
F6 Clears all loaded resources on the scene.
F7 Submits a test job that sleeps for 5 seconds.
F8 Submits 100 CPU-bound jobs doing heavy dummy work for stress testing.

Known Bugs

The following issues are primarily related to the Resource Manager and the Vulkan Renderer Backend. While these fall outside the core focus of the thesis (which is centered on multithreading and the job system architecture), they are acknowledged and will be addressed in the near future:

  • Submesh support is currently unimplemented; only a single mesh per entity is rendered.
  • Crashes may occur when uploading multiple instances of the same textured mesh.
  • Vulkan synchronization issues may happen when uploading geometry concurrently (RNG).
  • Vulkan validation layer errors may appear when rendering multiple geometries on the scene.

These issues do not affect the multithreading implementation, which is functioning as intended.


Future Roadmap

While the current version of Nous Engine delivers promising results, it remains a foundation for much broader possibilities. Future development will focus on expanding the engine's capabilities:

Multithreading

Planned improvements to the Job System include:

  • Work-stealing mechanisms for better load balancing
  • Interruptible and cooperative threads
  • Lock-free concurrency algorithms
  • Job prioritization
  • Job dependencies and graph-based scheduling
  • Callback support on job completion or failure

Engine Programming

To evolve into a more complete engine, future modules and tools may include:

  • Scripting system
  • Physics engine
  • Animation system
  • Audio engine
  • User Interface (UI) system
  • Particle system
  • Artificial Intelligence (AI) module
  • Shader system

Additionally, planned core tools include:

  • Scene graph and hierarchy system
  • Inspector and property editor
  • Mouse picking and object selection
  • Frustum culling
  • Advanced time management
  • Resource manager and asset browser enhancements

Graphics Programming

The render engine will continue to evolve with both foundational and advanced techniques:

  • Forward and Deferred rendering pipelines
  • Phong and Blinn-Phong lighting models
  • Physically-Based Rendering (PBR) with Image-Based Lighting (IBL)
  • Shadow Mapping
  • Screen Space Ambient Occlusion (SSAO)
  • Environment and Relief mapping
  • Multi-pass bloom and Water effects
  • More Multithreaded Rendering features

As development continues, both the engine’s architecture and its multithreading capabilities will be refined and extended. Nous Engine remains an evolving project.


About

A multithreaded, Vulkan-based game engine developed in C++ as part of my bachelor's thesis, with CMake for build configuration and vcpkg for dependency management.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors