forum

Scores.db - Empty string sometimes missing before timestamp?

posted
Total Posts
7
Topic Starter
Kolser
Currently working on a program that reads local map scores out of the scores.db file. I've played 2 beatmaps on a fresh install of osu! and started analysing those scores. I was wondering why sometimes, the empty string (as stated on the wiki) before the replay timestamp was missing, and sometimes was recorded.
This is what I mean:

Empty string missing, there are 8 bytes before the timestamp

Empty string is present, 9 bytes before timestamp

Anyone know the reason for this?
Topic Starter
Kolser
Bump
abraker
I'd like to know this too since I might be implementing scores.db reading sometime as well.

I noticed something roughly similiar happening with replays near timestamps, which makes me think the issue might be related, but it's a stretch. https://github.com/abraker95/ultimate_osu_analyzer/issues/32#issuecomment-594298440
Topic Starter
Kolser
Alright, so this looks like it's something that's deliberately implemented? I'm just going off some tests I've conducted and I might be completely wrong, but here's how to replicate the "issue":
  1. Play a beatmap
  2. Exit osu! before the score is recorded automatically into scores.db.
This forces osu! to record the score either way. Now if you look into scores.db, all the other scores should be missing an empty string before the timestamp. The way to restore the empty strings is launch osu! again, play a beatmap and wait a couple of minutes for the file to update itself with the new score (you might have to be logged into an account). All the scores will have their empty string back except for the last recorded one. It seems like the last score is always missing an empty string, but I'm not sure about this, it might just get updated with the empty string later or whenever it feels like it.
Also, I've looked at the issue with the replay files missing 0x0b, I think the replay file just got corrupted somehow? Or perhaps osu! was closed too early like we see with scores.db.
abraker
I was debating whether it is corruption. osu! is able to open both replays, and if it's able to that, there must be special logic handling that or otherwise it would fail. Since special logic is in place, it's prob expected and not corrupted.

I am leaning toward documentation in wiki not being 100% accurate
Topic Starter
Kolser
Well, I re-read through the wiki, and it says at the bottom that the individual score format of scores.db is the same as a replay format. So '0x0b 0x00' is actually the life bar, right? And here the life bar is empty, makes sense because we're not bothered about the state of the life bar in scores.db. Last score in the file is missing this string? Hmm, doesn't make much sense, but fine, it probably indicates the end of the scores file. But all the individual scores having their life bar string removed when osu! is abruptly closed? I mean that can't be intentional, since playing just 1 beatmap repairs scores.db back to all scores besides last one having their empty life bar strings (even if you do it offline, so it happens locally). Oh, and if you aren't logged into an account, then the life bar strings are missing completely from the file. I just wish the actual reason was stated on the wiki.

It also still baffles me how osu! is clearly able to read both score files and replays even without the 0x0b string indicator. Like, at this point the only thing it indicates is whether the player is logged into an account or not.
abraker

Kolser wrote:

It also still baffles me how osu! is clearly able to read both score files and replays even without the 0x0b string indicator. Like, at this point the only thing it indicates is whether the player is logged into an account or not.
That's the thing. It's so baffling that it can't be a coincidence. The code must be aware of it
Please sign in to reply.

New reply