[REL] PA Stats [86422]

Discussion in 'Released Mods' started by cola_colin, August 15, 2013.

  1. stormingkiwi

    stormingkiwi Post Master General

    Messages:
    3,260
    Likes Received:
    1,353
    No. You're just that good.
    mishtakashi and LavaSnake like this.
  2. zaphodx

    zaphodx Post Master General

    Messages:
    2,352
    Likes Received:
    2,409
    Well I've had a good run, but now I'm quitting PA to go play Starcraft. So long and thanks for all the fish.
    LavaSnake and ORFJackal like this.
  3. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,622
    Likes Received:
    691
    Hitchhiker's Guide reference! This is definitely going into my forums hall of fame!
    stormingkiwi likes this.
  4. stormingkiwi

    stormingkiwi Post Master General

    Messages:
    3,260
    Likes Received:
    1,353
    His name is a beeblebro away from the galactic president?
    LavaSnake likes this.
  5. cola_colin

    cola_colin Planetary Moderator

    Messages:
    12,114
    Likes Received:
    16,239
    released an update that fixes a few things, read the changelog on the page about it.
    i.e. the apm should be correct again

    EDIT:
    What I won't be able to fix is that the army composition can get wrong in larger games. This is because PA appears to just drop alerts in case of heavy load.
  6. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,622
    Likes Received:
    691
    Could you add an APM chart to the player pages on the site? It would be neat to see how my APM varies over games.
  7. cola_colin

    cola_colin Planetary Moderator

    Messages:
    12,114
    Likes Received:
    16,239
  8. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,622
    Likes Received:
    691
  9. ORFJackal

    ORFJackal Active Member

    Messages:
    287
    Likes Received:
    247
  10. cola_colin

    cola_colin Planetary Moderator

    Messages:
    12,114
    Likes Received:
    16,239
    There is data there now.
    Basically it locks away your data (units/graphs/hopefully everything) until the game is finished. If you however leave the game in some unforeseen way or it bugs or whatever your mod does not send the "unlock" message. In that case the game would stay locked forever. To prevent this there is a background task that periodically checks for ended games and unlocks all data in them. So it can take a bit of time until it is unlocked.
  11. ORFJackal

    ORFJackal Active Member

    Messages:
    287
    Likes Received:
    247
    OK, good to know that it works as designed. :)
  12. zihuatanejo

    zihuatanejo Well-Known Member

    Messages:
    802
    Likes Received:
    581
    I'm back after far too long, and I'm installing mods before I play a game! Glad to see you've put even more work into pastats, it looks great :)
  13. ORFJackal

    ORFJackal Active Member

    Messages:
    287
    Likes Received:
    247
    I have now started writing the mod (https://github.com/orfjackal/pa-mentor). Currently it reads the data from http://www.nanodesu.info/pastats/report/get and does some map-reduce to calculate the percentiles of those stats at each timepoint. Next I'll implement downloading new game data from PA Stats automatically, but it would be nice to have a web service for reading that information.

    Here are the web services (preferably JSON format) that I would need:

    - List of all games, somewhat like http://www.nanodesu.info/pastats/listgames It should have the following data: game id, game started time, last updated time (so that I can download only those that have new data). The list should be sorted and paginated so that newest games are first. Here's a example of what an "/api/games" it could look like:

    Code:
    {
        games: [{
            gameId: 14581,
            details: "/api/game/14581",
            started: 1388402727,
            lastUpdated: 1388403927,
            finished: false
        },
        {
            gameId: 14579,
            details: "/api/game/14579",
            started: 1388401947,
            lastUpdated: 1388403027,
            finished: true;
        }],
        prev: null,
        next: "/api/games/2"
    }
    
    - A web service for the unit created/destroyed events. The same data that is currently in the armyDataSource element on http://www.nanodesu.info/pastats/chart pages - I don't like scraping HTML. ;)

    - The same details about the game as shown on the top of http://www.nanodesu.info/pastats/chart pages. I'm the most interested in knowing who won the game, so that I can include only the statistics of winners into PA Mentor. The other details are a bonus.
  14. ORFJackal

    ORFJackal Active Member

    Messages:
    287
    Likes Received:
    247
    One question about the data in e.g. http://www.nanodesu.info/pastats/report/get?gameId=11919 - Is the "timepoint" value based on the server's clock or on the clock on each player's machine? I'm wondering whether the timepoints of different players are in sync and how to get the starting time of the game, so that I can convert those timepoints to be relative to the game's starting time.
  15. cola_colin

    cola_colin Planetary Moderator

    Messages:
    12,114
    Likes Received:
    16,239
    All timepoints are based on the server time. In first versions they were indeed based on the players machines, until somebody reported data with a clock that was 10 minutes off ;)
    So yes they are in sync and a min and max of the points from a player should give you the exact moment that player started playing and finished playing.
    The start of a game is min of all points in the game, that's how all charts on the page itself work, too.
    In doubt this call is used to get "now":
    http://nanodesu.info/pastats/report/get/time


    So there are a few calls that come close to what you want already:
    http://www.nanodesu.info/pastats/report/winners?start=1386916400&duration=86400

    provides a list of all games withing the game timespan start + duration (in seconds, start is an unixtimestamp)
    who participated (players who do not use pa stats are reported as id = -1 and name "Anon".
    The call is meant for ladders, so it lists all teams in the game and the winner. Each team has an id, the game's have a field called winner that holds the id of the winner-team. Note that this call only returns games that were not vs AI and that in fact have a winner reported to them. Also note that only games of the last few weeks ...er since the beginning of december roughly... will be reported, as the function was only implemented recently and older games lack some data for this to work.


    http://nanodesu.info/pastats/report/get/events?gameId=11675

    Returns the data of the armyEventData source. In fact it is a bit more accurate I think and also contains x/y/z location-data about the events and a probably pointless event id. I somehow anticipated you would need this and I needed it for development, too;)

    I think generally you are probably only interested in data of finished games, so the winner list might be what you need as a list of games, as it only contains finished non AI games that have a winner. Is that correct?
    Last edited: March 24, 2014
  16. ORFJackal

    ORFJackal Active Member

    Messages:
    287
    Likes Received:
    247
    Yes. I think with those I can get all the data I need. Thanks. :)
  17. ORFJackal

    ORFJackal Active Member

    Messages:
    287
    Likes Received:
    247
    Here is a preview of the current progress:

    [​IMG]

    Basically I still need to implement just the automatic downloading of new games into the database. Then I'll install it on a server and release the first version.
  18. cola_colin

    cola_colin Planetary Moderator

    Messages:
    12,114
    Likes Received:
    16,239
    I'll be adding a game started-time to the webservice that returns the winners over the weekend, just so you know, ORFJackal.
  19. bobolieux

    bobolieux New Member

    Messages:
    11
    Likes Received:
    9
    Is there a way to make APM statistics divisible over an array of types of actions? I think a lot of interesting information could be gleaned about a player based on where the 100 APM was focused. It could be as simple as Combat, Fab/Building, and Camera actions graphed as separate APM lines.

    This would help to see the intentions of the players through the data - things like rushing and turtling would be obvious from just how the graphs appeared.
  20. cola_colin

    cola_colin Planetary Moderator

    Messages:
    12,114
    Likes Received:
    16,239
    The current apm capturing does not care what action results from pressing the button, it really only counts the button-presses. Capturing things like "gave a move command" should be possible, but would be an entirely new extension to it. So not quick to do.

    EDIT:
    Things like "turtle" or "rush" should be clear from the things build though.

Share This Page