ITI T38 GD/GA Graduation Project โ A Virtual Reality music rhythm game where you slash and shoot enemies in sync with MIDI music.
๐ฎ Unity Connect Project Page
- About the Game
- Features
- Prerequisites
- Getting Started
- How to Play
- Configuration
- Project Structure
- Architecture Overview
- VR Platform Support
- Credits
RhythmAttack-VR is a VR rhythm combat game built with Unity. Notes are spawned in sync with MIDI music tracks โ slash them with your sword, dodge the ones you can't cut, and blast the boss with your gun. The game uses a ScriptableObject-based architecture for flexible, data-driven level and gameplay configuration.
- ๐ต MIDI-synced gameplay โ notes are generated from real MIDI files in real time
- โ๏ธ Dual combat modes โ Melee (sword) and Ranged (gun) phases
- ๐ก๏ธ Defense & Attack โ dodge incoming notes and counter-attack the boss
- ๐ Scoring & Leaderboards โ points awarded for accurate hits; leaderboard tracking
- ๐๏ธ Multiple difficulty levels โ swap MIDI tracks for different challenge levels
- ๐ Multi-platform VR โ supports SteamVR, Oculus, Windows Mixed Reality, and more via VRTK
- ๐งฑ ScriptableObject architecture โ fully data-driven; designers can tweak balance without code changes
| Requirement | Version / Details |
|---|---|
| Unity | 2018.1.5f1 (exact version required) |
| VR Headset | HTC Vive, Oculus Rift, Windows Mixed Reality, or any VRTK-compatible headset |
| SteamVR | Required for PC VR playback |
| Operating System | Windows 10 (64-bit recommended) |
โ ๏ธ The project was built and tested with Unity 2018.1.5f1. Opening it in a different Unity version may cause compatibility issues with VRTK, SteamVR, and MidiPlayerTK plugins.
git clone https://github.com/omar92/RhythmAttack-VR.gitDownload and install Unity 2018.1.5f1 using Unity Hub or the standalone installer.
- Open Unity Hub.
- Click Add and navigate to the cloned
RhythmAttack-VRfolder. - Select Unity 2018.1.5f1 as the editor version.
- Click Open โ Unity will import all assets on the first launch (this may take a few minutes).
Navigate to:
Assets/0_ProjectFiles/Scenes/GamePlayScene.unity
Double-click GamePlayScene.unity to open it.
- Launch SteamVR before pressing Play if you want to play in VR.
- The game also supports keyboard input for testing without a headset.
Click the โถ Play button in the Unity Editor toolbar to start the game.
| Action | VR Controller | Keyboard (Testing) |
|---|---|---|
| Slash notes | Swing the right controller (sword) | โ |
| Shoot enemy | Pull right trigger (gun) | Space |
| Dodge notes | Move your head/body | Arrow keys |
| Grip weapon | Hold grip button | โ |
- Music starts โ the MIDI track begins playing.
- Notes spawn โ coloured notes fly toward you in sync with the beat.
- Slash or dodge โ cut attack notes with your sword; dodge evade notes.
- Attack the Boss โ when the boss is exposed, switch to the gun and fire.
- Survive โ your health decreases when you miss notes; regeneration kicks in between phases.
- Score โ combo multipliers reward consistent, accurate hits.
- Win โ deplete the boss's health to finish the level.
- Hit notes exactly on the beat for maximum points.
- Chain consecutive hits to build your combo multiplier.
- Avoid taking damage to preserve your combo.
All game parameters are stored as ScriptableObject assets located in:
Assets/0_ProjectFiles/ScriptableObjects/GameData/
| Asset | What it Controls |
|---|---|
LevelSettings.asset |
Player/boss health, note speed, damage values, healing rates |
LevelSounds.asset |
MIDI track paths for each difficulty level |
GeneralGameSounds.asset |
Sound effects (sword swing, gunshot, pain, boss dialogue) |
GameLevel.asset |
Currently active difficulty level |
- Place your
.midfile inAssets/0_ProjectFiles/Resources/Tracks/. - Open
LevelSounds.assetin the Inspector. - Assign the new track to the desired difficulty slot.
Open LevelSettings.asset and adjust values such as:
playerMaxHealth/bossMaxHealthnoteMoveSpeedhitDamage/missDamagehealthRegenRate
RhythmAttack-VR/
โโโ Assets/
โ โโโ 0_ProjectFiles/ # All custom game content
โ โ โโโ Audios/ # Sound effects (MP3)
โ โ โโโ Effects/ # Visual & audio effects
โ โ โโโ Materials/ # Game materials
โ โ โโโ Prefabs/ # Reusable game objects
โ โ โ โโโ GamePLayElements/ # VR Player, Boss, health bars
โ โ โ โโโ Engine/ # Scene manager prefabs
โ โ โ โโโ Characters/ # Character models
โ โ โ โโโ UI/ # UI prefabs
โ โ โโโ Resources/
โ โ โ โโโ Models/ # 3D models (Boss, Minions)
โ โ โ โโโ Tracks/ # MIDI track files
โ โ โ โโโ UI/ # UI resources
โ โ โโโ Scenes/
โ โ โ โโโ GamePlayScene.unity # Main gameplay scene
โ โ โ โโโ TestScene.unity # Development / testing scene
โ โ โโโ Scripts/
โ โ โ โโโ MonoScripts/ # Runtime gameplay logic
โ โ โ โ โโโ Midi/ # MIDI parsing & playback
โ โ โ โ โโโ Emitter/ # Note spawning system
โ โ โ โ โโโ Engine/ # Game state & managers
โ โ โ โ โโโ VR/ # VR controller input
โ โ โ โ โโโ MeleeWeapon/ # Sword mechanics
โ โ โ โ โโโ RangedWeapon/ # Gun mechanics
โ โ โ โ โโโ Player/ # Player health & states
โ โ โ โ โโโ Boss/ # Boss behaviour
โ โ โ โโโ ScriptableObjectsScripts/
โ โ โ โ โโโ DataTypes/ # FloatVariable, BoolVariable, etc.
โ โ โ โ โโโ Engine/ # StateMachine, GameState
โ โ โ โ โโโ Events/ # GameEvent system
โ โ โ โโโ Editor/ # Custom Unity Editor tools
โ โ โโโ ScriptableObjects/ # Runtime data assets
โ โโโ VRTK/ # VR Toolkit SDK
โ โโโ SteamVR/ # SteamVR plugin
โ โโโ Oculus/ # Oculus SDK
โ โโโ MidiPlayer/ # MidiPlayerTK plugin
โโโ Packages/ # Unity Package Manager manifests
โโโ ProjectSettings/ # Unity project settings
โโโ README.md
The project follows a ScriptableObject-driven, event-based architecture:
StateMachine.csโ ScriptableObject state machine supporting smooth and forced transitions.GameState.csโ Base class for all game states (OnEnter,OnExit,OnPause,OnUnPause).GameStateHandler.csโ MonoBehaviour that drives state transitions at runtime.
GameEvent.csโ ScriptableObject events for loose coupling between systems.GameEventListener.csโ MonoBehaviour that subscribes to aGameEventand invokes a UnityEvent response.
MidiHandler.csloads the MIDI file and maps notes to lanes.BroadcastMidiWave.csbroadcasts note events on each beat.Emitter.csspawns note prefabs at the correct time and position.NoteScript.cshandles the note's movement and collision with the player's weapon.
FloatVariable,BoolVariable,StringVariable,IntVariableโ runtime data shared across components without direct references.
VRTK abstracts input across all major PC VR platforms:
| Platform | SDK |
|---|---|
| HTC Vive | SteamVR |
| Oculus Rift / Rift S | Oculus SDK |
| Windows Mixed Reality | SteamVR / WMR |
| Daydream | Google VR |
| Ximmerse | Ximmerse SDK |
| HyperealVR | HyperealVR SDK |
- Developer / Designer: Omar (ITI T38 GD/GA Graduation Project)
- Engine: Unity 2018.1.5f1
- VR Framework: VRTK โ Virtual Reality Toolkit
- SteamVR Plugin: Valve SteamVR Unity Plugin
- MIDI Playback: MidiPlayerTK
- Oculus SDK: Oculus Integration