Metroidvania Item Collection
Group Size: 1
Duration: 2 months, Oct-Nov 2022
Program: Unity 2021
As games evolve, gameplay styles evolve along with it. These games can integrate different genres and styles to create something entirely unique. For example, the movement and level design of a platformer, combined with the combat and item progression of an adventure game create a brand new genre: the Metroidvania. I decided to try my hand at the item collection portion of a metroidvania, while also dabbling in some level design.
Along with basic movement mechanics, like walking and jumping, there are three other movement options: double jump, dash, and wall jump. However, the player won't be able to use these mechanics right away. They'll have to gain each new mechanic through collectible items scattered throughout the level. These items take the form of capsules. Once each item is collected, the player will be taught how to use that new mechanic, and as such, it'll be unlocked. To make sure the player is incentivized to gain each new mechanic, the level is design to make sure you can't progress until you collect it. For example, early on in the level, there's a wall that's just too high to jump over. Right by that wall is the double jump mechanic, which will allow the player to finally get over the wall, and progress to the next part. This design philosophy is maintained throughout the level.
Progression example mentioned. Double jump upgrade required to progress.
Speaking of level design, the level isn't purely linear. There are two health canisters hidden in the level, which require the player to have all of the mechanics. When the player collects a new health canister, it will increase their maximum health by 1, and make their current health equal to their maximum health.
Current level layout. Health canisters are hidden in the top left and bottom right of the level.
With all of these varied mechanics come their own set of challenges. There were two mechanics I had a relatively difficult time with: the dash and the health increase, each for their own reasons. With the dash, I was having a difficult time figuring out how to make the player look like they're doing a forward dash, rather than just teleporting. The first solution I tried was using recursion on the function that actually makes the player dash. However, the issue with that solution was the fact that all of the recursion was occurring on the same frame. Since the Update function in Unity is already recursive as is, I decided to use that to my advantage. I disabled movement while the player is dashing to prevent any interference, and set a timer for how long the player can dash that decreased by 1/60th of a second for each frame. The result is a convincing looking dash.
Left: Dash function
Right: Movement is locked while the dash is active.
As for the health system, rendering the additional health points proved finicky, and more troublesome to solve than I thought. The problem was that I was rendering health in a different script than I was assigning actual health values. As such, the solution was to move the render function into the same script where health values are assigned.
Health rendering system
All in all, this project was a pretty fun experience. It allowed me to expand my repertoire of mechanics I can create, and test how I can balance the systems in a game. Furthermore, it allowed me to try out a skill I never took as seriously in the form of level design. Needless to say, this has me excited for any expansions I can add to this project.
Download build here