User:Winston/WIP/Collecting Gameplay Data
Nothing helps with game balance as much as having access to good data on how people are playing it. While this article won't guarantee that the data you record is good or relevant, it will describe a method of collecting gameplay data from all players of your mod, into a central location. Ensuring that the data is good will be up to you.
Contents
Requirements
In addition to having access to the code of your mod, you will require a web server running PHP with SQLite3 enabled. This is enabled by default as of PHP5. You will need to be able to place a php file on this server, set up a scheduled CRON job to run that file at regular intervals, and have enough knowledge of SQL, another high-level language (e.g. PHP, C#, etc.), and a graphing library such that you can plot useful graphs of this data. Your server must be able to handle enough simultaneous FTP connections as the number of game servers running your mod will generate.
Game server setup
Required libraries
The hard work of this setup will be handled by two seperate third-party libraries: SQLite to record, manage and analyse the data, and libcurl to transfer it from game servers to a central server.
SQLite
Overview
SQLite is a very lightweight SQL database engine, that can be deployed on a wide range of platforms. This particular guide is dependent on running SQLite both on your game servers and on a central web server.
Linking into your server.dll
See Using_a_SQLite_database_with_Source for details on how to achieve this.
libcurl
Overview
libcurl is a communication library that supports many different protocols. This guide will focus on using it for FTP, but you could easily modify the guide to use HTTPS instead, for example.
Linking into your server.dll
See Implementing_libcurl for details on how to achieve this.