Alien Blaster

Our 5th project at The Game Assembly was a 3D flying game. This was the first game made in our group's custom engine. My main contributions for this project was the physics and the particle system.

Project Details

  • 10 weeks half-time
  • Created in a custom engine using DirectX 11
  • 5 Programmers | 3 Level Designers | 4 Graphical Artists | 3 Technical Artists

Physics

I created a Transform3D class that was used for all the objects in the game. The class was a wrapper around a 4x4 matrix and contained intuitive functions for manipulating position, rotation and scale. It also had support for parenting, which made it easy to create hierarchies of objects.

In order to implement the rotations for the Transform3D, I had to learn about Quaternions. I created a class to handle all Quaternion-related logic. This included functions to apply a quaternion to a vector, conversions from/to Euler angles, conversions to rotation matrices and code for slerping between quaternions.

Knockback when colliding at an angle

For the collision system, I wrote functions for detecting collisions among spheres and boxes. The functions would also return additional data about the collision, such as the contact position, penetration depth and the collision normal. This allowed me to implement a knockback effect when the ship collided with an obstacle at an angle, which was more fair than instantly dying if you grazed a wall. I also implemented an octree and a collision filtering system based on bitmasks to optimize the collision checking.

Rendering

I implemented support in our engine for quads and sprites, which were used for our HUD. I also added support for changing a mesh's LOD depending on distance.

I made a debug drawer that used DirectX to render lines in 3D and created an interface for drawing lines, spheres and cubes. This allowed the team to easily draw any shape they needed in order to debug. The vertices of the debug lines were all added to the same buffer, which meant all the debug lines only required one draw call.