StatShare

From GTR-Wiki

This page is for summaring information about a statistics and rating system to help GTR players finding other players that have an equal skill level. It consists of two main parts: The StatServer and the StatClient.

StatServer

This server (now to referred as 'StatServer') maintains a database with the statistics of matches. It also stores information about each player. To authenticate users it stores a username and an AES encrypted password in the database. A user has to be set online by a login process (possibly SSL-backed HTTP authentication). With the authentication the current GUID will also be sent to the StatServer and is then mapped to the authenticated player until the logout or a timeout. First this account creation, login/-out process will be done over a internet browser, but that should move to the StatClient as soon as possible.

About each match the StatServer stores the following information:

  • for the whole match:
  • for each player, represented by his GUID:
    • awards
    • deaths
    • frags
    • the score
    • ping
    • time
  • for each team:
    • score

The statistics are received encoded in XML and the GUID is mapped to the player at receival of the information. The statistics are checked against a XML Schema to minimise cheating. It then is transformed by a XSL Transformation Stylesheet to SQL code that enters the information into the DB. The statistics receival and processing might be done in a buffered way to minimise response times.

Another important task for the StatServer is the rating of the players. After a specified time, maybe 5 minutes, the rating of the players has to be recomputed. This could be done by inserting it into the buffer that manages the statistics SQL statements. The algorithm has to be specified and implemented in appropiate SQL statements with the following requirements:

  • Winning against a player who is...
    • better should raise the skill level (which might be between 0.0 for the all-day looser and 1.0 for the all-time winner).
    • worse should lower the skill level.
  • Loosing against a player who is...
    • better should leave the skill level unmodified.
    • worse should lower the skill level.
  • Getting a draw (or near-draw) against a player who is...
    • better should raise the skill level.
    • worse should lower skill level.
  • All of these modifications should be proportional to the skill differences
  • In GameTypes like Many vs. Many DM or team modes the time a player was connected should be important too.
  • It might be good to integrate ping times too.
  • Awards are especially important in CTF.

Another function of the StatServer is to supply the statistics and ratings to individual players (their history) and maybe also publically. This should be generated in a XML to maximise reusability between browser-based implementation and the later game code integration. The skill level for a choosen GameMode/GameType should allow a player online finding other players for playing. It is a question if one or many players wait on a server to draw other players to them or if players can negotiate for a server. IRC integration would be an option by using direct chats and chat rooms. The platform will at first be PHP 5 together with MySQL 4.1, but because of the modular design using XML-technologies and minimal use of MySQL-specific SQL statements the effort to port it to other platforms/databases should be moderate.

StatClient

This is Code in Quake 4/GTR, that sends the statistics at the end of a game to the StatServer. It first will just be code that send the XML statistics to the server. Then it should authenticate the user for being online and later more can be integrated.