Stay And Slay

Details:
  • A first person shooter inspired by Anger Foot.
  • 15-week development (20h/week) with a team of 5 programmers, 2 level designers and 5 3D artists.
  • Game is made in our own game engine made from a base of the schools in-house game engine.
  • Unity is used as a level editor.
My contributions:
  • PhysX implementation in our own engine.
  • Scene and scene stack pipeline.
  • Build system with MSBuild.
  • Multiple materials per model export support.
  • In game cubemap capture.
  • Rendering gun and hands in front of everything.
  • HUD UI elements.
PhysX implementation in our own game engine:

To achieve the complex physics simulation that our game required, we decided to utilize the PhysX C++ library from NVIDIA. I was responsible for integrating PhysX into our Entity Component System (ECS) pipeline, as well as learning all the necessary functionalities that the project needed. For each scene in our game, a PhysX scene is instantiated to store all the PhysX actors. During the loading of a level, each ECS Entity requiring physical behavior is assigned a component which points to the corresponding PhysX actor.

During each frame, we update the ECS entity's transform to match the PhysX object's.

This is the first prototype of the player character controller where it was able to walk up the slope if it was not that steep.

Unity collider position export challenge:

One challenge I encountered when exporting the collider's local pose was that the displayed position of the collider in Unity did not match up with the model when that GameObject was childed to multiple GameObjects with both scaling and rotation applied. This resulted in me having to do some ticky matrix multiplication to get the colliders in our engine to the same position as the one in Unity.

The grey objects in the left image are the meshes and the green objects are their colliders. Even though the colliders should be in the centre of the mesh, they are not because their parent objects are scaled and rotated. The right image is when I got the colliders to be in the same position in our game engine as the ones in Unity.

This is an image of the code that calculated the collider local position.

Rendering gun and hands in front of everything

In first-person video games, a common issue is that the guns can clip into the walls. To combat this, developers often render the entire gun, even when it is clipping into the wall.

To solve this problem within our engine, I first rendered the gun in its normal state. Then, I rendered the gun again with a depth-only pass, writing a depth value of 0 to the depth buffer. This ensured that all objects rendered after would not be rendered on top of the gun.