- Home /
Making a Top 10 score page
I was wondering if any out there has made a "Top 10" page? The problem I am running into now is that I have named profiles, which keeps the player's sex, best time to complete a level and their current level. In order to check the data from other users I would have to search all of the other profiles and check to see if the player's new time should appear on the top 10 list. I figure this approach would be very lag heavy. Does anyone know of a simpler solution to this problem?
Answer by jashan · Jul 21, 2010 at 08:20 AM
I'm assuming that you have a database running in the backend for that, and in that case, unless you have very massive amounts of users, doing a little select for that shouldn't hurt too badly. If it does, you could help yourself with the right indexes.
If that still doesn't help, you could simply keep a separate table into which you store the result of the main query maybe every few minutes and then get your data from there.
Have you seen the entry about high scores on Unifycommunity Wiki: Server Side Highscores. While this is different from what you need it still may give you some nice inspirations.
Answer by Eric5h5 · Jul 21, 2010 at 12:01 AM
Wouldn't you just check the 10th time? If it's not better than that, it wouldn't get into the top 10 anyway.
Exactly, I dont really see the problem with this. $$anonymous$$aybe check the fifteenth time (which isn't displayed) to avoid bugs when two people get into the highscores at the same moment.