Grégory LARGANGE

THE LAST SHIFT

Ubisoft GameLab Competition 2025

— ROLES

Gameplay Programmer, Producer, Voice Artist


— TECHNOLOGIES

Unity, C#


— DURATION

10 weeks

Summary:

Produced in 10 weeks for the Ubisoft GameLab Competition, The Last Shift is a couch competitive two players game, made in accordance to the theme Action/Reaction.

In The Last Shift, each player, as a museum guard, must prevent a thief from stealing the works in his care, or risk losing his job!


Team:

7 (3 Programmers, 2 Game Designers, 2 Artists)


Contributions:

- Project Leader: Managed Git repository, tasks and roadmap, communications

- Implemented player vision

- Implemented object placement grid

- Implemented player gamepad controls

- Conduction of voice recordings


Sources:

The Last Shift

Player Vision: Object Visibility

Based on the work of Sebastian Lague, I implemented a Field of View system for the players. This allows the introduction of a search and pursue dynamic between the players and the thief. This system can be split in two parts, the vision mechanic itself, and the field of view visual display.


In this first part, I will go through the process of figuring out if an object is visible at a given time.


- Object sorting

To reduce the number of object that will be processed, I create a list of elligible objects. An object is elligible when it is no farther from the player than his maximum view range, and belongs to the layer “game agent”. To achieve this sorting, I use a sphere collider, which radius is equal to the view range of the player. Combined with Layer Masking and OnTriggerEnter/Exit functions, I hence consistently obtain a list of objects that might be visible.


- Proximity Detection

Objects which distance from the player d is inferior to the proximity detection radius r are always shown.


- Vision angle

Once I have the elligible objects list, I further test each objects against the vision angle, θ, of the player. If the angle between the direction to the object and the forward direction of the player, ɣ ,is such that -θ/2 <= ɣ <= θ/2, then the object is within the field of view of the player. Still, the object isn't "visible" until I have determined wether or not there is a line of sight from the player to it.


- Line of Sight

Afterwards, each object left is guaranteed to be in the field of vision of the player, but might still be obscured by another one. To resolve this, I perform a raycast between the player and the object, which I set to be affected only by objects on an obstacle layer. If there is no collision registered, then there is line of sight, and I display the mesh of the target object

Player Vision: Field of View

The field of view visual is generated using raycast and runtime mesh generation and recalculation.


In this second part of the player vision system, I will go through this process.


> Raycasts

First, I make Raycasts from the players position, for a distance d equal to the vision range of the player, in incremental angles from -θ/2 to θ/2, by steps δ. This step increment is calculated as such: δ = θ / nbRays. I then store the parameters of each raycasts in structures.


> Mesh Triangles

The goal here is to generate a mesh from world points, where each points can either be a hit coordinate or a point at the maximum range of a Raycast (d) if it hasn't hit anything. The origin of the raycast, namely the world position of the player, is the common vertex for each triangle. These points hence become the vertices of the mesh i am going to generate.


> Mesh generation

I generate a mesh from the vertices I gathered, recalculate the normals and the bounds. I also use a binary search algorithm to smooth further the mesh in the particular case of two obstacles being close together.


Object Placement Grid

Based on my previous work for ColorQuest, I implemented a game grid which dictates where a trap can be placed.


> Grid snap

I created a snapping system, so that every trap will always be placed at the center of a node of the grid.


> Runtime update

Each time a trap is placed or destroyed, the node at which it had been placed updates consequently, blocking or freeing it for further trap placement.


> Obstacles and player zones

Only at the start of a round, the grid is "baked", meaning that it will take into account the placement of static objects such as obstacles, and non physical object such as player zone, and update its nodes consequently.

For example, even if a node is free, that is, there is no obstacle nor trap placed upon it, Player 1 will only be able to place a trap on that node if it belongs to the zone Player 1.


Gamepad Player Controls

Using the New Input System and Events, I implemented gamepad controls for players. Each parameter, such as player linear speed, rotation speed, action selection is accessible to Game Designers from the Editor.

I use a combination of two scripts, a Player Controls script which registers gamepad inputs, and a Player Actions script which performs the actual actions. This way, I isolate each logic, and it is simple to bind or unbind action to a gamepad input.