Implementing Online Leaderboards for indie windows PC Game

| | August 8, 2015

I’ve just finished my game and I’d like to add some ranking functionality to it. I have a mySQL database running on my website and want to be able to insert and retrieve data from it. My knowledge in server side programming is basic to none and I’m wondering if you could provide me some tips on how to approach this. My game was developed in C++.

1) Should I look for I library written in C/C++ that handles this client/server communication directly?

OR

2) Should I implement it through a script (say python) and somehow interface it through my C++ code. By interfacing I imagine I’d call .py passing in a string as argument, and somehow receiving a string as return. (table entries, error messages, etc). Also I don’t want anyone messing up with the database. I don’t know, the source code would be there with connection authentication and I assume anyone knowing python could adjust it to inject any value in the database. Well, If that is a good approach what libraries could I use to interface C and Python (or any other say Java).

2 Responses to “Implementing Online Leaderboards for indie windows PC Game”

  1. Have you thought about using an existing service to handle your online leaderboard ?
    If you want to focus on your game this might be a better idea.

    I think Scoreoid would be particularly suited for your usecase, it handles hosting, user authentication, https security…while still giving you the freedom to implement your user interface and features the way you like (it’s a rest HTTP based service so all client code is implemented by you).

    I was looking at Scoreoid for an Android online leaderboard (post here) but it works on all platform which is quite nice.

  2. Write a script in perl, python, or some other convenient scripting language that processes a form which specifies the game, who won etc. You can develop and test this script using any web browser. Use a network package such as libcurl to submit these forms
    from within the c++ application.

    You will need to take some steps from the beginning to prevent fraud and accidents from trashing your rankings. For example, make your request include a md5 checksum to authenticate it and prevent altering the request, and keep track at the server to
    prevent the same request from being used twice.

Leave a Reply