A Lightweight, High-Performance 3D Engine Architected in C++20 & Vulkan
Built for speed, extensibility, and direct hardware control.
PyEngine is a custom, open-source 3D game engine built entirely from scratch. Its core philosophy is to provide a highly efficient, modular framework for handling low-level game logic and rendering, without the bloated overhead of commercial engines.
What sets PyEngine apart is its hybrid architecture:
- The Engine Core: Heavy lifting (rendering pipelines, memory management, physics solvers, and systems) is handled strictly by native C++20 and Vulkan for maximum execution speed.
- The Scripting Layer: Gameplay logic, AI systems, and entity behaviors are fully programmable via an intuitive Embedded Python Scripting system using pybind11.
It implements a modern Component-Based entity structure, enabling you to attach Python behavioral scripts, physics colliders, and mesh renderers directly to objects in the scene.
- Native Vulkan Renderer: High-performance, explicit graphics pipeline designed for maximum GPU throughput, complete with dynamic viewport state, double-buffered frame synchronization (fences & semaphores), and memory management powered by Vulkan Memory Allocator (VMA).
- Embedded Python Scripting: Script your gameplay logic, AI behavior, and system states in Python. Enjoy near-instant iteration times while the underlying C++ framework compiles and runs at maximum machine efficiency.
- Component-Based Architecture: A highly modular scene hierarchy. Seamlessly attach, detach, and inspect components (
Transform,Mesh,Script,Collider) at runtime. - Event-Driven Input System: Low-latency keyboard and mouse handling seamlessly bridged between C++ events and the Python API.
- Basic Physics & Collisions: A lightweight physics solver for rigidbodies, raycasting, and collision detection.
PyEngine is optimized for Linux systems and uses CMake (v3.24+) and Ninja for rapid compile times.
Install the required build tools, Vulkan SDK components, Python 3 libraries, and windowing dependencies:
sudo pacman -S --needed \
base-devel cmake ninja git \
vulkan-icd-loader vulkan-headers vulkan-validation-layers \
shaderc spirv-tools spirv-headers \
glfw-x11 glm fmt spdlog(For other distributions, ensure your package manager installs the equivalent Vulkan development SDK, GLFW, GLM, spdlog, and Python development headers).
-
Clone the Repository:
git clone https://github.com/zyreniee/PyEngine.git cd PyEngine -
Configure with CMake:
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=DebugFor an optimized build without validation layers and debug assertions, use
-DCMAKE_BUILD_TYPE=Release. -
Build the Core & Shaders:
cmake --build build -j$(nproc)(This automatically compiles the engine library, sandbox target, and processes GLSL shaders into SPIR-V binaries).
-
Run the Sandbox:
./build/bin/PyEngineSandbox
PyEngine is currently in Active Development. While the core rendering loop, Python bindings, and scene systems are functional, the engine is continually evolving as a robust learning and prototyping framework.
- Integrated Entity Component System (ECS) backend using EnTT for excellent cache locality.
- Physically Based Rendering (PBR) pipeline integration.
- Visual Scene Editor using ImGui docking framework.
- Expanded Python API exposing more core systems (Physics/Audio).
For a detailed technical dive, see the Architecture Guide and Roadmap Specification.
Note
Yusuf Güneş (Zyreniee)
I started engineering PyEngine as a vocational high school software development student to deeply understand low-level API design, hardware memory layouts, and how modern engines bridge lightweight scripting with low-level execution.
If you are interested in low-level graphics programming, engine architecture, or graphics engineering, feel free to dive into the codebase!
Contributions, architectural discussions, and optimizations are highly welcome! Since the engine is in an active iterative phase, your ideas can play a major role in shaping its future.
- Found a bug? Open an Issue.
- Have an optimization or a feature? Submit a Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.
