GNOME Bugzilla – Bug 509690
Online highscores for GNOME Games
Last modified: 2012-11-14 01:27:44 UTC
Online highscores would be a good addition to GNOME Games, I think. Most GNOME desktops are probably connected to the Internet, so submitting highscores to a centralized highscores database would be possible. As we have already "outsourced" the networking support in GNOME Games to GGZ, perhaps it would also be useful for others if such functionality would be implemented in GGZ? KDE Games and some other OSS games already has something like this. All games (except Sudoku) use the common highscores code in libgames-support, so there shoudn't be that much work modifying each individual game to an improved highscores system. One problem/challenge I see is to verify that the submitted highscores are valid and attempts at cheating. This is in particular a challenge because GNOME Games is open source. Is there good way to do this, eg. using cryptography?
Rankings are recalculated on the fly in the GGZ SVN version. In addition, a <toprankings> tag was implemented which can retrieve the top-N players for you. However, this feature hasn't been tested much yet and is likely buggy. There isn't even a ggzmod interface for it AFAIK. For the time being, only the ggz-community web interface is a good way to have a look at such statistics. A ggzmod interface for it should be added soon, hopefully before the snapshot release even. About cheating: I don't think it can really be prevented. The best way forward is probably to just say that we have to trust the players, and implement other community means (such a Karma systems) to sort out those who don't play fair. The current algorithm in ggz-community also incorporates the time since registration so that evil people don't get advantage of re-registering always again. But then again the value is only shown and not used yet for filtering out such players.
OK, at least the ggzmod interface has been added in GGZ SVN trunk now. Just like the rest of the rankings code it is totally untested and will eat your cat and the neighbour's cow along with it. http://svn.ggzgamingzone.org/trac.cgi/changeset/9543
This is by far the feature ranking highest on my wishlist for gnome-games :) We are past feature freeze so unfortunately this will have to wait until 2.23. I think there is very little we can do technically to avoid cheating. We could add clever things like cryptography, confirming the hash of the executable of the game, etc but in the end you can easily modify the source to work around stuff like this. I think the karma based solution sounds like a great way to do this. A more crackful idea could be to record the moves of e.g. a game of klotski and send the list of moves together with the score. That way the score can be verified at the server. It's probably a lot more work than it is worth tough... I'm all for giving the users the benefit of the doubt and trust that they don't cheat. If they do we can see if the karma system works.
We need to be specific in what you're looking for. Having all games played (single-player) be reported to a metaserver is rather easy. This is not something GGZ would do however. And it would not only easy to cheat, but easy to cheat en masse without even playing the game (i.e. if it's an XML metaserver you can just telnet in and report your fake scores by hand). Any game played on the GGZ server will be recorded. If the game setup is done properly this will record all highscores. It will include single- and multi-player games by default. Cheating will be less of an immediate issue here but modifications to the client are impossible to detect (whether this allows cheating may depend on the game implementation). Cryptography nor any other means will help.
>Having all games played (single-player) be reported to a metaserver is >rather easy. This is not something GGZ would do however. I think the idea of a "GGZ highscore metaserver" would be very interesting. This could be a new niche for GGZ. I would imagine that both gnome-games, kdegames and GGZ would be interested in having online highscores, and to me it seems like GGZ is the perfect place to implement it. I think it would be possible even for single-player gamer to send game moves to a "GGZ highscore metaserver", and calculate the score on that server. This would make cheating en masse more difficult.
We already have a dedicated XML-based highscore metaserver in playground, called GGZ Collector: http://svn.ggzgamingzone.org/trac.cgi/browser/trunk/playground/ggzcollector Like jdorje said, even though there are several protections against cheating involved, one could never rule out fake entries. On the other hand, I know of some games having submitted highscores to some SourceForge PHP page for some time now, with less protection, and it has worked without major incidents from what I know: http://ksirtet.sourceforge.net/stats.php?view=scores Anyway, such a metaserver for single-player games would only be a drop in the bucket, and we should spend most of our efforts on really good scoring support for game servers. Nevertheless I think that, cheating issues aside, having ggzcollector installed somewhere would be fun for the players of even dull games such as moon-buggy which only provide a system highscore at the moment. One could easily make it invite-only for friends, for example. Social networks are all the rage nowadays, even though it's supposedly easy to crack Facebook and its ilk every couple of months, these sites sell for millions and people flock to them in the billions. Or the other way around :)
GGZ Collector looks like a very good starting-point. Currently it acts like a proxy script to insert highscores into the matches table in the database, but not much more yet. - There is no authentication, as far as I could tell. ggzcollector doesn't actually check the player's GGZ username and password in the batabase before inserting it into the database. - I think that ggzcollector (or some webserver in the same package) should report highscores back to the game clients, so that after the highscore has been submittet to ggzcollector, a nice GUI will show how the submitted highscore compares with other highscores. - Good integration with ggzcommunity is important. - Using the Twisted library for Python could make it easier to write clients in other languages. - mysql support would be nice. As you say, ksirtet is a good example of how a online highscore system works in practice. Improving it, and making it more polished and userfriendly, then I think we have something which will be quite good.
Re-assigning to new default owner.
Now, I'll try to hack together a prototype for online highscores, like we talked about in the IRC meeting...
Please open against each game module if still appropriate.