Instance Coffee

Overview

This project is one where the challenge was not to build levels in Unity, but rather to take a document that another team had designed, and extract information from it in order to build a fully functional prototype through coding in C# in parallel with the Unity Game Engine. This project was worked on in a team with each member of the team being assigned tasks that best suit their skill level in C#. It is important to mention that with this document for the sake of the project we needed to cut certain elements due to time constraints, or add elements based on spread of the workload.

You can find out more about the document here.

Project

Constraints

Team and Tasks

Patrick Vasile: Mini Stalker (AI + Pathfinding + Motion Driven animation & movement, Camera and the Game Manager 

Daisy Provencher: Ingredients (Physiques System) + Time slow down, Platforms

Mathieu Noel: Avatar (Motion Driven)

Jeff Beaupre: Save System, Menu and UI

AI

Camera

Game Manager

Challenges

Some challenges that we faced as a team were creating systems that would work well with each other. In order to fix this as a team when we merged our parts of the project we ensured that we linked and associated the right elements to our parts to ensure that different scripts worked together. Another challenge we had as a team was ensuring that everyone delivered their parts on time. To solve this we set deadlines that were to be respected in order for the project to advance.

Design Process

My role

My role on the project was to build a stalker AI system that would serve as the enemy in the protype of the game. A camera that works in parallel with avatar and character control coded by Mathieu. I was also tasked with creating a game manager that aid in the game running and stocking the various variables. For the sake of ease of use, I also created a save point that would for one create a new position for the player to respawn if they were to die, as well as a place for the save system to communicate with the game in order to save the in game data.

AI Breakdown

The AI was the most complex of the tasks that I had in the project, this will be a breakdown of it. The AI is controlled through a state machine in which the AI itself cycles through the states depending on a multitude of factors. I was inspired by the AI of that in Alien Isolation. A highly complex AI system that constantly keeps the players on the edge of their seat, not being fully able to determine its pattern. With this in mind the For example;

Idle State

The idle state is determined by the waypoints in the map. When the AI approaches the waypoints, there is a chance system in a script that is triggered. If the system returns a value below a predetermined value (one that can also be changed in the engine), then the AI will stop at the waypoint for a few seconds before it returns to a patrol state.

Patrol State

The patrol state is the base state for the AI. With the waypoint objects placed in the scene, these waypoints are assigned to a list to which the AI will then cycle through these waypoints moving forward and backward through the list to create a dynamic patrol pattern, and one that can not be completely determined by the player. Also the AI constantly projects a raycast in which it checks for the player and whether it can see the avatar in the game space or not. When the player is seen, if the player is not within the detection zone of the AI, it is ignored as if it was never seen. This permits a sense of stealth in the game that is not too punishing for the player. However when the player is spotted with the raycast and is within the zone of the AI this triggers a state change and turns into a Chase

Chase State

The chase state can be changed in two methods. The primary method is that the player distances themself far enough that they are no longer in the zone of the AI. At first the chase ended when the player was no longer visible with the raycast, but with an iteration and some reflection of a real life scenario, if someone were to turn the corner and hide, it would be a typical response to follow them around the corner. This led to an improved method where the player needs to distance themself entirely from the enemy. In doing so, the enemy returns to a patrol state finding the nearest waypoint in the list. The other method to exit the chase state is when the player approaches the attack range.

Attack State

The attack state can also be changed in two methods. One where the player distances themself enough for the AI to return to the chase state. The other method is that the player is attacked. When the player is attacked they die and the AI returns to a patrol state finding the nearest waypoint.

You can also find the code to my part of the project in my GitHub repository

© 2022 Patrick Vasile