open-manifold / Open-Manifold

A free and open-source clone of Rhythm 'n' Face for PC.
Other
10 stars 2 forks source link

Track level completion #30

Closed xen-0sd closed 1 year ago

xen-0sd commented 1 year ago

Right now, the game is a completely fresh start on each open. There is no indication that any levels have been played or beaten. I think it would be nice to put "Hi-score" and "FC%" (as in % of shapes not missed) values next to the song's genre and BPM information in the level select menu.

SalsaGal commented 1 year ago

Where would the game store this data? Probably a bad idea to put it in the level itself so that sending a level doesn't send you someone's score information. Maybe put it in one of the system configuration folders like %APPDATA% or ~/.config?

SuperFromND commented 1 year ago

Where would the game store this data? Probably a bad idea to put it in the level itself so that sending a level doesn't send you someone's score information. Maybe put it in one of the system configuration folders like %APPDATA% or ~/.config?

My intuition is I'd probably include hiscore data as a separate file in the same location as config.json (I like to personally keep everything "portable") and then use some sort of function to lookup a given level's hiscore when viewing something in level select. Not sure if that's the best practice, though.

I'm totally on-board with this idea though! Just not sure what the best way to go about implementing it is yet.

xen-0sd commented 1 year ago

My idea: Have a scores.json file in the root folder and read it at the start of the game like how it gets the MOTD.

SuperFromND commented 1 year ago

We're both proposing the same thing xen, haha.

As for how the file itself would be formatted, I'm thinking something like this maybe?

[
    {"level": "level folder name? maybe a checksum of the level.json?", "play_count": 5, "cleared": true, "hiscore": 6969}
]

And then display it on level select in the middle like this [new text annotated in yellow]: image

Frankly, the level select screen's metadata text could probably use a rearrangement anyways, it's a bit cluttery. Maybe a new issue is in order to discuss changes to that screen too.

SuperFromND commented 1 year ago

2023-07-15_17-45-37 High scores are now tracked when a level is completed. They're saved to hiscores.json, in the same location that config.json is stored. Not quite as information-detailed as I proposed, but hopefully good enough for now!

SuperFromND commented 1 year ago

I have updated the format and my three proposed stats are now fully implemented as of commit d9378be. 2023-07-17_10-38-19