Let's take the Shi Sen puzzle. In it, you have one million possible boards (it's just a random seed, so don't get impressed). After you play a game, it logs the following into the high score table:
Your name, board number, time, and number of tiles remaining.
If you play a particular board (say board 1000) and solve it with fewer tiles than you did the previous time you played board 1000, then it'll replace that entry on the table with your new score. If not, it'll tell you that you already got a better score on a previous play.
These entries are stored in an XML file.
The problem is gonna be size. If there are one million (or ONE MEEEELION) boards, and you play two or three games a day during coffee breaks, that table and XML file are gonna get big and slow. And, having seen my target audience, these are games that people leave on their machines for YEARS, so the potential is that the table will get so huge that the game will either crash trying to load it or will get so slow with the saving and loading that you won't wanna play it.
The solutions seem to be:
- Make the number of possible boards smaller, like 1,000 or 10,000. While it'd be a marketing hit that you wouldn't have as many possible games, the practicalities are that you will never pop up a game and immediately say "Hey, I remember this layout".
- Keep the big number of boards, but throttle the size of the high score table to 200 or so entries, throwing out the worst score in the table when you make a better one. While this does fix the practical part, it does diminish the potential of saying "hey, let's see if I can get a better score on number 1000 than I did yesterday, as yesterday's score might not even be there for you to see.
- Only keep scores for boards where you eliminated all of the tiles. While very good players could still conceivably "clog the board" if you play the game constantly, it'll fill up much slower.
As an example, I'm looking at my favorite wargame, Slay by Sean O'Connor. Similarly to my games, it has 10,000 "islands" to defeat. The high score table only stores the 20 best entries (shortest number of turns before the enemies surrender) and does replace entries that are "on the board" if you beat 'em in fewer turns.
The difference, though, is that Slay doesn't have a true "perfect score". While there's a practical limit as to how few turns you can make before losing, there's no real concept of a perfect game.
Shi Sen, OTOH, has a perfect game. If you eliminate all 144 tiles on a board, you have played a perfect game. You can never do better than that.
I asked Shelly, and her response was to do whatever's least obtrusive because she uses the game as an executive time-killer and has no desire at all to ever try to beat the same board with fewer tiles and/or a better time. And, honestly, that's probably what I'll be dealing with for most of my audience. The competative types aren't gonna be playing my games. They're certainly competing in the Daily Puzzle arena, but it's about the most casual kind of competition you can imagine. We're talking anonymous 24-hour turns here :)
My current solution's gonna be a melange of all of all possible solutions:
1. Reduce the possible games to 10,000.
2. Throttle the high score list to only 100 or 200 entries, depending on performance.
I was gonna only store scores for perfect games, but doing so really won't affect performance. Non-perfect scores will be shoved off the board by perfect ones eventually, so there's not really a hit for having non-perfect scores other than the board will hit the limit sooner.
If at all possible, can you determine board difficulty mathmatically? If so, have 3 boards (each w/ a top 20-50) where you keep track of the top scores for each catagory. (Would also allow the user to choose a board difficulty, "Give me a easy board, normal board, hard board, any board")