Skip to content

Zyreniee/PyEngine

Repository files navigation

PyEngine Logo

PyEngine

A Lightweight, High-Performance 3D Engine Architected in C++20 & Vulkan

C++20 Badge Vulkan Badge Python Badge MIT License Badge

Built for speed, extensibility, and direct hardware control.

PyEngine Editor Preview


About PyEngine

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.


Core Features

  • 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.

Build Instructions

PyEngine is optimized for Linux systems and uses CMake (v3.24+) and Ninja for rapid compile times.

1. Prerequisites (Arch Linux)

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).

2. Compiling the Engine

  1. Clone the Repository:

    git clone https://github.com/zyreniee/PyEngine.git
    cd PyEngine
  2. Configure with CMake:

    cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug

    For an optimized build without validation layers and debug assertions, use -DCMAKE_BUILD_TYPE=Release.

  3. 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).

  4. Run the Sandbox:

    ./build/bin/PyEngineSandbox

Current State & Roadmap (WIP)

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.

Development Roadmap

  • 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.


The Architect

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!


Contributing

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.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

A lightweight, high-performance 3D engine built from scratch with C++20 & Vulkan, featuring embedded Python scripting.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors