forum

Questions on parsing replays

posted
Total Posts
2
Topic Starter
Heiyami
Hi there, still new to the forums so I'm not sure if this is the best place to post this, but here goes.

I'm a newbie dev currently working on a a personal project of sorts. It's a web application that parses an .osr file and displays some additional, accuracy-related analytics. In doing so, I've run into a few things that I'm unsure about. I have tried searching these things, but I'm a little paranoid so if anyone could help me out, it would be greatly appreciated!

Circle Radius as a function of Circle Size, and its conversion to pixels


After a quick Google search, I found a reddit comment that gives the formula for CircleRadius in pixels as:

CircleRadius = (PlayfieldWidth/16)*(1 - (0.7 * (CircleSize-5) / 5))


This seems to line up with the wiki, so I'm fairly confident this is correct.

The same wiki page states that cursor coordinates are stored using x,y coordinates, where x is in the range [0, 512] and y is in [0, 384]. Would setting PlayfieldWidth = 512 and using the Pythagorean Theorem with the resultant CircleRadius from the formula above be a valid way to check if the cursor is on a note?


Regarding Replay Frames


So there are some important details regarding what others seem to call "Replay Frames" that I'm unsure about.

Keystrokes

Biggest question is whether Replay Frames capture KEY_UP events in addition to KEY_DOWN events.

Along a similar vein, how does it represent a key being held during a slider/spinner? Does it only store a KEY_DOWN and KEY_UP at the start and end of a held note respectively, and assume KEY_DOWN within this interval? Or does it store a series of KEY_DOWN frames at 60fps or whatever frequency?

I tried logging replay data and it seems like it's the latter. Here's a link to a log of Sendan Life on Hard.

It seems that keystrokes always appear in clusters of at least 5 separate lines, all of which are KEY_DOWN. I'm assuming this means that even a single tap for a circle object is "held" long enough to register as multiple KEY_DOWN events. This begs the question of what timestamp should be used in something like hit error calculation: earliest? latest? median? I would say earliest, but I seem to be getting incorrect associations.

Associating Replay Frames with Hit Objects

So this doesn't pertain exclusively to replays, but if anyone could offer some feedback on this part, it would be super helpful! :)

Essentially, I'm trying to associate each Hit Object with a Replay Frame, starting from the earliest. The Replay Frame must be within the Hit Object's hit window, and also must be within its circle. If no such Replay Frame exists, then I associate it with NULL (probably not the best practice, but I'm dumb).

Does that sound similar to how osu! does things, or am I completely off?


I think that's pretty much it. Thanks for your time! :)
abraker

Heiyami wrote:

Would setting PlayfieldWidth = 512 and using the Pythagorean Theorem with the resultant CircleRadius from the formula above be a valid way to check if the cursor is on a note?
Yes. The units in which hitobjects are saved and reported cursor position from replays are in same units, osu!px.

Heiyami wrote:

Along a similar vein, how does it represent a key being held during a slider/spinner? Does it only store a KEY_DOWN and KEY_UP at the start and end of a held note respectively, and assume KEY_DOWN within this interval? Or does it store a series of KEY_DOWN frames at 60fps or whatever frequency?


Look at the "z" field. A key is down when the bit is 1, otherwise it is up. There is no actually set frequency, just how much time has passed since last frame, indicated by the "w" field.

Heiyami wrote:

Essentially, I'm trying to associate each Hit Object with a Replay Frame, starting from the earliest. The Replay Frame must be within the Hit Object's hit window, and also must be within its circle. If no such Replay Frame exists, then I associate it with NULL (probably not the best practice, but I'm dumb).
I am not sure how osu! does it, but the way I did it in my replay analyzer is I had to replicate the gameplay rules a bit- keep track of hitobject's hitwindows, which hitobjects were hit (cursor clicked while being on hitobject), figure out if it was a miss, etc to correlate the replay to the map.
Please sign in to reply.

New reply