What is Death Valley?
Death Valley is a first person shooter computer game. The premise of the game is you are a lone human survivor trapped in the desert during the zombie apocalypse. The object of the game is to shoot and kill as many zombies as you can, and stay alive for as long as possible. Initially there are very few zombies, however they will continue to spawn every second and rapidly increase in numbers, causing the game to become more difficult as it goes. For each zombie killed the player is awarded ten points. When the layer is ultimately eaten by the zombies, the score is wiped clean and the game restarts.
Why was it made?
The purpose of this game was to create a fun, yet simple video game. It was intended to be entertaining, yet simple and intuitive enough that almost anyone could play it successfully with only a brief explanation of the game and the controls. The creation of this game was also used as a learning experience for me to learn how to create a video game and how to use the Unity game engine. This project looked to improve upon the brief experience with Unity that I had gained in making my first game (Virtual Pong), by making a slightly more complex game that utilized more of the features of Unity.
How was this game made?
The player was created using the built in Unity FPS character controller, and attaching a gun model to the character. The gun used a model that was found on the Asset store. It was animated by moving the rotation of the gun between frames and adding a particle system, a light source, and a line renderer. Scripts were created to match the animation with the clicking of the mouse, as well as to shoot a ray cast from the end of the gun. If the ray cast hit a zombie it would then subtract damage from the zombie’s life. An extra audio source was added to the player with the music clip attached to play the music everywhere that the player was.
The zombies were created from a 3d model taken off of the asset store. They were given a navMesh agent and a script that had them traverse a navMesh in order to find the player character. They were also given scripts that allowed them to attack, and to take damage and die. A trigger collider was added to the zombie prefab, and if the player made contact with this trigger it signified that the zombie was able to attack. This would then trigger the zombie attack animation and lower the player’s health. A sound was added to the zombies that played every time a new zombie was created. Four spawn points were created by the zombies and a script controlled how often they were spawned while randomizing which spawn point it took place at.
The environment was created by duplicating many planes, adding a sand texture, and placing them together. Once the ground was created a border was made around the playable area. The border was created by a random assortment of 3d objects, including ruins, pillars, and rocks. This border served to box the player in to the environment and it was reinforced by placing a transparent box object on each wall of the border to ensure that the player could not get through or over it. The rest of the environment was made up of placing these same 3d models throughout the area to create an interesting desert level design. All of these models used a mesh collider to ensure that the player could not walk through them. The entire environment then needed to be baked as a NavMesh so that the enemies could traverse the environment and navigate around obstacles in order to find the player.
A HUD was created using Unity’s UI system. A health bar was created from a slider object and placed in the lower right hand corner of the screen. A clear image was created over the entire screen that could be changed to flash red to signify that the player was injured. The crosshair was made by 4 equally spaced rectangular images that were anchored to the middle of the screen. Text was added to the upper right hand corner to display the score. The game over screen was combined of a green image that covered the screen, and red text that displayed the words game over. The game over screen was animated to appear on the screen when the player lost all of his health. All of these UI objects were given scripts for them to interact properly, such as taking health away from the life bar, updating the score count, and applying the game over screen and then restarting the game.
Image showing final game with player being chased by zombies.
Image Showing the Game Over screen which appears when the player dies, before the game restarts.
Image showing an earlier stage of the game with a large number of zombies and an unfinished environment.
All assets were found from the Unity store and were downloaded for free.
Zombie model and animations : Zombie from Pxltiger
Sand Texture: Yughues Free Sand Materials from Nobiax/Yughues
Zombie Sound: Voices SFX from Little Robot Sound Factory
Gun Particles: Simple Particle Pack from Unity Technologies
Gun Sound : Post Apocalyptic Gun Demo from Sound Earth Game Audio
Rock Models : Mountains Canyons Cliffs from Infinita Studios
Biometric Joe text font : Grunge Font Pack from Ray Larabie
Gun Model : Assault Rifle A3 from Stronghold Creative
Ruins models : Ancient Ruins in the Desert – Part 1 from NECKOM Entertainment
Pillar models: Ancient Ruins in the Desert – Part 2 from NECKOM Entertainment
Soundtrack: Free Horror Music Track from T.I.D.N. Music
The scripts used to create this game can be found at: