Unity Music Tracks Game
High Concept This project was an attempt to explore different ways of creating interactive music games beyond the traditional rhythm game genre. The player controls a character who's movement capabilities are modified by the game's background music. The game has up to four different music tracks playing at one time, which each fit together in a single piece. The player can mute and un-mute these tracks to provide different benefits, such as a double jump, a dash, or increased jump height.
Process Work on the project began by creating a system that would allow muting and un-muting of different music tracks at specific times. These tracks could be muted at any point, but should only be un-muted at the start of a 4/4 measure. A system was developed to only process the command to un-mute a track on the start of a measure using a built in Unity function called "FixedUpdate." FixedUpdate is guaranteed to be called (or simulated to be called) 50 times every second with default project settings. By creating music tracks that kept a consistent tempo of 75 bpm, a single 4/4 measure could be calculated as 160 calls of FixedUpdate. Thus, tracks could only be un-muted on every 160th call of FixedUpdate. This meant that a track always would come in at the start of a measure, rather than in the middle of a phrase. In the end, five separate tracks could be muted and un-muted by pressing the keys 1 through 5.
Character movement was handled next, using Unity's Rigidbody and CharacterController components. First, basic movement left and right was implemented, followed by the ability to jump. Next, the character was able to double jump (jump one additional time when already in the air), followed by the ability to gain a short burst in momentum in a given direction by pressing the shift key.
Once these movement abilities, were in place, they were tied to the existing track system. Certain abilities, such as the double jump and dash, could only be used when a corresponding music track was un-muted. The player could also toggle a fourth and fifth track to provide additional height or speed to their jump or dash respectively if they timed their movement to the 75 bpm tempo of the music.
Basic graphics were added to the game from a free asset-pack on the Unity Store. These assets were applied to the game to replace the basic spheres and cubes that made up the games visuals up to that point.
What Next? As it stands currently, the project serves as a proof of concept for a complete game. While there is no complete level in place, levels could be built that require strategic muting and un-muting of tracks to successfully navigate. Improving the visuals and animations of the game would greatly help to increase its appeal, as well as adding more than one set of music to play at a time.
There are issues in the current build of the game. While the math that calculates the muting and un-muting times of the tracks remains consistent, the DAW that was used to create the tracks within the game (SoundTrap) has a metronome that is slightly inaccurate. The 75 bpm tempo on the DAW is actually slightly faster than 75bpm, so the tracks in the game will slowly fall out of sync with the script in charge of them. This leads to tracks being un-muted slightly before or after the exact moments when they should be activated. To fix this issue, the musical tracks should be recreated in another DAW.
Hardware:
-Mac or PC
Repository:
-