Behold! The return of official Cogmind leaderboards! (Patreon)
Content
They're alive! Mostly.
Unfortunately relying on a third party to handle the leaderboards clearly didn't turn out so well in the end, and with Beta 10 mostly done we really need to get official Beta 9 leaderboards up and running. Not to mention there are plenty of people out there who enjoy either aiming to rise through the ranks, or maybe just browse the leaderboards or other runs to see what others are up to. And of course with Beta 9's incredibly detailed new scoresheets there's even more to see in that regard!
So I've finally taken matters into my own hands, investing much of this week into rewriting the leaderboard system from scratch. The main goal is to build a system that's more versatile and robust than the original one we were using from 2015~2019 for Cogmind Alpha and through Beta 8. Internally the old one sucked, having been quickly scraped together for the tournament in 2015 with plans to eventually replace it when Cogmind reached 1.0, a milestone which we never really got close to despite years of progress :P. Plus it wasn't anywhere near compatible with the new scoresheets anyway, so with Beta 9 it needed to go.
I haven't made the new system public yet since it's not quite done, but there's already plenty to see, so let's take a look at it!
Processing
The source data used for the leaderboards are the runs downloaded from AWS in protobuf format via a backup system. Then I have a program which reads the archives and creates a database of the run data relevant to leaderboard purposes. To start, that program reads in a settings file with some basic instructions including what game mode to consider (0 = regular game), and which versions to include in the leaderboard.
I also added logging for the entire process, including a convenient summary at the end, to help spot any issues.
Some things you might notice in the log there:
- There's a customizable player ban list (sorry Valguris, I needed someone to test with and of course your score was up there around the top :P). There were some people banned from the old leaderboards for cheating, but we'll be starting from scratch here.
- There's also a customizable list for ignoring specific runs that we don't want on the leaderboard for whatever reason.
- Most importantly, the database supports incremental updating! This is really important when eventually working with a potentially huge number of runs, otherwise any time you want to compile leaderboards it takes forever for no good reason :P. So once we have leaderboards and another day has gone by with however many dozen more runs submitted, we don't have to go through thousands of runs again, just process the new ones against the existing database and look for things to replace. After all, we're essentially just interested in each player's best score for a given leaderboard, and data we've already looked at before isn't going to change that.
Testing
Before working on any of the web stuff, obviously it's better to make sure the system actually works without adding any extra layers of complication, so I did all my testing in an initial text version of the leaderboards.
Here I made sure things like banning, ignoring, replacing, and incremental updating features were all working. Success. (That data set I'm working with is all the Beta 9 series runs since last year until a few days ago.)
Output
For the web version, you'll see it's more or less like the original leaderboards (I did have to redesign the difficulty mode headers since their names changed):
To produce that I use a prewritten HTML template which the program reads in and inserts leaderboard data at specified points, resulting in a static HTML file that you can then access online. For example this fully-functional test version :D (again the test data is from a few days ago, so it's not quite up-to-date)
As usual you can click on a score to see the full scoresheet.
This week I've been posting about leaderboard progress on the patron Discord channel, where Zyalin shared this fun leaderboard art piece full of familiar faces :D
Of course it must be edited to account for the ultimate Cogmind (and all around rogueliker god): GJ.
Beyond the Leaderboards
But we don't just want leaderboards, do we? NO! We also need access to All The Runs. The way this used to be handled was by simply giving access to web directories storing every scoresheet, navigated via your browser's file browser. Not ideal.
Now towards the bottom of the leaderboards is the link to this version menu, from where you can access the complete run list for each version compiled into, once again, nifty static HTML pages. They're also prettier.
This actually started out as a basic white text page similar to what we had before, not really providing a whole lot of info on its own, then I realized we could increase the amount of data shown, add a little CSS styling, make it prettier, then make it even prettier again... Yeah, I just couldn't stop myself and now it's even more fun to browse \o/
Actually it's not quite done yet because I haven't had time to implement Yet Another Idea I had for it that would improve navigation and also just look better: Different shades of green for the scores depending on threshold :)
TODO
Haha, there's always more to do, isn't there!
- First and foremost would be access to multiple leaderboards, since the new system is also built to produce leaderboards other than that for the regular game, like this RPGLIKE sample using those runs from the recent data!
- Then it'll also be important to almost fully (if not fully) automate the entire leaderboard updating process, including all the meta steps. The old system could take a couple minutes to update, whereas this one will probably just be one click, or even just automate the click when I feel that's an okay thing to do :P (I tend to like glancing at the latest leaderboard before it goes public, just in case)
- Integrate the ability for me to manually add scoresheets to the database. Not sure when this would happen, but I'm sure some people would occasionally appreciate it.
- Decide what to do about challenge modes. These never really worked all that well with regard to leaderboards since you can mix and match them, and they're definitely not compatible with the new system, so I've left them off for now. Maybe they'll stay that way, I dunno...
- One thing we definitely want is patron-only leaderboards for special releases and prerelease otherwise not included in the regular leaderboards! I don't have any sample leaderboards for that at the moment, but I did have it produce full run data for 10X1 and 10X2, in case you're curious.
So yeah, there's still some work to come, but you can already play around with the leaderboards via the links above, and the rest will be out before Beta 10. (Though I still have to actually implement w8, which is not a tiny project in itself :P)