Hyper
Gemini Systems
Engine: Unity 2022.3.0f1
Team Size: 8
Duration: 10 weeks
Role: Lead/Sole Programmer
Dates: February 2024 - April 2024
Marketing Poster for Hyper
Gameplay Video
Available on itch.io
Details
Game Description
Hyper is a third-person movement shooter in which players must defeat enemies as they complete levels in the quickest time possible.
The player is a new recruit to the Gemini Systems company in which new soldiers are being trained. The player is meant to be completing a training, but they end up breaking out into a rogue area that has not yet been fully developed for training new recruits. The player must survive and make it out before they run out of time.
The coyote time and jump buffer is an incredible feature that greatly improves a game’s feel, especially in a game like Hyper, where there is an emphasis on how quick and accurate the player is with their movement. Giving the player just a tad bit of leeway on their jumps improves the game feel tremendously.
In the script to the right, there is a function, which is run in update, that handles the coyote time and jump buffer for the player’s movement.
While the player is grounded, the coyoteTimeCounter is set to the coyoteTime (it isn’t counting down). In Hyper, the coyote time equals 0.3 seconds. The moment the player leaves the ground, the coyoteTimeCounter begins counting down. If the player presses the jump input before 0.3 seconds have elapsed since they left the ground, they jump. If the jump input is pressed outside the 0.3 second time frame, the player does not jump as they have been in the air for too long.
The jump buffer behaves similarly, however it is in the opposite direction. In Hyper, the jump buffer is 0.15 seconds. If the player presses the jump input 0.15 seconds before they touch the ground, rather than after like coyote time, they jump. The jump buffer gives the player a tiny window to jump before they have actually hit the ground. The addition of the jump buffer helped give the feel of jumping the moment you hit the ground, which was the intention because of how crucial a player’s movement is to their success.
You may also notice the if statement that checks if jumpsRemaining is greater than 0. Hyper contains a double jump (the second jump can be activated in the air), so it is crucial to check if the player has their extra jump before shutting them out of jumping if the coyote timer is less than 0.
When a level is finished, a new entry is added to the highscores leaderboard. Each entry contains the time in which the player completed the level, and what the player set their name as.
The function begins by getting the existing highscore entries. If there aren’t any, a new, empty, set of highscores is created. Additionally, the list contained in highscores is checked to ensure that it exists before trying to add to it.
Once the highscoreEntryList exists, a new HighscoreEntry is created, which uses the time and name that was inputted when this function was called. The new entry is then added to the list of highscore entries. The newly updated list of highscore entries is then saved into a JSON string, which is stored in PlayerPrefs.
Adding entries to the leaderboard is crucial for it to actually show the various times in which the player completed each level. The entries in the leaderboard are only stored locally, so it is a great reason to have a LAN party and see who can get the quickest time!
The settings menu contains an option for players to rebind their controls to whatever they like for both keyboard and mouse as well as controller. The rebinding operation is part of the code that is run whenever the player rebinds their controls.
The rebind operation begins by setting what key is pressed to cancel the rebind, and what will happen when the rebind is cancelled. When cancelled using the escape key, the action being rebound is re enabled and the UI for the rebind is turned off.
Similar to the cancel, when the rebind action is completed, the action is re enabled and the rebind UI is turned off. There is then a check to see if the user inputted a duplicate binding. If there is a duplicate, the duplicate binding display is enabled if it exists. Then, the duplicate binding is removed and the player is allowed to input a new binding that is not a duplicate.
If the new binding inputted is not a duplicate, re enable the action, turn off the UI display, and then check if the binding is part of a composite. If it is part of a composite, do the rebinding operation again, except it will be for the next binding in the composite binding’s list. Once all of the bindings have been rebound, set the input to the new rebound input that the user gave.
Code Snippets
Coyote Time and Jump Buffer
Coyote time and jump buffer can be seen at many points throughout the gameplay video that is at the beginning of the page.
Add Entry to Leaderboard
Rebinding Function
The rebinding function can be seen in action at the 20 second mark in the gameplay video.
The addition of an entry to the leaderboard can be seen a couple times in the gameplay video, but a specific example of seeing a new entry is at the 4 minute mark.