TF2 and Data

Discussion in 'Team Fortress 2 Talk' started by x6herbius, Nov 3, 2015.

  1. x6herbius

    aa x6herbius

    Messages:
    377
    Positive Ratings:
    271
    This term at university I have to do a data analytics project on some data set of my choosing, which got me thinking about what interesting data I might be able to collect from TF2/TF2Maps. This could include both data that's already collected and available (eg. map feedback) and data which I could collect myself (eg. querying the Steam API, tracking player scores by pinging servers, scraping HTML data, ...).

    Are there any interesting data sources we have that I might be able/allowed to utilise? One of the things I've been contemplating is whether there's any way to gauge overall player satisfaction of a map being tested from data that's available during a test, eg. how long players stay on the map, how many times they die, their kill/death ratio, how many points they earn, whether there's a particular skew in the distribution of points (one team dominating the other), and so on. Some of this (points, play time, etc.) I'd theoretically be able to collect from ping responses, but kills and other more in-depth stats would likely require writing a SourceMod plugin.

    Is this something that might be feasible? Is it something I'd need consent from players to collect, if it involves holding details that relate to their Steam accounts (total time playing TF2, etc)?
     
  2. Uncuepa

    aa Uncuepa

    Messages:
    777
    Positive Ratings:
    1,028
    tf2stats.net
     
    • Thanks Thanks x 1
  3. x6herbius

    aa x6herbius

    Messages:
    377
    Positive Ratings:
    271
    I had no idea that existed, but it looks really useful. I don't know how detailed the data would be, though.
     
  4. Fr0Z3nR

    aa Fr0Z3nR Creator of blackholes & memes. Destroyer of forums

    Messages:
    6,391
    Positive Ratings:
    4,906
    Always thought it could be cool to have a leaderboard for our servers. See who has the highest points, or the highest healing.

    Not so much data, as it is more a scorekeeper, but my 2 cents.

    @Geit would be the guy to talk to.
     
  5. Pocket

    aa Pocket func_croc

    Messages:
    4,489
    Positive Ratings:
    2,219
    Valve used to collect and publish all kinds of data on their official maps directly through Steam, but I think they've shut that down at this point.
     
  6. Geit

    aa Geit 💜 I probably broke it 💜

    Messages:
    597
    Positive Ratings:
    1,114
    http://heatmaps.tf/api.html - (there are going to be some breaking changes to the API over the next few weeks, but it'll be stable after that.)
     
    • Thanks Thanks x 1
  7. x6herbius

    aa x6herbius

    Messages:
    377
    Positive Ratings:
    271
    Aha, now heatmaps really were something I was looking forward to looking at! Are these run for every map or just specific ones?
     
  8. x6herbius

    aa x6herbius

    Messages:
    377
    Positive Ratings:
    271
    Where the heatmaps.tf API allows a query by damage bits, is the check done via a bitwise comparison or not? Ie. if I sent a query for all kills with blast damage, would the results returned be those with blast damage only or where blast damage was potentially combined with other types?
     
  9. Geit

    aa Geit 💜 I probably broke it 💜

    Messages:
    597
    Positive Ratings:
    1,114

    You can't (currently) ask the API to filter by damagebits, you can only filter by killer_team, killer_class and victim_class - If you want to filter by damagebits, just pull in all the data and filter it on the client side how you wish. I still haven't got around to doing my university work on the API, but I will be soon!
     
  10. x6herbius

    aa x6herbius

    Messages:
    377
    Positive Ratings:
    271
    Am I actually able to filter by myself? All I seem to get back is x, y and team.
     
  11. Geit

    aa Geit 💜 I probably broke it 💜

    Messages:
    597
    Positive Ratings:
    1,114
    you need to set the fields parameter to the data you want returned. It's a CSV field that accepts the following options:

    • id - The internal identifier for this kill
    • timestamp - The UNIX timestamp at which this kill occured
    • killer_class - The class of the killer (see Class Indexes)
    • killer_weapon - The weapon of the killer (see Item Indexes)
    • killer_x
    • killer_y
    • killer_z
    • victim_class - The class of the killer (see Class Indexes)
    • victim_x
    • victim_y
    • victim_z
    • customkill - The custom kill bits for this kill (see Custom Kill)
    • damagebits - The damage bits for this kill (see Damage Bits)
    • death_flags - The death flags for this kill (see Death Flags)
    • team - The team of the killer
    e.g. ?fields=damagebits,team,killer_x,killer_y,killer_z
     
    • Thanks Thanks x 1
  12. x6herbius

    aa x6herbius

    Messages:
    377
    Positive Ratings:
    271
    Awesome, I've been using that all wrong - I thought it was just a single parameter that you passed in to filter by. That's very much more useful!