Loading repository data…
Loading repository data…
dev-mojammel-hosain / repository
A completely custom 3D game engine and shooter built from scratch in Python. No Unity or Unreal, just pure math, raw 3D graphics, and direct GPU programming.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
A Hardware-Accelerated Spatial Computing & Graphics Pipeline Built from First Principles
This repository contains a proprietary, fully custom 3D rendering engine and isometric RPG shooter engineered natively in Python 3. Bypassing high-level commercial abstraction layers (e.g., Unity, Unreal Engine), this project demonstrates absolute, low-level control over the CPU-to-GPU data pipeline, graphics memory allocation, and spatial mathematics.
Designed with the rigorous architectural standards required for machine learning and AI development, this engine showcases the implementation of hardware-accelerated tensor/matrix transformations, vectorized memory operations, and continuous algorithmic evaluation.
The engine is built natively in Python and requires standard data science and graphics libraries.
git clone [https://github.com/YourOrg/3d-rpg-engine.git](https://github.com/YourOrg/3d-rpg-engine.git)
cd 3d-rpg-engine
python -m venv venv
# On Linux/macOS:
source venv/bin/activate
# On Windows:
venv\Scripts\activate
pip install pygame PyOpenGL PyGLM numpy trimesh
python main.py
For ML and AI engineers, manipulating multidimensional arrays and understanding spatial compute are foundational. This engine translates those exact principles into real-time visual output:
.glb files and flattened using NumPy. This creates contiguous, C-style float32 arrays, enabling ultra-fast, zero-copy data transfer directly into the GPU's Video RAM via Vertex Array Objects (VAOs) and Vertex Buffer Objects (VBOs).The engine relies on raw mathematical implementations rather than pre-built physics engines:
Entity spatial positioning is governed by the Model matrix ($M$), calculated by multiplying Translation ($T$), Rotation ($R$), and Scale ($S$) matrices:
To pinpoint aiming, the engine calculates the scalar distance 't' along a 3D ray vector to intersect the horizontal plane at the player's weapon height ($y_{target} = 1.0$):
Enemies calculate the Euclidean distance (d) to the player to generate a normalized directional vector, ensuring consistent travel speed regardless of angle:
Why build a custom pipeline instead of using Unity or Godot? This table outlines the architectural tradeoffs and specific advantages of our native implementation.
| Feature / Metric | Custom Native Python/GL Engine | Commercial Engines (Unity/Unreal) | Standard Python (Pygame 2D) |
|---|---|---|---|
| Pipeline Abstraction | Zero. Direct hardware/memory access. | High. Abstracted components. | High. Software-rendered only. |
| Memory Allocation | Manual VAO/VBO mapping via NumPy strides. | Automated garbage collection / C++ pointers. | Inefficient Python list memory. |
| Matrix Mathematics | Explicit. Dev controls MVP matrix flow. | Hidden behind "Transform" components. | No native 3D matrix support. |
| Rendering Backend | Custom GLSL Shaders on GPU. | Proprietary rendering pipelines. | CPU-bound blitting. |
| Primary Use Case | Low-level algorithmic mastery & R&D. | Rapid commercial game deployment. | Simple 2D prototyping. |
| Binary Footprint | Ultra-lightweight (< 50MB with assets). | Massive (1GB+ base projects). | Lightweight. |
The engine is highly optimized for its target scope, utilizing a heavily structured data layout.
| Specification / Metric | Data / Benchmark |
|---|---|
| Target Framerate | Solid 60 FPS (Hardware V-Sync Enabled) |
| Vertex Stride Memory | 32 bytes per vertex (8 floats * 4 bytes) |
| Buffer Layout | [X, Y, Z, U, V, Nx, Ny, Nz] |
| Active Entities Supported | 80+ Destructible crates, 5+ AI, Dynamic Projectiles |
| Coordinate Space | 280 x 280 OpenGL World Units |
| AI Polling Rate | Every frame (16.67 ms per tick) |
| Collision Complexity | O(N * M) AABB Boolean Evaluations |
The codebase enforces strict separation of concerns, isolating mathematical logic, rendering commands, and state routing.
/3d-rpg-engine
│
├── /engine # Core Engine Modules
│ ├── renderer.py # GPU execution, Uniform mapping, Texture loading
│ ├── camera.py # Orthographic projections, Inverse View matrices
│ ├── mesh.py # Trimesh parsing, VAO/VBO memory generation
│ └── ui_renderer.py # Pygame 2D compositing, FSM routing, DDA algorithms
│
├── /entities # Game Logic & Physics
│ ├── player.py # Raycasting, Input polling, Transformation matrices
│ ├── enemy.py # Vector normalization, Delta-time tracking, AI logic
│ └── projectile.py # Object pooling, Trajectory math, Lifetime management
│
├── /shaders # Hardware-level GPU Code
│ ├── default_vertex.glsl # MVP coordinate space transformations
│ ├── default_frag.glsl # UV mapping, Base lighting, Alpha transparency
│ └── ui_vertex.glsl # 2D Orthographic overlay rendering
│
├── /assets # .glb models, .png textures, fonts
├── main.py # Pygame execution loop, Context initialization
└── README.md # Documentation
This engine was architected and developed collaboratively, with strict separation of concerns to ensure modularity and high-performance execution.
Mojammel Hosain Jesan
.glb asset memory translation, VAO/VBO architecture, and GLSL Shader compilation.Rakib Chowdhury
Abrar Mahir Chowdhury
Contact the Team: mojammelkhan567@gmail.com
Copyright (c) 2026 Mojammel Hosain Jesan, Rakib Chowdhury & Abrar Mahir Chowdhury.
ALL RIGHTS RESERVED.
This software, source code, and associated documentation files (the "Software") are the proprietary property of the copyright holders: Mojammel Hosain Jesan, Rakib Chowdhury, and Abrar Mahir Chowdhury.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.