Slicegame


The Slicegame is my attempt at implementing a Beatsaber-Style Rhythm-Game. It explores Unreals Harmonix Plugin for parsing Midi in Metasounds and Geometry Script for real time boolean operations.

Given a Midi File, the system in BP_DynamicObjectSpawner spawns instances from the class BP_DynamicHitObject (the thing you want to hit) on a 3x3 Grid, moves them towards a location over time so it’s always at to correct location (PlayerPosition + ArmLength) on the beat. The Midi also encodes from which direction the HitObject should be hit and saved in an Enum in the class during spawn.

Midi Setup in Reaper

Midi Setup in Reaper

Correct Hit detection to me several approaches, its a bit tricky because while our objects (or rather their hit indictors) don’t move relative to the character, their angle to the player does change when the objects move from front to back while the player forwards or sideways. The hit detection therefore needs to take the characters view vector into account. From there, you can create up and right vectors and compare them direction of the sword via the dot product.

In Class : BP_DynamicHitObject | Function: GetHitType

As both velocity (sword is wiggly) and impact normal (surface doesn’t always point in hit direction) vectors you can get from the hit event turned out to be rather unreliable for detection sword direction, I went with sampling the impact point on hit, attaching that point to the sword by converting the location into the relative space of the sword. After a short delay, that point, virtually attached to sword, has moved. By converting that point back to world transform, we can calculate the direction by subtracting hit location and delay sampled location. This works quite reliably.

In Class : BP_DynamicHitObject