User:Winston/WIP/Collecting Gameplay Data

From Valve Developer Community
Jump to: navigation, search
Warning.pngWarning:this article is completely unfinished! It's little more than a vague outline.

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.

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.

Todo: expand this section

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.

Todo: expand this section

Recording data

Deciding which data to record

Todo: write this section

Saving seperate game records

Todo: write this section

Uploading data regularly

Todo: write this section

Web server setup

Todo: write this section

Collating uploaded data

Todo: write this section

Scheduling this task

Todo: write this section

Data processing and visualisation

Server-based or client-based?

Todo: write this section

How to query the data

Todo: write this section

Deciding what data to plot

Todo: write this section

Handling extreme values

Todo: write this section

Further considerations

Different game versions

Todo: write this section

Security, data reliability

Todo: write this section

Anything else?

Todo: decide if there's anything else that should go here