Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411921 Posts in 69432 Topics- by 58480 Members - Latest Member: panelo

June 11, 2024, 12:25:56 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Online highscores in an open source game
Pages: 1 [2]
Print
Author Topic: Online highscores in an open source game  (Read 4301 times)
NiallM
Level 1
*



View Profile WWW
« Reply #20 on: August 31, 2010, 11:43:06 PM »

The most reliable method of verification I've come up with is to record a replay of the game, and have the server play it back. This verifies that the high-score was actually achieved... Though it does not verify that it was achieved legitimately.
I did consider this, but my game has so many little random variables (dictating which way enemies move etc.) that replacing them with more robust, replayable versions would be a fairly major undertaking now.  Had I thought things through from the beginning, I think this would have been my first choice (albeit minus the server-side verification - just having the replay on the server would be enough that I could periodically check the highest scores myself).

This is incorrect.
Again, I think I worded things poorly.  I have been writing open source software for a long time now and am fully aware that as the copyright holder there is nothing stopping me from keeping part of my code closed (and effectively dual-licensing the binary and source versions).  What I meant was: this is not an acceptable solution for me.  I started this thread because I was looking for a way of including online high scores in a GPL-ed game with some kind of minimal protection against spam.  I should have made that clear from the start.
Logged

bateleur
Level 10
*****



View Profile
« Reply #21 on: September 01, 2010, 12:27:18 AM »

Another way to look at the problem is this: the end user is sending you the output from a program and you want to verify that this output is from a particular program.

I think it's reasonably obvious that the verifier part cannot be open source code that runs at the client end, since if it were the user could always replace it with an alternate verifier that always concludes the output is valid.

Running a verifier at the server end is, as you have pointed out, a huge amount of work and we should therefore rule it out. Consequently the only remaining option is to release the game itself as fully open source but separately release a verifier harness which calculates a checksum of some sort for the game binary before running it and then encrypts the score before sending it to the server. To enable players to submit scores to your server (specifically) you would need to provide a precompiled instance of the verifier. (Maybe one for each platform in the case of a potentially cross-platform game.)

Note that although the verifier must be precompiled for any specific server it need not be closed source, since all that is required is that the verifier takes as a compile-time parameter the key required by the server it is authorising communication with.
Logged

Core Xii
Level 10
*****


the resident dissident


View Profile WWW
« Reply #22 on: September 01, 2010, 04:55:57 AM »

I did consider this, but my game has so many little random variables (dictating which way enemies move etc.) that replacing them with more robust, replayable versions would be a fairly major undertaking now.

Computers can't actually generate random numbers, only pseudo-random ones. And pseudo-random number generators are deterministic. You save the seed with the replay, and every random number you generate will be the same. Thus, you get "randomness" that's the same every time (you want).

Most applications use the Mersenne twister.
Logged
NiallM
Level 1
*



View Profile WWW
« Reply #23 on: September 01, 2010, 11:02:02 AM »

Computers can't actually generate random numbers, only pseudo-random ones. And pseudo-random number generators are deterministic. You save the seed with the replay, and every random number you generate will be the same. Thus, you get "randomness" that's the same every time (you want).

Most applications use the Mersenne twister.
Shocked That's such a simple solution!  It would have never even crossed my mind Embarrassed.  And it'd only take a couple of tweaks to my RNG class to make it workable.  I'm now seriously considering adding replays to my game (of course I now also want to add a spiffy replay viewer letting you speed up and slow down the action etc.).  Thanks!
Logged

Riley Adams
Level 5
*****


I don't actually use Ubuntu much...


View Profile
« Reply #24 on: September 03, 2010, 06:11:03 PM »

I've been thinking about this sort of thing a lot lately. For the Ludum Dare before last I made a surprisingly addicting little game ("Island Hopping"), and post-compo I made a few tweaks and added quick high score table using mySQL and a shared website/server.

In the past 3 or 4 months the game has had a bit over 900,000 recorded scores, and probably 4 or 5 "hackers" (well, different usernames at least, maybe it's one dedicated loser) that filled the top 10 lists with bogus scores.

I think/hope that these were simply from a glitch/exploit in the scoring system (after all the bulk of it was coded in 48hrs, it has its share of bugs... and some of the "hacked" values seemed way too random to be intentional), but I'm not 100% sure, it is possible someone decompiled or some craziness like that to get ahold of the sql access stuff...

I've been working on a rewrite/upgrade of the game and this time I'm going to be obfuscating the heck out of everything, and adding various checks for feasibility before anything gets entered. After reading this, I might also add some sort of simple replay thing...
Logged

Pages: 1 [2]
Print
Jump to:  

Theme orange-lt created by panic