The objective for the fourth and final project was to build a 3D maze style game using a multi-level environment, a spherical object for the player and enemy NPC’s that use A* route finding. The player has to navigate their way through the maze to the finishing point whilst avoiding any enemies or hazards. Starting from the ground level working their way through to the more challenging second level. Working with the DirectX API all of the above tasks were combined to put together a working, fully functional game.
Contribution for the project:
This task consisted of two parts that were separated into further sections.
1) The 3D Game
Part 1: The Starting Scene
Using the DirectX API to develop this game, i created the first level to begin with. This involved creating a 3D representation of the walls, floor, player and non-player models. A number of implementation tasks were then carried out; the camera for the game, the start of the game spawn point for the player. Collision detection that will prevent the player from passing through the walls of the maze or any enemies in the game. When the player comes into contact with the enemy this results in instant death and the player will respawn at the start of the level. Player movement through keyboard input. A* pathfinding for the enemies that allows them to patrol from a start position to an end position.
Part 2: The Next Stage
From here I had to expand on my first level and create a second level for the game. A lift model was added to enable the player to move from the first floor to the second floor. Vertex colours and textures were added to all the models. A player health meter that I included on the player model itself, by way of changing the colour of the player turning a strong red colour the less health it had. At the end of each level a flag pole is placed so the player has a destination/goal they can head towards.
Part 3: Advanced Elements
For this particular section I included fire hazards for the second level of the game (discussed more below within the particles section). The enemy AI for this section required me to create a list of positions so that the enemy can patrol between a list of positions set out on the level. When the player collides with any of the walls in the game they will lose health. An end game condition was included so that once the player reaches the last end of level destination in the game. The game would reset allowing the player to replay the game if they so wish. The levels for the game were procedurally created. Since submitting this project I have added a skybox in the game also.
2) Visual Effects
Part 1: Vertex and Pixel Shaders
Using the HLSL language I was able to produce lighting effects, detailed textures to the models and different surface properties; ambient, diffuse and specular components.
Part 2: Particles
Here I implemented different particle effects to enhance the game from a visual stand point and to have them appear seamless during gameplay. For this four particle effects were incorporated into the game; explosion, smoke, sparks and fire. When the player dies the explosion effect takes place followed by the smoke particle effect, being a product of the explosion. When the player collides into the walls of the maze the spark effect will trigger. For the last particle effect, fire. The second level of the game contains fire hazards. These were set to timers so that they would ignite at different intervals. If the player happens to be on top of one when it ignites the player will lose their health.
Shadows
The requirement to create shadow effects using shadow volumes in the game.
For this task I had to document in a report how I developed the game. This would include any issues I encountered and how I overcame them. If I was not able to resolve an issue I would have to write my attempted solution methods. I would have to document any anomalies present in the game along with any non original code or other assets used.