14 to 15 October · Can a phone recognise exercises?

Sharing the Move detection between prototypes

The code that recognises Moves was shared by the Move Lab and the Battle prototype, so a fix made in one also worked in the other. Test results were saved automatically.

The goal

Many Moves start in a similar way. Your arms can go forward in a squat, which can look like a punch, and getting down for a pushup can look like a jump. Making each rule stricter wasn't enough. The game also needed ways to choose between similar Moves.

What was tried

For the easily confused Moves, the detection waits about 0.2 seconds before counting. If a clearer Move appears during that time, it replaces the first one. Jumps need both feet to rise together and an upright body. Touch floor counts when you come back up. If you move closer or farther away, your standing position is measured again.

The developer tested in front of the camera and sent back the results, the event log and what they had noticed. Claude changed one rule, and then the developer tested again. Claude wrote these steps and the known problems down as instructions for future tuning.

When the first Battle prototype was made, detection was moved out of the Move Lab and shared by both pages. The Move Lab kept its controls for changing each limit, such as how far your knees must bend.

What went wrong

An early start screen wouldn't close. Later, a small label in the Move Lab had the same name as something MediaPipe used, which stopped MediaPipe from loading. Renaming the label fixed it.

The first Battle on the phone counted 25 squats and logged 16 that had just missed a limit. In those, one knee or the drop in the hips wasn't quite far enough. The rule now uses the average bend of both knees and needs a smaller hip drop.

What shipped

Near misses are now logged with the measurement that failed. Both pages send their results automatically, so nothing has to be copied from the phone. Battles also save after every round and when the page is hidden. If a Battle's results don't send, the phone keeps them and tries again later.

The drill and Monster mode controls, after the detection was shared.
The drill and Monster mode controls, after the detection was shared.Recaptured from the version of 15 October
Some of the limits that could be changed while testing.
Some of the limits that could be changed while testing.Recaptured from the version of 15 October
The Move Lab after the Battle rules gave each Move a job.
The Move Lab after the Battle rules gave each Move a job.Recaptured from the version of 15 October
Read the 12 code changes and 2 design notes