Cohort Project Introduction:
The Cohort project is a game titled “Don’t Walk By”. It is a strategy game involving the caretaking of NPCs with behaviour that often leads them into danger. It is the player’s objective to keep the “pawns” out of harm’s way, either by preventing tragedies from happening by redirecting pawns to safer locations, or dealing with disasters that have already occured to minimise the chances of more pawns dying.
Cohort Project Main Contribution Overview:
As part of this Cohort project, my group was assigned to deal with events. This part of the game is dedicated to creating elements that are capable of killing pawns. Some example events include fire, which can spread, and vending machines that can fall and crush. Our group was tasked with creating these elements while also allowing for a universal event system that can be utilised by other groups who are working on different aspects of the project, and vice versa. For example, event cannot kill pawns if there is not a connection point between the events system and the pawn management.
My specific contribution is focused on one of the events, specifically the vending machine, which I worked on with another cohort member.
The vending machine operates by waiting for a pawn to enter its collision radius, where it has a high probability to fall for every frame the pawn is within that radius.
Once it is decided it will fall, there is a 0.8 second window where the vending machine is classified as “falling”. Once this window is over, there is an additional 2 second window where the vending machine is capable of killing pawns within the area it has fallen.
Originally, this “fallen” state where it could crush a pawn would be disabled upon the death of a pawn, but this caused two notable issues. a) If two pawns were caught in the collision, only one would be crushed. b) If the pawn that triggered the fall moved out of the way, the check for the vending machine being able to kill wouldn’t be disabled, meaning any pawn that happened to run into it would die, which seemed random as the vending machine would have fallen by that point. This problem was mitigated by allowing that two second window for multiple pawns within the collision to be killed before the vending machine’s ability to kill was disabled.
In regards to how the vending machine operates with other systems, it is spawned through an event manager that oversees all events, including the vending machine. This manager allows the vending machine to be operatable in aspects such as the game’s level editor. It can also be placed so it faces forward, left or right, allowing for some additional flexibility for the level designers in regards to how this event is placed and utilised.
Cohort Project Contributions Bullet Point List:
A summary of contributions to the cohort project.
- Implementation of the vending machine, how it operates and how it interacts with the pawn
- Integration with the event manager
- Upkeeping of the event and bug fixes when new additions such as animations were integrated.
A summary of key dates for contributions:
- Feb 13th: Vending Machine beginnings. Not integregated with the rest of the project yet, but foundations made for this so different systems can be slotted in with ease. e.g temporary gameobject to represent pawn until PawnManager integration can occur.
- Feb 18th: Minor adjustments to the vending machine code. Added function that allows vending machine to fall by chance.
- Feb 26th: Vending Machine can figure out closest pawn position to find out if pawn is nearby for more effective decision making on falling. Pawns can now die to the vending machine once it has fallen thanks to Pawn Manager integration.
- March 4th: Minor adjustments made to vending machine in preparation for beta build.
- March 9th: Vending machine was integrated into the grid system and can now appear on the level. Still need to make adjustments to show a visible fall.
- March 10th: Vending machine can now fall, represented by a basic graphic spawning next to the vending machine when conditions are met. Additional bug fixes.
- March 24th: Some cleanup of the vending machine code and starting to fix some visual errors thanks to commissioned sprites being added to the game.
- April 1st: Adjusted vending machine fall chances as chances were too low and gave the impression the vending machine was bugged and couldn’t fall. Fixed bug where vending machine would duplicate itself and that duplication could duplicate itself and so on…
- April 29th: Fixed issue where the variable that determined if a vending machine could crush a pawn was set in an awkward place, leading to situations where if a pawn dodged the vending machine, the next pawn to interact with it would be killed despite the vending machine being fallen for a while, not justifying the crush.
- May 6th: Final adjustments to vending machine. Adjusted when crush variable was set so pawns did not look they were being crushed slightly before the vending machine actually fell. Also fixed an issue that made pawns get stuck due to changes in the pawn’s AI system that didn’t integrate too well with existing code in the vending machine system.