Tuesday, March 18, 2014

Statistics

Last week I worked on ways to obtain some usage statistics.

The server now accumulates statistics about how much network traffic is sent and received for each message type. I added a command /traffic to access this information from within the game. This should tell me where I need to optimize my protocol. So far it seems like move-messages and map-layout messages are the traffic users number 1 and 2.

Both leave some room for optimization. The move-messages send the coordinates in ascii-encoded floating point numbers with a precision much higher than needed. Two decimal places should be more than enough. And the map information is basically the whole JSON data as it comes from Tiled. That's a lot information the user is not meant to see. It can and should be redacted.

But I need real usage data by real players to say for sure where optimization is needed most.

Another method to generate statistics are web-reports. I created a system to regularly export data as JSONP files and save them somewhere. A website can then use javascript to import this data and output it in a presentable way. Currently I have a list of current players and a list of active maps with player count. The JSONP technique makes the data available to anyone. This is intentional; I would like to see what the community can come up with to beautify my data.

I am thinking about archiving these reports in the database too. That would give me access to historical data.

No comments:

Post a Comment