The Last Hours

Programmer, Developer | Prototype
(Android , Made with Unity3D )

Play Video
  • Store Page: Unreleased
  • Platforms: Android
  • Studio: Terafort
  • Role: Prorotype Developer
  • Tools: Unity, C#
  • Release Date: None

Technical Overview

The Last Hours is a prototype of a top-down action shooter with an isometric camera. It was created by a team of five people, including myself as the sole developer, two modelers, and a designer. The purpose of the prototype was to test an idea that could potentially be developed into a full-fledged game.

In terms of technical details, the touch controls were designed with the left side of the screen for movement and the right side for aiming and shooting, utilizing a floating joystick. A finite state machine was developed for the player’s basic movement and shooting controls, which included various sub-state machines such as walking, crouching, standing, aiming, strafing, crouched aiming/strafing, and more. The character’s movement was handled by a character controller. Additionally, a weapon system was implemented, allowing the player to carry a maximum of two weapons. Unity’s Animation Rigging package was utilized for Inverse Kinematics, specifically the Two Bone IK Constraint, to make the player character hold and carry the weapon correctly. Multi-aim constraints were used to handle things like head rotation towards the target. One noteworthy feature regarding weapon aiming was that the player would rotate their torso to aim, only rotating their whole body when reaching a specific torso rotation angle. These animations were achieved by applying animation rigging constraints on top of a few basic animations, which saved development time by avoiding the need to create numerous different animations. Some additional tools were also developed to facilitate the process, such as setting up the weapon position at runtime and serializing its properties. The shooting mechanics were implemented using raycasting in the direction of the player’s aim, checking for any potential hits.

Regarding the AI, Unity’s navmesh and the A* pathfinding system from the asset store were employed. A finite state machine was created for the AI, encompassing states such as patrolling, searching, taking cover, attacking, and being alerted. The cover mechanic was implemented by identifying the nearest edge vertices of the Nav Mesh and determining if they provided valid cover using a combination of sphere casts and ray casts, taking the player’s direction into consideration. If the AI heard a gunshot, it would become alerted, search the area of the disturbance for a while, and then return to patrolling. When in direct contact with the player, the AI would start shooting if the player was within range; otherwise, it would chase the player as long as they remained in sight. The AI’s field of view was established using cone-shaped ray casting, ensuring that a player hidden behind a sufficiently large obstacle would not be detected, as the ray cast would be blocked.

Core Game Developer

Player Mechanics:

• Designed touch controls for mobile devices utilizing floating joysticks.
• Implemented a finite state machine to control the player’s basic movement and shooting.
• Integrated Unity’s Animation Rigging package for realistic weapon handling through inverse kinematics (IK).
• Utilized multiple animation constraints to achieve realistic weapon handling and torso rotation during aiming.

AI Behavior and Enemy Encounters:

• Utilized Unity’s navmesh and A* pathfinding system for AI behavior.
• Developed a finite state machine to handle the various states of the AI.
• Implemented a cover mechanic using baked navmesh.
• Programmed AI shooting behavior based on the player’s proximity, triggering shooting or chasing depending on the player’s visibility.
• Established AI’s field of view using cone-shaped raycasting.

Gameplay Programmer:

• Developed a stealth takedown system allowing players to silently kill enemies from behind.
• Created the camera system using cinemachine.
• Designed a dummy quest for the level.
• Added primary and secondary weapons along with their functionalities, including a throwable grenade that can bounce off walls.

Miscellaneous:

• Developed a tool to dynamically set the orientation and position of any weapon at different poses during runtime and serialize them.