[Game Development] Prototype Rhythm Game - Procedural levels based on music

2.2k words

Overview

For this project, we developed a rhythm-based music game where players interact with notes generated in real-time based on the rhythm and onset of the music. The game dynamically generates notes on the left side of the screen based on the beat and on the right side based on the onset, creating a unique and engaging gameplay experience. Built using Unity and leveraging the RhythmTool plugin, the game analyzes music tracks to detect rhythm and onset, ensuring that each playthrough feels fresh and challenging.

Key Features

Dynamic Note Generation

  • Beat-Based Notes: Notes are generated on the left side of the screen based on the rhythm of the music.
  • Onset-Based Notes: Notes are generated on the right side of the screen based on the onset (transient peaks in the music), ensuring variability and replayability.
  • Unique Gameplay: Even when playing the same song multiple times, the note patterns are different, keeping the gameplay engaging.

Music Analysis with RhythmTool

  • Utilized the RhythmTool plugin to analyze music tracks and extract rhythm and onset data.
  • Implemented real-time note generation based on the analyzed data, ensuring synchronization with the music.

Android Compatibility

  • Developed the game for Android devices, ensuring smooth performance and touch-based controls.
  • Optimized the game for mobile devices to handle real-time music analysis and note generation.

Challenges & Learnings

  • Note Overlap: Random-position notes sometimes overlapped, making it difficult for players to interact with them. We implemented a system to ensure minimum spacing between notes.
  • Performance Optimization: Real-time music analysis and note generation caused performance issues on some Android devices. We optimized the code and reduced unnecessary computations.
  • Synchronization: Ensuring that notes were perfectly synchronized with the music required fine-tuning the analysis and generation logic.

Improvements

  • Custom Music Support: Allow players to add and select their own music tracks.
  • Game Over System: Implement a game-over mechanic to add stakes and replay value.
  • Improved Note Spawning: Further refine the note generation system to prevent overlaps and improve gameplay flow.
  • Code Optimization: Address crashes and performance issues to ensure a smooth experience on all devices.

This project was a fantastic opportunity to explore music analysis and real-time gameplay mechanics in Unity. By leveraging the RhythmTool plugin, we created a rhythm game that dynamically adapts to the music, offering a unique experience with every playthrough.