How hedge-dev/unleashedrecomp works
Main Components
• Application Entry & Main Loop: Represented by files such as main.cpp, app.cpp, and app.h, this is where the game starts up and coordinates the different systems.
• API and Game Engine Modules: The “api” folder shows multiple internal subsystems including CSD (custom scene and resource management), Hedgehog (which covers core systems like containers, memory management, threading, and math), and SWA (which contains game-specific logic, assets, and modules like Camera, HUD, Player, and more). These indicate a layered design where core engine utilities and game logic coexist.
• Rendering Subsystems: The “gpu” directory splits into several areas: shader programming (both HLSL shader code for various effects like Gaussian blur, motion blur, and MSAA), a rendering hardware abstraction layer via plume (with separate backend implementations for D3D12 and Vulkan), and the video module. Show how these interact with the overall engine.
• Audio, Input, and OS Abstraction: Folders such as “apu” (for audio processing with drivers like SDL2), “hid” (input drivers) in addition to the “os” folder (which contains OS-specific implementations for both Windows and Linux) indicate a separation of platform-specific logic behind abstraction layers.
• Kernel and System Emulation Layers: The “cpu” and “kernel” directories include components like thread handling, memory management, guest thread emulation, and system call hooks that simulate Xbox 360 kernel behavior. These are critical for reproducing the original console’s operations.
• Mod and Installer Support: The presence of “mod” (for mod loader and INI file management), “install” (which handles game file acquisition and integrity checking) and UI components (in the “ui” folder) highlight built-in systems for installation, configuration, and mod support.
Relationships and Interactions
• Data Flow: The main application layer initializes the kernel and engine subsystems. Then, it drives the game loop, which calls rendering, audio, and input handling components.
• Platform Adaptation: Represent OS abstraction layers that capture different implementations for Windows, Linux (and potentially macOS later) by including separate directories and drivers.
Architectural Patterns and Strategies
• Modular Design: The project is clearly broken into modules such as API, kernel, GPU, audio, etc., each self-contained yet communicating through well-defined interfaces.
• Abstraction Layers: The use of hardware abstraction by plume, and OS-specific implementations in “os” and “apu” (audio, input, media) are prime examples of separation-of-concerns and portability.
• Plugin/Mod Support: The mod loading system forms a bridge for external modifications, which is linked to the installer and configuration modules.
• Asynchronous & Parallel Processing: As emphasized in the README, asynchronous shader compilation and parallel asset streaming are key performance features. This should be clearly marked to denote thread-based and asynchronous processes.
Relevant Technologies and Libraries
• C++ as the core language.
• CMake (CMakeLists.txt, CMakePresets.json) for multi-platform builds.
• SDL2 (for input, video and audio drivers in “apu” and “hid”).
• Vulkan and Direct3D 12 via plume, with shader code written in HLSL.
• External libraries such as boost (for smart pointers and utility functions) and third-party dependencies in the “thirdparty” folder.
• Dear ImGui is used in the UI for custom menus and overlays.