[REL] Super Stats

Discussion in 'Released Mods' started by flubbateios, April 9, 2018.

  1. flubbateios

    flubbateios Active Member

    Messages:
    109
    Likes Received:
    226
    Super Stats
    Super Stats is the community statistics tracker for PA Titans and Classic.

    PA Stats has been decommissioned and Community Stats probably won’t come out for a while and it’s about time for a replacement (although perhaps it’s a few months late).

    This mod is comparable to PA Stats although some features are missing and quite a few have been added.

    It reports information like your current units and economy to the server every 15 seconds as well as army, system and mod info.

    If you wish to launch a replay, copy the lobby Id from the Super Stats match page then paste it into the search box on the replay window and click load replay by id.

    Go to https://flubbateios.com/stats to see the stats!

    Unit Database with support for Legion and Equilibrium

    Github link

    Missing features & Disadvantages
    • No globe with engagement and structure locations
    • Support for old browsers
    • No startpa:// replay links
    • Much heavier frontend
    • Data sent less frequently
    • No live updates at the moment
    New features & Advantages

    Stats
    • Only one set of unit data and economy data per army – cleans up graphs and saves space
    • Switching between real time and in-game time on the match page
    • More graphs!
    • Armies can be hidden on graphs
    • Strategic & Build bar icons for unit data
    • All players get tracked as long as one person reports (stats will not show up for armies that don’t report but the game will show up on the players’ profiles)
    Mods
    • List of server mods for each game
    • Support for Legion & Equilibrium with tags in the games browser and Legion unit icons.
    Community
    • Casts can be added to games and casted games get a special tag
    • Tournament support – Games can be added to tournaments and they then get a special tag and they show up in the tournaments page.
    • Please contact me if you want to add tournaments/casts to Super Stats!
    Technical
    • Smaller match documents
    • Web sockets used instead of HTTP POST
    • Smaller client mod (cannot confirm superior performance)
    • Nothing stored in localStorage on the client mod
    • Web socket API that has events for games starting and ending (with game information provided)
    Miscellaneous
    • Tags for community servers and ranked 1v1 matches
    • Tags for Titans/Classic
    • Looks more like PA!
    • Advanced Search
    • More satisfying buttons
    • Name with alliteration
    • Civilized date format (dd/mm/yyyy)
    Privacy Policy

    In accordance with mod privacy guidelines, Super Stats does not associate IP addresses with users but does have support for blocking IPs (in the event that the server is getting excessive requests). Nginx logging is on the default setting. As for tracking users that do not have Super Stats installed, only their games and display names are tracked; this could be accomplished through the replay feed so I don’t believe that this is an invasion of privacy. Super Stats tracks Uber IDs and display names.

    For custom server lobby ids, the part of the lobby ID that identifies the custom server is a truncated SHA-512 hash of its IP/hostname.

    Browser support

    Super Stats should work with most modern browsers. They must be ES6 compatible. Super Stats has been tested on the latest Chrome & Firefox but on no other browsers. A few features are broken on Edge and it is completely broken on Internet Explorer.

    Technical/Server Info
    • Scaleway C2S dedicated server (4c/4t Atom, 8GB RAM, 300mb/s connection, Paris)
    • Nginx 1.13.11/SSL/HTTP2
    • Nginx Amplify for monitoring
    • Latest nodejs
    • Percona MongoDB 3.4
    • Debian Stretch
    Known Issues
    • Units from lobs etc… aren’t counted (Not aware of a fix for this)
    • Server will break on newer mongodb driver (using legacy update function)
    • X-axis snapping is not working. See this issue for more info
    To Do
    • API Documentation
    • Tidy up frontend & server
    • Potentially make a ‘build script’ to avoid repeating code like game lists for easier updating
    • Show unit restrictions
    • Fix compatibility with latest mongodb driver
    • Add some more features for systems (taking feature requests)
    • Maybe get a dedicated domain
    • Update artwork
    If you find a bug or have a suggestion, please post here or make an issue on Github. There will probably be a few bugs left because I’ve only tested with a handful of people so far.

    Licenses & Copyright Notices

    Super Stats
    • These licenses do not cover third-party libraries and assets
    • Client mod is licensed under MIT
    • Server & Frontend are both licensed under MPL 2.0
    • Original assets are licensed under CC BY-SA 4.0
    JS Libraries

    Links to licenses are provided in most of the files

    Client Mod
    Server

    No libraries are distributed with the package. See package.json on github if you’re interested in the licenses of the dependencies.

    Frontend
    • jQuery, jQuery UI – MIT
    • D3.js– BSD 3-Clause
    • Billboard.js – MIT
    • Knockout – MIT
    • Knockout Mapping Plugin – MIT
    • Knockout jQuery UI Plugin – MIT
    • Moment.js – MIT
    • Lodash – MIT
    • PA CSS (/lib/pa.css) – MIT
    Assets
    • Legion strategic icons, build bar icons and icon - Strategic icons split into main part and shadow part – CC BY-NC-SA 4.0
    • Microphone and trophy icons (casts & tournaments) – Game-icons.net – CC BY 3.0
    • Source Sans Pro Font – OFL 1.1
    • Planetary Annihilation assets are copyright Uber Entertainment. All rights reserved
    Credits
    • N30N for help with strategic icons & testing
    • AndreasG, Pwn4Two, AcesOyster, MangoMango for testing
    • Cola_Colin for the original PA Stats
    Now on Community Mods.

    Have fun!
    Last edited: May 29, 2018
    theiban, NikolaMX, Clopse and 15 others like this.
  2. river39

    river39 Active Member

    Messages:
    160
    Likes Received:
    111
    i can't wait till i have completed support for this mod in the pa ladder. we will finally have a rating based on team games. got a list of things to do :)
  3. Quitch

    Quitch Post Master General

    Messages:
    5,077
    Likes Received:
    5,853
    I would recommend switching to an ISO 8601 date format of yyyy-mm-dd so you avoid any confusion.
    Last edited: April 9, 2018
    manlebtnureinmal likes this.
  4. river39

    river39 Active Member

    Messages:
    160
    Likes Received:
    111
    if there was a dislike button ....

    But flubb can always localize the date time format.
    tunsel11 likes this.
  5. grandhomie

    grandhomie Active Member

    Messages:
    150
    Likes Received:
    169
    Is it going to be for any team game? If that's the case I think we may end up with unbalanced games where some players don't want to balance the teams by fear of losing the game.
  6. river39

    river39 Active Member

    Messages:
    160
    Likes Received:
    111
    Initially yes for all games that are being reported to super stats. as it is hard to know if a game is balanced. but i'm also working on adding an average team rating in the lobbies. I might look in to adding a filter for unbalanced games. but this should balance out by it self as someone will no longer get points from winning games if the rating difference is to big.
    mwreynolds likes this.
  7. tunsel11

    tunsel11 Post Master General

    Messages:
    1,779
    Likes Received:
    1,137
    Civilized date format (dd/mm/yyyy)
    finally :thumpup:
    river39 likes this.
  8. davostheblack

    davostheblack Well-Known Member

    Messages:
    365
    Likes Received:
    313
    Nice 0ne, flubb
  9. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,125
    Likes Received:
    16,255
    Neat.

    If I remember correctly PA Stats used unixtimestamps internally and formatted them in the users browser using new Date() in javascript, giving the user whatever their browser thought was acceptable to them.
    grandhomie likes this.
  10. grandhomie

    grandhomie Active Member

    Messages:
    150
    Likes Received:
    169
    I derailed that thread a bit earlier, sorry. I've been playing with the website a bit and it's awesome, really nice job. Makes me wish I had saved my pastats data to see all the games I had played and the evolution of my play.
    Thanks!
  11. flubbateios

    flubbateios Active Member

    Messages:
    109
    Likes Received:
    226
    There have been a bunch of changes on the server and frontend to reduce the number of requests and to increase performance as well as a few quiet bug-fixes.

    APIs that list matches now have their documents formatted by the database rather than the webapp which seems to have had a profound increase in performance.
    [​IMG]

    The recent games page now shows fewer games per page but requests more games from the server.
    grandhomie likes this.
  12. flubbateios

    flubbateios Active Member

    Messages:
    109
    Likes Received:
    226
    I've updated Super Stats to add presence info through status messages. This must be enabled by the user either through settings or through the main menu button (OFF by default). You do not need to have the mod installed to see these presence messages.

    After the XMPP server dies, this commit will be reverted and presence will no longer be available.
    stuart98, grandhomie and acesoyster like this.
  13. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,363
    Likes Received:
    2,144

Share This Page