1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-30 20:50:48 +08:00
Files
osu-lazer/osu.Game/Rulesets
T
Bartłomiej Dach cd4ab9307c Do not emit multiple consequent replay frames with the exact same data
With judgements occurring forcing emission of important frames, there's
the question of emitting redundant frames. In a majority of cases
still, a judgement *will* be tied to a specific user input, which means
that there's a high likelihood of duplicate frames, as one will be
emitted by the input change, and another by the judgement.

To a degree this is a pre-existing issue. The replay recording code
responds to both mouse movement and key presses by recording frames, so
depending on the intrinsic (basically undefined) ordering between
handling mouse move and key presses, it was possible for multiple frames
to be emitted with the same timestamp to the replay, each containing
partial input state changes (e.g. first frame with mouse position
changed, and the second with a key pressed).

The extent to which this increases the frame count will obviously depend
on the beatmap, but in my ballpark testing across all rulesets on a
single "relatively standard" beatmap (think no aspire chicanery), around
4-10% of frames can end up being duplicates / not meaningful. This has
implications both on replay size and on playback performance.

This commit therefore performs de-duplication of the frames based on
timestamp - only the last frame with a given timestamp ends up in the
final replay.

The CPU cost of this is negligible to the point of not being useful to
profile - it's a single condition gated behind a single float comparison
cd4ab9307c · 2025-05-16 08:40:07 +02:00
History
..
2025-04-28 15:52:31 +09:00
2022-06-17 16:37:17 +09:00
2022-11-27 00:00:27 +09:00
2023-06-24 01:00:03 +09:00