This was our final assignment where we had to make a game using the engine that we developed over the course. I made a Frogger style game where the player is this cute little cube that has to jump the obstacles to cross the road. Their are about 3 types of obstacles in the game such as car, train and spikes. It is an endless game and the game gets over if the player collides with any of the obstacles.
The engine that we developed is basically a graphics rendering engine where we used both OpenGL and Directx. This engine contains various builders such as Material Builder, Mesh Builder, Texture Builder, Shader Builder and other helper builders to streamline the process of asset import. These builders convert all the assets to binary format which helps reduce the game size. The engine can be used to render opaque and transparent objects and can easily be expanded to create different graphics effects. We also built a mesh builder for Maya which allowed us to export the model data such as Vertex, Index, RGB color and UV information in a lua file. This lua mesh file is then converted to a binary format at build time and loaded in the game at run time.
Here is the screenshot of the game:
I made the game endless by repositioning the world objects once they went behind the camera. Added basic AABB collision for the player and obstacles. The floor is a simple plane which contains the texture for the road, pavement and the railway tracks. The jump for the cube is using verlet equation. After colliding with an obstacle, a Game Over mesh is drawn in front of the camera. Here is how it looks:
During the development of this game I could understand how important was the pipeline that we developed and how important was it to include more similar tools. I could have easily added builders specifically for each Gameobject to define its position, rotation, collision data,etc but since it was a small game and also I did not get much time. I am thinking of adding them as part of my stretch goal because If I was third person using this engine, I would want an easier way to change the objects position and its properties without diving into the code.
Over this one semester I learnt a lot of good and bad programming practices such as code segregation, namespaces, platform independence,avoiding the for loops, setting right project dependencies and a lot of nitty-gritty things that I wan’t aware of earlier. I once almost spent 3 hours figuring out a problem only to find out that I had hard coded vertex data information.
I was desperate to know how objects were rendered which I did. I expected to learn a little more about lighting and different shaders but because of the time restriction we could not. My coding style has improved, most importantly my way of architecting it. Earlier I used to write code for myself but now I have realised that you essentially have to write code for some else so that they find it easier to edit or add something to it. Architecting a code requires a lot of thought process and good knowledge of design patterns which I have been able to grasp over the year. One has to think more and code less but what I used to do earlier was the opposite.
This course has peeked my interest in graphics therefore I have chosen another computer graphics course for the next semester. I am really looking forward to it. This has been the best semester so far.