Is that possible? A whole game engine in only three weeks? Well, not really...
Most of us third year students at Gaming Campus had little to no clue how even a game engine worked, and that's for
a good reason. Game engines are literal beasts, huge libraries of code and knowledge aimed at making game development
easier. They must handle many different subsystems that you'd expect to find in any modern game as a player : 3D rendering,
sound, physics simulation, user interfaces, keyboard and gamepad input, networking for multiplayer, and the list goes on...
This three weeks project at Gaming Campus was meant to be a quick introduction make us discover the world of engine programming. In groups of four,
our task was to make a relatively simple, barebones engine based on DirectX 12 for rendering, as well as a tiny space shooter
game to showcase the engine's capabilities.
My role during the project
In teams of four classmates, we worked on our own project. As stated above, the wide majority of the class had never tried engine programming
before. Personally, I was in a special situation. This project took place in November 2023, and at that time, I had been doing engine programming
in my spare time for 6 years. I had learned C++, DirectX 9, OpenGL and the Win32 API all by myself, simply because I liked tinkering and
making games on my very own pieces of software. Basically, I had a huge background.
My role during the project has mostly revolved around the overall architecture and coaching my classmates. But I wasn't just the architect, I have
worked on some features as well, such as the skybox and environment reflection, sun rendering, particle rendering and physics simulation.
Features
Engine
Entity system
Our engine provides a base entity class for implementing custom logic, as well as some internal entities used to interface with the engine parts,
such as models, cameras, directional lights, and more. Able to tick, form hierarchies, and combine to make more complex objects, they are versatile
and robust at the same time!
Mesh generation
The boxes, spheres and capsules used in the game are generated by our homemade algorithms! They provide texture coordinates and
normals for correct lighting.
Directional light
The engine provides an interface to a global directional light, which is applied to every object in the world. As a bonus, the
color is customizable. But this isn't space disco simulator...
Skybox & Environmental reflection
With a 360 degrees scan provided by the official NASA website, the Milky Way skybox is a really neat way to immerse the player into
a seemingly infinite universe. Plus, I realized we could easily implement environmental reflection for metallic surfaces, since we have a cubemap.
Post-process
The sun is a post-process effect which renders a radial gradient around a point on the screen, giving the illusion of a very
strong glow.
Particle emitters
Good old particle systems rendered using instanced rendering and billboards.
Physics (collision detection)
Probably the toughest. In the end, we only needed one shape : the sphere. But managing rigid bodies, detecting collision pairs, avoiding a simulation
becoming unstable... All of these issues had to be addressed for our physics engine to work correctly.
UI & Text rendering
Our game has a main menu, a pause screen and a HUD. It is capable of rendering simple UI and provides mouse interaction
for buttons. The game also ships with a texture atlas containing a small portion of the OCR A Extended font. It is monospace, and thus was the
perfect choice, since we weren't allowed to use external librairies, TrueType font loaders were ruled out.
Game
Shoot
Hold left click to shoot at asteroids and enemy spaceships.
Accelerate
Use WASD to accelerate in different directions. Hold Shift to boost.
Slow down time
Hold right click to slow down time and increase your precision when firing.
Turn and roll
Use the mouse to turn your ship, and use Q and E to barrel roll!
Enemies and asteroids
Alien ships are all around! Shoot them to score one point. And beware of the asteroids floating around. They can be shot, but do not earn any points.
Links
Curious about the code? Check out the project's GitHub page!
Also check out this LinkedIn post I made after the end of the project here.
Gallery
Click an image to enlarge.
The game's main menu
The sun, rendered in post process
An enemy ship. Environment reflections are applied on all meshes here