Unity/C#
Freelance Contract Project
Development Time: 1 year (Halted)
For potential employers: If you wish to obtain the latest version of the game build, please contact me.
Aliens have invaded the planet and taken humans hostage! Can an anthropomorphize group of zoo animals be the savior of this world? Fight your way through hoards of aliens with your strength and an arsenal of weapons, some of which utilizes... food?
This is the first project I've been contracted to work on, and I'm also working as the sole programmer with a few designers and artists. Throughout this project we've done continuous cycles of sprints and frequently creating prototypes for showcase to fans and investors.
The goal of this game is to defeat hoards of aliens approaching the player. An enemy could have simple behaviour so the hoard does not overwhelm the player.
The basic action options we have decided on are: idling or stationary; wandering randomly; chasing the player when nearby; and attacking the player when in range. There are also extra states caused by being attacked, like getting stunned and collapsing after health depletion.
I've also added multiple wander algorithms: simply staying stationary until the player comes close; patrolling in the radius of the enemy's starting position; and wandering in random directions with a limited range. These give options to the designers for the enemies to have appropriate behaviours in each area of the level.
Different enemies also have different attacks, melee attacks being close-range and utilizing colliders to detect attack hits, while ranged attacks uses projectiles and enemies attack from afar.
While enemies with melee attacks comes close to the player, ranged enemies have added behaviour to retreat when the player comes close, giving the player extra challenge in strategizing.
There is also a type of enemies that has multiple melee attack options, each with a different range, which the enemy would move closer if necessary to sucessfully land an attack.
Attacks are handled through animations. During the attack state, a possible attack animation plays. An event gets called during the animation to enable a collider, by specifying the identifier of the collider. They are also disabled in a similar way.
We decided to distributed enemies through waves. When the player enters an area, a wave is triggered, and a number of enemies spawn in groups. After defeating all enemies spawned, the next wave ques until all waves are finished.
The main game uses a limited number of waves with specific enemy groups, and the designers create these groups of enemies manually. We tried to form recognizable shapes with the enemy groups for visual cleanliness. These groups are then put into an array to form a wave, then these waves are put into the wave system for the game to run through.
I have also programmed an endless wave system (currently unused in the game), which spawns a few groups of enemies of varying difficulty to defeat. Each wave in this system would increase in difficulty by adding more enemies at first, and gradually use more tougher enemies as bigger waves milestones are reached.
Infinite waves system in theory on the Game Design Document
The locations at which the enemy groups appear are semi-predetermined as well. The designers mark the points at which the groups can spawn, usually at the centre of big rooms, and those points form an array in the wave system. When spawning in a new wave, the system first checks the location of the player, omits the closest point to the player, allowing some breathing room for the player before combat (and to prevent sudden player-enemy collision), then spawns each group of enemies in the subsequent closest points.
During development, a designer also noted that the number of enemy groups may eventually exceed the number of spawn points. A solution we have is to spawn the next group back at the first spawning point after a delay, then continue iterating through each spawn point again, repeating until all specified groups have been spawned in.
We used animation rigging to animate the player character holding the weapon. This makes it very easy to apply weapons into pre-existing animations.
The two images here shows the same idle animation of the character, the difference being the rifle being held with his arms raised. When unused, the rifle gets attached to the back and holstered, and the arms return to the default animation.
While aiming, the character would also look at the targeted direction, using another animation rigging device to rotate the spine and head.
Similar to the enemies, the player also has access to melee and projectile attacks. Both forms of attacks uses left click as the main attack input, while melee uses right click as a secondary attack option and aim for projectile attacks.
There are also throwable projectiles, specifically the grenade, which travels a more complex trajectory. While some projectiles simply use Unity's gravity, the aiming of the grenade requires the trajectory to be calculated beforehand, so that an angle could be applied to the throw to land at the targeted position.
There are a few tools I've been asked to produce by the designers, which would help with the process of development. The first of which is a free roaming camera.
This camera can be used to fly through the scene, while disabling the UI. The main use of this is taking screenshots, and showcasing the level.
We often make use of custom shapes and extra objects when building the scene, for purposes such as adding indicators and configuring AI navigations. While these objects are useful for us when designing, we need to remove all of them for the final gameplay.
The Mesh Toggler tool is made to streamline this process, by allowing meshes to be turn visible and invisible with a press of a button, giving the designer the choice of which mesh to include as well.
With the food theme around the game, we wanted some interesting ways to obtain food items. Ordering from a food truck is an example of this. By playing through the game you accumulate points, which can be used as currency in the truck. A timer starts when you spend points to order, then food gets thrown out when the timer ends.
To keep the gameplay interesting, enemies would target these shops before targeting the player, attacking the shop until they die. The shop itself will have its own internal health bar, if the enemies drain it by attacking for too long the shop will shut down for an extended period of time.