Metrics in Valve's Steamworks API
May 2, 07:50 AM
So Valve has finally released some details of their Steamworks API , which I’ve been waiting to see for a while because they mentioned in their initial press release that you could track some player metrics with it. Here’s what they say you can track:
- INT – A 32-bit (signed) integer – e.g.: number of games played.
- FLOAT – A 32-bit floating point value – e.g.: number of miles driven.
- AVGRATE – A moving average. Your game tells the API the number of events that happened and the duration in which they happened (game time or real time, your choice). Steam merges this data with the previous average, storing the updated result (a floating-point value). For example, your game could track “Average Points per Minute” this way.
So this is good for defining a particular stat: “Okay, we’re going to track total number of shots fired over time with each weapon.” Or “accuracy over time with the shotgun.” Or “number of people you’ve recruited to your team.”
This is particularly good for defining achievements that are tracked over time: collect 25 tokens and get an achievement, or bring your win/loss ratio to 5:1 and get an achievement, etc.
What it won’t do is provide context: under what circumstances are people more accurate with a shotgun? Who’s been playing games with whom? How has someone’s statistics changed over time? Because it’s a straight-up logging system and not a relational database (I mean in execution, although technically it could be a database on the backend), it treats each event as an island.
However, for a basic achievements system, this looks pretty good. Kudos to Valve for helping bring metrics to the masses!