[REL] Super Stats

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

  1. flubbateios

    flubbateios Active Member

    Messages:
    103
    Likes Received:
    240
    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
    • Civilised 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 DEV1-M VPS (3c/4gb RAM/300mbps/Paris)
    • Nginx 1.17.8/SSL/HTTP2
    • Nginx Amplify for monitoring
    • Latest nodejs
    • Percona MongoDB 4.2
    • Debian 10 Buster
    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: February 29, 2020
  2. river39

    river39 Active Member

    Messages:
    165
    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,885
    Likes Received:
    6,045
    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:
    165
    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:
    173
    Likes Received:
    188
    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:
    165
    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. davostheblack

    davostheblack Well-Known Member

    Messages:
    364
    Likes Received:
    313
    Nice 0ne, flubb
  8. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    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.
  9. grandhomie

    grandhomie Active Member

    Messages:
    173
    Likes Received:
    188
    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!
  10. flubbateios

    flubbateios Active Member

    Messages:
    103
    Likes Received:
    240
    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.
  11. flubbateios

    flubbateios Active Member

    Messages:
    103
    Likes Received:
    240
    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.
  12. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,328
    Likes Received:
    2,125
  13. flubbateios

    flubbateios Active Member

    Messages:
    103
    Likes Received:
    240
    Small update to add AI difficulty name reporting (not tested with queller but should be compatible). This data can only be accessed through the API at the moment.
    Some frontend updates will be coming soon™ (3-5 working months)
  14. Anonemous2

    Anonemous2 Member

    Messages:
    35
    Likes Received:
    58
    Very minor bug, but the striker icon is missing striker..PNG
  15. flubbateios

    flubbateios Active Member

    Messages:
    103
    Likes Received:
    240
    After about 5 working months, the frontend changes are out.
    This includes:
    • Mathboy19 CSS changes
    • Strategic Icon update to use SVG filters instead of splitting the strategic icon into two parts. This should make orbital SIs look a lot better but the colours are a bit off at the moment (looking into this).
    • Unit database updated for latest legion/equilibrium/base game
    • Stryker bugfix
    Quitch likes this.
  16. flubbateios

    flubbateios Active Member

    Messages:
    103
    Likes Received:
    240
    The Super Stats server has been 'downsized' to a Scaleway DEV1-M VPS. These VPS use AMD EPYC 7821 chips rather than the much older Intel Avaton Atoms which the previous server used which has lead to a significant improvement in CPU performance.

    The server now runs Debian 10, node 13.9 and nginx 1.17.8. The database has been updated from Percona MongoDB 3.4 & MongoRocks storage engine to Percona Mongodb 4.2 with the WiredTiger storage engine. Here are some Super Stats stats that I got whilst moving things over:
    • 68.5k matches
    • 18k unique players
    • 11 tournaments
    • 5.1GB database (uncompressed)
    More Super Stats stats to come!

    As a result of all of these changes & updates, loading times on the site should be somewhat improved on the recent games, player profile and advanced search pages.

    The future:
    • rewrite players list page because current performance is appalling
    • add support for non-community server feed custom servers
    • (not for a while probably) add spectator side reporting for many more complete matches
    If you cast games, please contact me on discord if you want to add your casts to super stats so they show up like this!
    Advanced search can also be used to find games with casts by checking the box and searching.
    upload_2020-2-29_3-33-14.png
    upload_2020-2-29_3-34-41.png
    Last edited: February 29, 2020

Share This Page