Skip to content

A 3D Game Engine made with DirectX12 and native C++ only. It contains an ECS system with real time collision and physics. A small shooter game is included for testing. Made by 3 people in 5 weeks.

Notifications You must be signed in to change notification settings

tiagzoc/PIT_Engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PIT_Engine

THIS PROJECT WAS THE WORK OF 3 PEOPLE, BUT I COULDN'T FORK THE ORIGINAL REPO DUE TO MY SCHOOL'S POLICIES/ORGANIZATION

OTHER CONTRIBUTORS :


General Information

PIT_Engine is a C++ 3D Game-Engine developed using DirectX12. Our goal was to create a 3D game-engine with a small game, using only DirectX12 and native C++ functions. We were a group a 3 people during 5 weeks during this project. It includes an ECS system with a Real-Time Collision detection alongside a physic system. It was our first time creating such a system and our first approach to 3D Engine programming. This solution includes 3 projects : Core, which is a static library and the Core of our Engine; Debug, which is an application and the entry point; and PrimitiveBuilder, which is an app to build all the primitive 3D shapes that we're using. The PIT_Engine comes with a small shooter-game to test and show our work.

Technologies used:

  • C++20
  • DirectX12
  • CMake for build management

How to Build and Run

Prerequisites

  • Windows 10 or newer
  • Visual Studio 2022 (or compatible)
    • Desktop development with C++
    • Windows 10/11 SDK (checked by default)
  • CMake >= 3.20

Steps

  1. Clone the repository:
git clone https://github.com/tiagzoc/PIT_Engine.git
  1. Create a build directory:

Note: you can name the directory however you want.

mkdir build
  1. Open a cmd and write this command:

Note: you need to modify the build parameter with your build directory's name (if needed).

cmake -S . -B build
  1. Build the project:
cmake --build . --config Release
  1. Run the Debug executable.

Note: if you're not using Visual Studio, you will probably need to set Debug as a Startup project.


How the Project Works

  • The PrimitiveBuilder automatically creates an array of vertices of each 3D shape that we will be using, doing so avoid computing the same shape several times.
  • The Core is the base of our engine and will manage all the entities, script and system of our app.
    • It initialise the InputSystem, CollisionSystem, PhysicSystem and the Entity / Component array.
    • It updates every script attached to entities and then update every system (Input, Collision and Physic in this order).
    • It removes every dead entities by calling the Purge() function.

Note: You can see all this code in the Debug/PIT_ECS.cpp.

  • The Core is also responsible for all the rendering (PSO, swapchain, shaders..).
  • The Debug app is the entry point of our program and manage the shooter-game parts.

What I Learned

  • Setting up a modular C++ project with multiple libraries and executables.
  • The rendering pipeline of 3D Engine alongside how to create window with DirectX12.
  • What is an ECS system and how to create it.
  • The maths behind the 3D Collision Detection.
  • The maths behind all the rendering matrix (projection, world).
  • What is a shader, how to write it and how to use it.
  • How to create a 3D Game-Engine from scratch.

Possible Improvements

  • Implement a 8 DOP and Convex Hull Collider to provide more Collider choice.
  • Improve the physics system because it was made in a rush.
  • Improve the collision system by adding space partitioning.
  • Refactor some Core code for better maintainability and flexibility.
  • Add UI element (images, texts ...).
  • Add sounds element and manager.

Demo

Gameplay Video

About

A 3D Game Engine made with DirectX12 and native C++ only. It contains an ECS system with real time collision and physics. A small shooter game is included for testing. Made by 3 people in 5 weeks.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published