User:Winston/WIP/Collecting Gameplay Data

From Valve Developer Community
< User:Winston
Revision as of 16:11, 28 September 2010 by Winston (talk | contribs) (set up template guide. lots of work before it's worthwhile!)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Warning: 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. To do: 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. To do: expand this section

Recording data

Deciding which data to record

To do: write this section

Saving seperate game records

To do: write this section

Uploading data regularly

To do: write this section

Web server setup

To do: write this section

Collating uploaded data

To do: write this section

Scheduling this task

To do: write this section

Data processing and visualisation

Server-based or client-based?

To do: write this section

How to query the data

To do: write this section

Deciding what data to plot

To do: write this section

Handling extreme values

To do: write this section

Further considerations

Different game versions

To do: write this section

Security, data reliability

To do: write this section

Anything else?

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