Code Monkey home page Code Monkey logo

basil's Introduction

BASIL

This is the code used to run the BASIL ladder.

Setup

  • My SC_DOCKER fork of SC_DOCKER has to be installed.
  • Make sure BWTA2 cache files are present (deployment of them seems to be buggy)
  • A Java Runtime has to be installed
  • Checkout this repo
  • Configure src/main/application.properties if required
  • Run ./gradlew run

basil's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

basil's Issues

Align with SSCAIT ELO calculation

According to MicroDK - SSCAIT uses

start rating 2000 and Until 30 games and rating under 2100: K-factor of 40. 
Rating below 2200: K-factor of 20. Rating at least 2200: K-factor of 10.

Which is what BASIL should use as well.

Add opponent chart on bot info page

It would be cool to be able to view an opponent chart with wins + losses (and the win rate) for each opponent on the bot info page similar to the map chart. You could do this for matchups with min. 30 or 50 games.

Disable bots if disabled on SSCAIT and last update > x months

Bots disabled on SSCAIT are currently not disabled on BASIL (otherwise tournaments on SSCAIT will also disable a major part of BASIL).
Yet, disabling bots should still be possible. Therefore, if a bot is marked as disabled on SSCAIT and not updated since a while, disable them for BASIL as well.

New game icons for zerg

I would like to propose addition of a new game icons for zerg late game units similar to what exists for BC/carriers, M&M and Arbiters:
creation of x infested marines
creation of x zerg guardians (could be the same as for BC/carriers)
creation of x zerg defilers (could be an icon for x amount of spellcasters eg. defilers, hightemplars etc.)
creation of zerg nydus canal

Also, I wonder why Basil has an icon for M&Ms? What is so special about that?

Request for Random Replay Selection

SSCAIT implemented at the bottom of their bots and results page a section which grabs 10 random replays from the last 7 days. It displays the ELO difference between the opponents, who the two players were (including race), date/time, and a link to the replay (with OpenBW link too). This random game list is updated either every minute or 5 minutes (I forget which), but you have to refresh to see the new list when it is generated.

This issue is to request something similar for BASIL. Having this type of random selection available helps with making casts for SSCAIT, especially with knowing the ELO difference (generally closer ELO is going to produce better games for casting). BASIL also has some bots active now that SSCAIT does not, so it would be nice to source games from BASIL in a similar fashion to sourcing them from SSCAIT.

Disable bots with winrate below x in the last y games since the last update

Some bots (currently ~10) have a very low win rate, some of them haven't been updated for a while.
They should be be automatically disabled in this case (default values):
Bot has a win ratio below 0.15 in the last >= 100 games since the last time it was updated.

If it is updated, it should be enabled again for the next 100 games (or more if it's win rate gets better).

Filter crosstable based on date

The crosstable will eventually include all games from the beginning of time, but this can be a bit misleading since bots are updated, bots have bugs and many bots use learning spending many games to find the best strategy.

I propose to add a filter where we can filter the crosstable by date so we only see the crosstable from a specific date.

Close Opposition Graph shows an incorrect curve

It appears that the plotted points use a percentage that is calculated on the previous point.
Example, McRave vs Dragon:
image

Starting at the point on July 23:
I am 1-4, but the curve shows 0%.
Then 1-5, curve shows 20%. This is actually 1/5 (previous point).
Then 2-5, curve shows 16.67%. This is actually 1/6 (previous point).

This looks like it's calculating the previous percentage rather than current.

JNIBWAPI bots aren't working properly

PurpleWave / Cheese Maven on Discord:
@Bytekeeper btw looks like JNIBWAPI bots (Tomas Cere, Soren Klett, ForceBot) aren't running properly. SSCAIT provides some JNIBWAPI dlls that SC-Docker probably doesn't
@Erxos4 / ForceBot probably knows more about that

Ability to sort winratio based on matchup.

I think It'd be very neat to have charts with winratios based on matchup.
For example -> http://basil.bytekeeper.org/bot.html?bot=Locutus

Just like the wins per map thing, there would be 9 charts for the different matchups. TvT , TvP, TvZ, PvT, PvP, PvZ, ZvT, ZvP, ZvZ. If the bot does not play Random only 3 charts would be used ofc. (Example TvT,TvP,TvZ)

This way you can see the strongest/weakest matchups for every bot which I think is very interesting aswell as the weakest/strongest race for bots like Chimerabot that plays all of them well.

Display the date & time disabled in the Reason field for bots disabled on BASIL due to being too long disabled on SSCAIT

Display the date & time disabled in the Reason field for bots disabled on BASIL due to being too long disabled on SSCAIT.

E.g. if the bot named "Middle School Strats" is currently disabled on BASIL and it became disabled on SSCAIT on 2018.12.30 and this is the reason why (or part of the reason why) it become disabled on BASIL at 2019.01.06 03:02:03 am then the "Reason" field for it in the "Disabled bots" table on the page http://basil.bytekeeper.org/ranking.html could say something like "Disabled on BASIL at 2019.01.06 03:02:03 am due to being disabled on SSCAIT on 2018.12.30". "Date Disabled on BASIL" could even be a separate column as "2019.01.06 03:02:03 am" (the Reason field could just say "Disabled on SSCAIT on 2018.12.30").

Note: as far as I know, BASIL only checks the status of the SSCAIT bots periodically (I gather it's about every 6 hours currently). The date disabled on SSCAIT should probably be the date (& maybe time) that BASIL detected that it became disabled on SSCAIT. As far as I know, the "Updated" date & time field on SSCAIT is not necessarily the date it was disabled - in some cases it might be an earlier date which is the date the bot's files were last updated (only the enabled/disabled flag was changed, not the "Updated" field value). This might happen if an SSCAIT administrator manually disables a bot by changing the enabled/disabled flag from Enabled to Disabled without changing the bot's actual files.

Show what race a random bot randomed

In the 24h recent games page, could we get an indicator of what race was rolled by random bots? Maybe this is really specific to my case, since my bot is part of ChimeraBot and I'd like to watch my games.

As far as I can tell, BASIL doesn't actually record the pre-selected race. Maybe this could be added? ๐Ÿ˜„

Add ability to see the full date range in charts

Add ability to see the full date range in charts. Currently it seems to only show the last month. E.g. add a button to zoom out to show a wider date range (or the full date range), and ability to drag horizontally with the mouse to zoom in.

Allow bots from "other" sources

There are no plans for a user interface for now. But it should be possible for BASIL to download a bot from another source.
Planned for now:
A "manual" bot source: Just a file where I add download links for bwapi.dll and the bot binary. It will then be automatically downloaded and setup and schedules for games.

Export elo history of all bots and all game results of the last 2 days

SQL template for 2d game list

copy (select r.id as "game_id", r.time, a.name as "winner", b.name as "loser" from game_result r join bot a on a.id = r.winner_id join bot b on b.id = r.loser_id where time > now() - interval '2 days') to '/tmp/game_2d.csv' delimiter ',' csv header;

SQL template for 2d elo history:

copy (select b.name, e.rating, e.game_id, e.time from bot_elo e join bot b on e.bot_id = b.id where time > now() - interval '2 day') to '/tmp/elo_history.csv' delimiter ',' csv header;

TODO: Change time format to epochSecond

Shows crashes since last update only

It's not very interesting to see all crashes. Shows crashes since last update only and total games should be won + lost. (The total games count was used to determine severe problems with BASIL itself in the beginning. It's good enough now.)

Add an additional map pool

In addition to the SSCAIT pool, add one that tries to follow the "official" pool with a delay.

Bots can signal (BASIL command) to use the "new" map pool if possible.
That means, if 2 bots are scheduled to play and both can play on the new map pool, a map from that pool will be chosen.
If one of the bots only supports SSCAITs pool, a map from that will be selected.
I expect this will affect ELO a bit, but not enough to warrant a second ELO.

Ability to sort crosstable according to a selected bot's best to worst opponent matchups

To make it easier to see which opponents a particular bot is weak against, in the crosstable, would be helpful if whenever you click on a particular bot name, it sorts the rows/columns of the table according to that bot's results (breaking ties using the original ranking).

I.E. if you click on a selected bot, supposing the selected bot's average win rate is 59.06%, it would show the bots that have the win rate >= 59.06% against it as top-most (& left-most) in the table, then the selected bot, then the bots that have the win rate < 59.06% against it as bottom-most (& right-most) in the table. Ties can be broken by magnitude if some bots have been played more than others (e.g. 8 - 0 then 7 - 0 then 9 - 1).

Game history data download

Currently, for game history data, the files available for download (e.g. via the FTP server) are only for the last 24 hours (games_24h.json). games results.json and games results - all games.json are no longer updated. Please can the older data files be made available for download (e.g. by FTP), as we discussed on Discord? JSON is fine, but if it's not easy to figure out what the fields mean or how they are coded, some clarification might be helpful (perhaps there is some kind of schema for it somewhere?).

Note: by "game history data", I am referring to: for each game, the date/time & bot names & races (and who won or whether it was a draw, and the reason e.g. draw because game didn't start) & crash/game timeout/bot timeout data & map & game time & replay details. And any other relevant info, e.g. I notice there are also now some icons relating to unit data on the "Last 24h" page such as "93 Queens".

Regularly create compressed archives of replays/files for each bot

I know it's easy with wget etc, but it is a bit time-consuming for a lay-user to download the replay files for a particular bot individually using a browser, especially because the game rate is high. It would be great if you could create a compressed archive of all the publicly-available files (e.g. replays, and perhaps crash/log files if you publish them) for each bot say each month or fortnight or week (i.e. only the replays since the last one). The compression might save your website some internet traffic / getting spammed with lots of requests from wget etc.

If you recall, I asked for this on Discord and you replied:

I'll consider it. But given the limited space on that machine it won't happen in there.
Maybe I can find a good place to but archives up, then I'll do that.

crosstable colors

Let the colors blend between green / white / red (white = 50%) instead of blending between red / green... it will be easier to read the numbers and look better. ;)

Auto-disable bots that crash/timeout > x in up to the last y games since their last update

Just an idea similar to #19 that you might want to consider, to automatically disable bots like PeregrineBot which currently appears to be only rarely crashing on SSCAIT but crashing a lot on BASIL.

Automatically disable bots that crash/timeout more than x in up to the last y games since their last update. Note: if there have only been less than y games since the bot was last updated then simply check whether it has crashed/timed out in more than x of those games. I propose using x=35, y=100. So, supposing it crashes/times out every game after an update, it would be disabled immediately after the 36th game. If it alternates between crashing/timing out and not crashing/timing out, it would be disabled immediately after the 71st game. Personally, I think the threshold rate should be greater than 25%, because it would be a shame to disable bots like Ailien, Florian Richoux.

Also, if the bot is subsequently updated on SSCAIT, the logic could also automatically re-enable it on BASIL, but only if the reason it was disabled on BASIL was because it crashed/timed out too much.

Add ELO to crosstable?

It's a bit difficult to sort at the moment as I'm adding the elo back into the crosstable after downloading it, and trying to make it line up takes awhile etc. with the disabled bots included.

Switch to tiered ladder

Just small idea I brought up on Discord:

  • Create multiple tiers, 12 bots each
  • Bot games are chosen within these tiers
  • Every n days, the top 2 will move up a tier while the bottom 2 will move down (maybe this should be decided by letting those bots play each other and distribute according to that)
    (aka similar to some sport leagues)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.