[REL] PA Stats (Decommissioned)

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

  1. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    PA Stats is no longer available.

    Check out http://pastats.com

    It in short offers detailed tracking of game statistics like resources and your army composition.
    Data is available on pastats.com as well as via webservices.

    PA Stats is also on github.
    The server: https://github.com/pamods/PA-Stats-Server
    The ui-mod: https://github.com/pamods/uimod-pa_stats

    It works with an ui mod for PA that sends game data every 5 seconds to the server.
    The mod is loaded from the pa stats server while you play, so you will get updates automatically. I will also try to disable the mod when patches hit that break it so if PA Stats suddenly seems to be gone after a patch I probably disabled it and am working on a fix.

    How to install:
    http://pastats.com/pastats/download

    A few notes:
    - I am still working on more functions and improvements
    - Games that are shorter than 5 minutes are automatically deleted a few minutes after the last data was reported, if they do not have a winner
    - The charts update automatically if the game is still running, you can uncheck the live-option in the settings under PA Stats to prevent your games from showing live data.
    - Any ideas to improve this are welcome :)

    Replay link info: https://forums.uberent.com/threads/rel-pa-stats-64498.50690/page-23#post-918834

    Webservices: PA Stats has accumulated a few webservices that some external parties use to query data. You are free to use them for whatever purpose.


    Get the system json for a game:
    http://pastats.com/report/getsystem?gameId=88825

    About stuff like events and winners:
    https://forums.uberent.com/threads/rel-pa-stats-62857.50690/page-10#post-845689

    General chart data:
    http://www.nanodesu.info/pastats/report/get?gameId=73763

    Query the 1v1 games between 2 players by player id, a start time of the game and a duration of a timespan from the start
    https://forums.uberent.com/threads/rel-pa-stats-62857.50690/page-19#post-898178

    display_name/uber_name > PA Stats player_id
    https://forums.uberent.com/threads/rel-pa-stats-62857.50690/page-18#post-894676

    json of all games with id, start time and some info on reporters. Careful, bigger than 1mb by now:
    http://pastats.com/report/games

    Thanks to:
    Server and Domain sponsored by www.goscripting.com

    dreuffek for his work on the system view

    oxide246 who made an initial mod very similar to this: https://forums.uberent.com/threads/defunct-live-game-stats.49753/

    Gunshin for adding the ingame stats at the end of the game (which by now are replaced by Uber...)

    Raevn for his mod manager that enables easy distribution of PA Stats and other mods

    You for using PA Stats
    Last edited: August 16, 2016
  2. Clopse

    Clopse Post Master General

    Messages:
    2,535
    Likes Received:
    2,865
    Great work man, if both players were using this mod could it be possible to show both stats in the replay? Or is this crazy difficult to do for something that may be implemented in the near future.
    carlorizzante likes this.
  3. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    the values of the time-axis are not exactly the same (don't ask me how much they are off, I *think* less than 10s, tests are welcome) as the time-value ingame, so it would be probably hard to make it match up by the second.

    I have the idea floating around in my head to display the resource stats of players while the game runs in kind of the same way you can see them in the game, so as observer you can watch the stats while watching the game, but I am not sure of how helpful that would actually be, as there is a delay of 15s or so between the game and the chart updates. I probably could push that down to maybe 5s or so, but it would still not be totally live. Such a display could also easily be embedded into the game if I should decide to go for it.
  4. oxide246

    oxide246 Active Member

    Messages:
    249
    Likes Received:
    30
    Hang on! I thought posting to external servers didn't work anymore, I've got to re-check my mod! I notice you're building a game identifier string similar to how I did, but a bit differently. How well is that working for you? I couldn't make that very solid on mine..

    EDIT: Commented to hastily

    Last edited: August 16, 2013
  5. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    How did you come to that conclusion that sending data to other servers doesnt work anymore?
  6. oxide246

    oxide246 Active Member

    Messages:
    249
    Likes Received:
    30
    My mod just stop working, posting via AJAX wasn't hitting my success or failure callbacks. Maybe there was another error which I wasn't seeing because I didn't have the dev tools at that time.
  7. kryovow

    kryovow Well-Known Member

    Messages:
    1,112
    Likes Received:
    240
    hehe the game between colin and eric shows how much more metal is wasted than mass in supcom. I wonder why the PA eco behaves like that^^ In SupCom you could quite easily waste less than 5 mass in a whole game^^
  8. Clopse

    Clopse Post Master General

    Messages:
    2,535
    Likes Received:
    2,865
    Yeah same in TA. If you waste more than 3 metal it's considered bad. The commander giving +10 means that by the time he builds first building you probably have lost 30 mass. But because there is so much mass,fabbers and factories it's really difficult to try balance mass with them all. Well it is for me anyhows.
  9. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    I think that is mostly to the reason that the planets just have insane amounts of mass and players are often limited by their energy income.
  10. oxide246

    oxide246 Active Member

    Messages:
    249
    Likes Received:
    30
    Just tested the mod again with the dev tools. It was actually a javascript error caused by an update which I couldn't see without the dev tools. Uber renamed model.Players to model.players (lowercase p) and this caused my code to fatal just before the AJAX post... wondering if I should re-open my version now... hmm...
  11. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    If people should start using this I do plan on going on with development/support. So if you plan to further develop your version maybe we could coordinate a bit what kind of functions we do, so we are not completely redundant.
  12. oxide246

    oxide246 Active Member

    Messages:
    249
    Likes Received:
    30
    Yeah cool sounds good, first thought was to make a trimmed down version of mine just to provide the live eco bars for all players in-game for people observing. I'll have a bit more of a think what also could be useful. Although I have a feeling most of this stuff will be replaced by Uber stuff eventually. I'd kind of like to work on something I know will last. Will have a think.
  13. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Updated:
    - Much faster charts. They are missing a zoom now, they may get it back in the future.
    - The ingame mod now features an ingame display of your stats at the end of the game:

    [​IMG]
    [​IMG]
    credits for the extended stats at the end of the game go to Gunshin :)

    You need to download the updated mod to report games, older ones wont work.
    Also note that for the ingame stats to work you need to add a new line to your mod list:

    'game_over': [
    '../../mods/pa_stats/game_over/gameOver_stats.js'
    ],
  14. kryovow

    kryovow Well-Known Member

    Messages:
    1,112
    Likes Received:
    240
    I hope something like this will be standard in the game some time^^ so that you always can compare all players in the game. Good work though. If I start playing the game in beta, all mods I'm used to in FA will be there :D (at least similar ones)
    Quitch likes this.
  15. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    keeps working in 52168
  16. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Hmm, my method of determining who plays in what games seems to work IF no reconnects happen. In case of reconnects I lose the starttime of the game, which kind of breaks it all.
    Any ideas?

    @Uber: Could you maybe add a unique game id that is available in the JS? Or is there already one I just fail to find it?
  17. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    trippppppple post.
    Updated:

    To update just download and unpack as described in the first post, overwrite old files. Note that you need more mod list entries now. I recommend to use the mod manager.
    I found a "lobbyID" and garat confirmed that it indeed a unique identifier per game. The mod now uses that to identify games. Also games with only one players are now auto deleted and the mod doesnt report anymore once you have 0 units (so you dont report in games that you just observe)

    EDIT:
    I just tested this with Gunshin: The new ID detection works perfectly as intended. :D
    Last edited: August 18, 2013
  18. infuscoletum

    infuscoletum Active Member

    Messages:
    606
    Likes Received:
    37
    Can the game over stats can work separate? I know it's kindof a weird request, but maybe an "offline" version that includes the game over screen, and maybe a file that gets appended to listing those game over stats. Sortof a see how you're doing over different games kinda thing. A bigger request might be having a local game data viewer, with the mod saving the data as a kind of replay file.

    It's not that I care about data going to an external server.... more of a I just really wanna track my game progress and be able to go back over any and all of them without loosing them to server wipes.
  19. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    I do have a local testsystem ofc, however even that runs against a database that is hosted on the server. So no this cant be used offline very easily. I would need to package the server files with an embedded db all in an easy to handle application for that.
    With the latest build I introduced the test database for development, so I wont wipe the db in the development process anymore and I do plan to keep the data from now on. The server has roughly 30GB of free space for this, so it should be able to store quite a lot of stats.
    I think I can update that part of the first post: There wont be any server wipes anymore apart from the cleaning process for single player games and games below 5 minutes length.
    Unless a mistake from my side happens ofc, as at least currently I dont have a backup of the data.

    EDIT:
    The pure display of the game over stats surely can be implemented easier, however currently the game over stats are pulled from the server, they are not stored locally. As any PA player currently always has an internet connection I don't think it is worth the extra work, as I expect the stats screen to work by itself once Uber enters a phase where they release the server.
  20. infuscoletum

    infuscoletum Active Member

    Messages:
    606
    Likes Received:
    37
    Makes sense:cool: Figured I'd ask anyways. Installed it, so you might see the occasional vs. AI game with me wasting as much metal/energy as I can:p:eek::eek::eek::eek::eek::eek::eek::eek::eek::eek:

Share This Page