wise-old-man
wise-old-man copied to clipboard
More granular achievements
It would be nice to have more granular achievements for lower level players before 99. They could be every 10 levels starting at 40 or so for individual skills or important milestones (e.g. 85 slayer).
Longer term it would be nice to be able to verify an account and set custom achievements.
Use Case: With the release of group ironman I would like to have the discord bot announcing my group's achievements as we progress even early-mid game.
The only thing stopping us from adding more achievements is database size, you can imagine how quickly it would fill up if every 10 levels of every skill had an achievement, multiplied by 350k players, and it would only increase everyday.
Could be done, but some thought would have to go into managing that
As an example, let's say the average player has level 50 in all skills, that's 5 achievements per skill, for 23 skills, for 350k players, that's a quick 40M database entries.
And if you get bosses involved, that's 40+ bosses, it's a lot, unfortunately.
So we did some maths on the Discord, and there are a lot of savings to be had with how the data is stored.
Currently, the achievement table stores the name of the achievement, the metric it needs to look up, and the value it's checking against. All of this is static data, so it could be moved over to its own static table. This would drastically reduce the amount of space each row takes up (up to 97% if postgres bad, 83% if postgres sensible). It could be replaced with a smallint FK, as 32.7k total unique achievements seems relatively reasonable (and the negative numbers could probably be used too for another 32.7k) Postgres docs aren't exactly clear about how much space a varchar takes up when empty, so there are a couple of guesses.
As an example, the worst achievement for space is the 100 Chambers of Xeric Challenge Mode one, due to the sheer width of the metric and display names.
Current (Best Case, postgres doesn't allocate extra space): 84 bytes per achievement row Current (Worst Case, postgres allocates all varchar space): 530 bytes per achievement row With a static table and smallint FK: 14 bytes per achievement row
This 14 bytes would also be consistent across all types of achievements, as no matter what the text for the achievement is it'll be in another static table (again, assuming allocation stuff)