Skip to content

Repository files navigation

VorpalEngine

Desktop + VR game engine, Vulkan renderer.

About this project

VorpalEngine is a primarily an AI-developed project, maintained as a study of what frontier models can do on a real complex C++ codebase rather than on a toy example. The majority of ongoing work is written by an AI agent working under human direction and review.

Code predating 2025 is human-written. Code added from 2025 onward may be partly or wholly AI-generated. Read it as a research codebase. the architecture is deliberately being reworked in the open, so expect churn.

Building

Build dependencies (Fedora tested only):

sudo dnf install cmake make gcc g++ git glslc zip \
    wayland-devel libxkbcommon-devel libX11-devel libXrandr-devel \
    libXinerama-devel libXcursor-devel libXi-devel mesa-libGL-devel \
    vulkan-validation-layers
  • glslc is required. Shaders are compiled from assets/shaders/src/ as part of the build and the .spv outputs are no longer committed, so there is nothing to fall back to. Setting VULKAN_SDK also works.
  • zip is required; assets are packed into assets.zip at build time.
  • vulkan-validation-layers is only needed for -DVORPAL_VALIDATION=ON.
  • spirv-tools is optional, for inspecting or validating the compiled shaders with spirv-dis / spirv-val.

Third-party code lives in git submodules, so clone recursively or run:

git submodule update --init --recursive

Then build with cmake:

mkdir build
cd build
cmake ..
make -j$(nproc)

Validation layers are off by default and gated on a build option, so a release build cannot ship with them enabled:

cmake .. -DVORPAL_VALIDATION=ON

Running

Run from the build directory. The engine opens assets.zip relative to the current directory, so launching from anywhere else fails with assets.zip not found.

cd build
./vorpal_engine

Game modules

Game logic is a shared library loaded at runtime behind the C ABI in api/vorpal/vorpal.h a module exports a single vp_module() symbol and reaches engine services through a table of function pointers. Modules are declared in CMakeLists.txt:

vorpal_add_game(hunted games/hunted/hunted.c)

Three ship with the engine. games/sponza/ is the default and loads on launch: a freecam walkthrough of the Khronos Sponza with the render settings exposed as an in-world panel, which E teleports in front of the view. games/hunted/ is the gameplay reference, and games/bench/ submits a fixed scene for --bench. Pass a different .so as the first argument to load it instead.

Modules hot-reload: rebuild one while the engine is running and it is reloaded in place. Game state is owned by the engine rather than the module so it survives the unload, which means it has to be plain data. See the header for the reload and versioning rules.

Renderer notes

The renderer detects GPU capabilities at startup instead of assuming a feature set, because descriptor indexing has to be handled per vendor: AMD mis-samples a non-uniformly indexed texture array without the nonuniformEXT decoration, while older Intel parts do not expose the extension at all and index correctly without it. Since nonuniformEXT is a compile-time SPIR-V decoration and not a runtime switch, the fragment shader is built twice and the engine picks the permutation the device needs. See include/VK/DeviceCaps.hpp.

About

Desktop + VR game engine

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages