DRIFT WALKER
DRIFT WALKER
About Drift Walker!
Drift Walker is a first person game with parkour elements in which the player must run across floating islands, while fighting terrible enemies and unrevealing the mysteries behind the Island scattering cataclysm known as The Drift.
In the game, the player can run freely, using their abilities to be able to wall run, slide downhill, and slash enemies using their sword.
Thanks to a mysterious source of power, the player can also use powers such as slowing down time, throwing magic dagger or creating armors to absorb enemies hits.
The player will be able to move through little floating pieces of Islands blocked in the air and bigger Islands and temples which will be filled with enemies and platforming sections to cross.
CONTRIBUTIONS
Lead Responsibilities
Lead programmer
Collaboration with other leads from various departments
Constant communication with all team members
TDD document management
Code review, debug and Daily build
The Movement
I was in charge of creating all the basic movement such as the jump, dash, slider and wall run. The movement was created, for the time it had, as generic as possible so that the designers could change the values to their liking. The state of the player is controlled by the state pattern created by me and my colleague, so you can know at any time the action that the player is carrying out. The operation of the state pattern is shown in the following image.
Reading player actions
As change state pattern into code
Example Move:
Using unity's new type of input system, let's read the read value (x and y) to understand if the player is pressing some key.
In our case, the state pattern is used to understand both if the player is pressing keys and what actions I can perform in certain circumstances.
The same state change logic is almost used for the other actions.
Base Movement Code
What info contains into method Movement? And what change inside?
Within the movement method, we check and change the addition of force based on the action it is carrying out, for example, when the player is sliding and respects the verification condition, a force different from the others is added but always remaining all inside the movement method, trying not to create a too dispersive code.
Where force is applied to it, we can see that we find the Time.fixedUnscaledDeltaTime entry, why was this used?
Because within our game, the player has the ability to slow down time, affecting the whole game world but except himself and his actions, so I replaced Time.fixedDeltaTime with Time.fixedUnscaledDeltaTime.
Dash
The logic of applying the dash displacement force is the only one different from all the other abilities, I wanted to choose for a not-physical displacement so that the player does not go to perceive the heaviness of physical displacement.
Dash
Not-physical movement of the player
The dash skill was created as generic as possible, so designers could modify the work to their liking.
For example, we can change how long the ray casts of hit objects must be or the maximum distance from the dash, the duration of the camera effect, how much force to apply after the dash, etc.
Examples of changing values in GIF
Time change example
Omnidirectional dash and visual feedback of end
Change of force applied after the dash
Wall Run
The wall run, like the dash, has been created as generic as possible to give designers space to modify it as they wish.
For example, how much initial thrust should it have, output force, speed, etc.
Wall Run Example
Calculation of the direction when I climb the wall for the first time
Player skill
In Drift Walker, player's skills are essential to be able to overcome the threats of this world, but players can also rely on powerful abilities that will help them throughout the game.
Player Skills GIF
Teleport
Slow Down Time
Scriptable object example for player's skills
For the player's skills, scriptable Objects have been created from which they inherit from a generic one that contains the following information, how long it lasts, cooldown time and type of skill.
I wanted to create scriptable Objects so that the code, regardless of the scriptable object assigned to it, will read the following data and behave accordingly.
Save Manager
The saves to keep in our game are very few and simple to memorize, such as the time it took to finish the level, the levels unlocked and the commands.
Initially it was thought to encapsulate the save information via a scriptable object for modified commands, but in the end a simple save was preferred, with the creation of a .save file.
Binary save with division between audio, game data and commands
Why is the load class of type dynamic?
Initially I thought that using a dynamic type instead of a generic T was less expensive, but unfortunately I realized that it actually takes much more time to prevent bugs and tests as being that they only work at runtime it is not possible to prevent bugs while with the generic type, it depends on the cases, yes.
In the end the code remained unchanged because I believe that in my case it was better to use a dynamic as I was not interested in the type that was returned to me.
Input & Input Manager
Initially our game was supposed to be only for mouse and keyboard, but analyzing the market and the competition we preferred to add the gamepad too and thanks to Unity's new input system this allowed us to introduce it without too many problems.
Subdivision of commands for each move of the player
Code to check if the input type is changed and call to an action
UI
Which was created entirely by myself, designer and an artist, creating documents like UI / UX, TDD and using applications like Figma to create a first visual impact.
UI/UX Document example
Reading of the current active panel
Reading the active panel allows me to perform actions within the game, such as, for example, if the player dies, I'm interested in knowing which panel is active, whether that of the pause or options, so that, once exiting the pause the death panel takes over, or it allows me to create a generic code, such as, to return to the main menu from the various menu options.
Example of the one just described above
Within our game, I have created a system for reading a text document introduced from the outside and saved in an engine for the narration of the story.
How does it work?
Once the designers have written the history of the layer on the document, they just have to associate it with the respective level (in the scriptable object of the levels).
Text document assignment
Designer text documents
Code reading