This is the Final Project for our Game Engineering Class.
In this assignment, we are required to make a game on the game engine we built in this semester.
The major purpose of this assignment is to show off the asset builders’ ability, as you can see in the final product, there will be multiple different models, materials, textures, etc.
For my final project, I decided to make Joust.
Here is a gameplay video:
Hit enemy from above and collect their eggs once they are dropped.
If an egg is left unattended for 5 seconds, a new enemy will spawn from it.
Falling into the lava will also cause game over.
Before making the game, I also implemented diffuse and ambient lighting in my engine.
And during the process, I realized that if an uniform is declared and not used in the body of a shader, the builder will remove the uniform from the shader on compile, which would cause the code fail to retrieve the uniform handle.
Most of the engine components I used in this game were from previous assignments from this class.
Since the asset builder system we built were pretty robust, I was able to
create my own models and textures and import them into the game without much efforts.
I was also able to create a new type of animated material (as you can see in the game, the flowing lava is achieved my animating the UV value of the mesh) by adding a new vertex shader.
In doing so I realized that any time-sensitive shader probably need to know the total time in second since the game started so I added a built-in handle to handle that.
But that was majorly focused on the asset builder, graphic side.
In order to make this game, I also need to pull some stuff from my engineering class from last semester:
I created a “world” class that content all the game objects including basic info like world transform, renderables, colliders, etc. which are also referenced in their own systems. Therefore I used smart pointer for them cause in that case I don’t need to worry about forgetting to delete a reference in one system and also avoid the pointer dangling problem.
AABB Collision detection:
I created the bounding box from the mesh file I created for this assignment. Under the assumption that the mesh will always be axis-aligned, I simply loop through all the vertices in the vertex buffer to get the minimum x, y, z and maximum x, y, z and then create the bounding box by subtracting the maximums by minimums.
But the world and game object parts are relatively less well-structured, so if I had more time, I will make that more well-structured so I can implement more complicated game logic easier.
I also wanted to create a game object/transform hierarchy like most of other game engines so I can animate the body parts of my knights.
The major things I learnt from this class were how to setup a project in visual studio properly, it might be a painful process in the beginning where you have to setup multiple projects, setting dependencies, trying to figure out the library linkages, etc. But it all proved to be worthy later when it all come together nicely when you are actually using it.
I also learnt how an asset pipeline works in a game engine, at least in the scope of the engine we are building, which I didn’t have a clear idea before. Although I am aiming to be more of a gameplay programmer instead of an engine programmer, I think this knowledge is still important because having some insight of how the tool works would definitely help improve efficiency and reduce the chances of making stupid mistakes when using the tool.
As we all know, every engineers have their own coding habits, it’s impossible to unify them. In my mind a good coding habit is try to structure the code nicely, with clear comments, naming and declarations, try to minimize repeated codes, etc. The ideal case is that someone without much knowledge of your coding style should be able to spend less than a day to understand the brief idea of your code and able to follow your structure and work on that.
Which in real life it’s really hard to achieve due to deadlines and human elements (the laziness in most engineers’ blood including myself). But that would still be my goal, to write code that is clear and easy to work with.