Anti-Cheat in Phone Shake Games: Filtering Fake Shakes
Anti-cheat in a phone shake game sounds like overkill until you watch a six-player round end on a table slam. The phone never moved. The accelerometer still spiked past 14 m/s². The player who slammed the table won the point, the other five booed, and the host paused the game to argue physics. This post breaks down the three cheat patterns we filter inside ShakeGasm, the impulse math that separates a hand shake from a hit, and the live scoring loop that decides which events count.
What counts as a fake shake
A real shake is a sustained motion event lasting between 180 and 420 milliseconds with peak acceleration between 11 and 28 m/s² on the dominant axis. Anything shorter or sharper is suspect. Three patterns show up in roughly 8 percent of competitive rounds based on anonymized telemetry from 312,000 events logged in May 2026. Table slams account for about 4.1 percent of flags. Phone drops onto a couch or pile produce another 2.3 percent. Direct device hits, where a player taps the phone against a hard surface, sit at 1.6 percent and are the easiest to detect.
The line between a real shake and a fake one is mostly about duration and recovery shape. Real shakes have ring-down: a tail of decaying oscillation as the wrist decelerates over 80 to 160 milliseconds. Slams and impacts cut off in under 30 milliseconds because the phone has nowhere to ring down to. The hand absorbs the shake. The table does not.
The three sensor signatures we flag
We log raw IMU data at 100Hz across both accelerometer and gyroscope, then run a five-tap window over the last 50 samples. Three signatures get flagged before they hit the scoring queue.
- Spike-and-flat: peak above 22 m/s² with the next 40 milliseconds reading below 3 m/s². Classic table slam.
- Single-axis dominance: more than 92 percent of the impulse on one axis, common when a phone is whacked against an edge rather than shaken in three dimensions.
- Gyro-silent impact: acceleration peak above 18 m/s² with rotational velocity below 0.4 rad/s. A real shake rotates the wrist by 0.8 to 2.4 rad/s.
Any single flag drops the event into the review path. Two flags inside the same window auto-reject. The player sees a soft pink toast on screen reading "shake too sharp, swing it out next round" and loses no points.
Table slams vs real shakes: the impulse math
The clearest discriminator is the integral of acceleration over time, also called impulse. A hand shake lasting 280 milliseconds with average 16 m/s² produces an impulse around 4.48 N·s per kilogram of phone mass. A table slam peaks at 26 m/s² for 22 milliseconds, which sounds violent on the raw chart but only delivers 0.57 N·s per kilogram. The peak is five times higher on paper while the energy transferred to the device body is eight times smaller.
That ratio is what the ShakeGasm scoring core watches. We multiply impulse by ring-down length and divide by peak height. Real shakes score between 0.18 and 0.42. Slams score between 0.008 and 0.04. The gap is wide enough that the check runs in under 1.2 milliseconds per event on a four-year-old iPhone 13.
Peak acceleration is a bad cheat signal on its own. Impulse multiplied by ring-down length is the honest one.
How we score and reject events live
The scoring pipeline runs in three stages and finishes inside the 16 millisecond render frame on a 60Hz display. Stage one buffers the last 500 milliseconds of IMU data into a ring buffer. Stage two runs the spike-flat, axis-dominance, and gyro-silent checks in parallel using a single SIMD pass on iPhone and a NEON pass on Android. Stage three computes the impulse score and either accepts, soft-rejects with a hint, or hard-rejects with a brief animation that swaps the round counter to a thin pink stripe.
The hint matters more than the rejection. Players who get one "shake too sharp" toast in a round shift to a wider arm motion 71 percent of the time according to session replay data from 4,800 games in the last six weeks. Players who get hard-rejected with no explanation rage-quit at three times the rate. The tuning lessons from our shake threshold build log carried directly into how we phrase the hint and how often we surface it.
There is one edge case worth calling out for hosts. A player resting their phone on a bouncy couch and bouncing the cushion will sometimes produce a passable impulse curve because the foam adds its own ring-down. We added a ground-frame detector last week that flags any event where the device orientation stayed within 4 degrees of horizontal for the full 500 millisecond window before the spike. Couch bouncers get the same soft toast as slammers. The fix shipped in build 2.41 and brought the false-accept rate from 1.9 percent to 0.4 percent over the first 9,200 events tested.
What this means for hosts and players
A host running a round at a house party or a wedding does not need to police anyone. The phone does the policing. The point of building anti-cheat into a party game is not to catch villains. The point is to keep the round fair without dragging social energy down with arguments about who moved what. A pink hint is friendlier than a referee.
For players, the practical takeaway is small. Shake with the wrist and elbow rather than the whole arm pivot. Keep the phone in your hand rather than on a surface. Aim for a 250 to 350 millisecond motion with two or three direction changes. Anyone holding the phone like a maraca will pass every check the engine runs.
The full build log on this filter, including a 9-day tuning chart and the failure modes we hit on Galaxy S24 Ultra, goes up next week. Until then, the round design rules from our gyroscope and accelerometer post cover the sensor fusion side in deeper detail.
Stop reading. Start shaking.
Five stages. One climax. Free in your browser, free on Android — voice packs optional.
Play ShakeGasm now