User:Voidious/BedMaker

From Robowiki
< User:Voidious
Revision as of 03:05, 28 July 2015 by Voidious (talk | contribs) (cleanup)
Jump to navigation Jump to search

This is a utility I made for generating RoboRunner (previously, RoboResearch) test beds. I've manually created quite a few test beds with a similar process to this so I finally got motivated to make a tool to help me do it.

Download

Setup

It's a Perl script, so you'll need to have Perl installed. On any Unix/Linux system, you probably already have it. You'll need to edit a few things at the top of the file:

  • Location of Perl on the first line.
  • Location of your RoboRumble directory.
  • Your username and key for the RR Server Query API.

This is intended to run from your main RoboResearch directory, but doesn't have to be. If it is, it will copy bot JARs from the RoboRumble directory into the robocode_bots directory, and the -o option will let you output a challenge file to the challenges directory.

Just make sure the file is executable ("chmod 755 bedmaker.pl") and you should be good to go.

There is a blacklist near the top of the file to exclude bots that I've found throwing exceptions or running slowly, neither of which are good for testing. You can modify that list as you see fit, of course.

Usage

Usage: ./bedmaker.pl -n # -r <rumble> [OPTIONS]
    Create a randomized Robocode test bed from Rumble bots. If run from main
    RoboResearch directory, will also copy the chosen bots from RoboRumble
    directory into ./robocode_bots and (optionally) create .rrc challenge file.

    -n      Number of bots in test bed.
    -r      Which Rumble to use. Valid parameters: roborumble, minirumble,
            microrumble, nanorumble, meleerumble, minimeleerumble,
            micromeleerumble, nanomeleerumble, teamrumble, twinduel
    -min    Minimum APS for bots to include in test bed.
    -max    Maximum APS for bots to include in test bed.
    -ref    Reference bot pattern. If specified, the scores considered for -min
            and -max will be scores against the reference bot instead of
            APS in the chosen rumble. If multiple bots match the pattern, user 
            will be asked which to use.
    -o      Specify a filename to write the resulting challenge file to (will
            go under ./challenges directory). If omitted, challenge file will 
            be printed to the console.
    -f      Force defaults. If specified, no keyboard entry will be required,
            and defaults will be taken instead. For instance, if "-ref Tron"
            were specified, multiple bots would match and the user would be 
            asked to choose one; if -f is specified, the first match will be 
            used instead.

Usage examples

In case that's not totally clear, I'll go through a couple examples. First, a test bed of 10 bots from the top 100 (roughly) of the MiniBot Rumble.

./bedmaker.pl -n 10 -r minirumble -min 61.07
Fetching minirumble rankings... DONE.

  81.50%  rz.Apollon 0.23
  70.62%  dz.GalbaMini 0.121
  70.09%  kawigi.sbf.FloodMini 1.4
  69.26%  ags.micro.Carpet 1.1
  68.11%  cjm.Charo 1.1
  67.99%  apv.Aspid 1.7
  67.86%  kawigi.mini.Fhqwhgads 1.1
  66.14%  dz.GalbaMicro 0.11
  65.07%  robar.nano.Pugio 1.49
  64.17%  timmit.mini.TimVA 0.43
  AVERAGE SCORE: 69.08%
Is this test bed OK? (If not, I'll regenerate.) [y/n] y

Copying bot JARs from RoboRumble dir...
  Copied rz.Apollon_0.23.jar to ./robocode_bots.
  ./robocode_bots/dz.GalbaMini_0.121.jar already exists, skipping.
  Copied kawigi.sbf.FloodMini_1.4.jar to ./robocode_bots.
  Copied ags.micro.Carpet_1.1.jar to ./robocode_bots.
  ./robocode_bots/cjm.Charo_1.1.jar already exists, skipping.
  Copied apv.Aspid_1.7.jar to ./robocode_bots.
  ./robocode_bots/kawigi.mini.Fhqwhgads_1.1.jar already exists, skipping.
  Copied dz.GalbaMicro_0.11.jar to ./robocode_bots.
  ./robocode_bots/robar.nano.Pugio_1.49.jar already exists, skipping.
  Copied timmit.mini.TimVA_0.43.jar to ./robocode_bots.
Challenge file:
---
BedMaker Test Bed
PERCENT_SCORE
35

All Unformatted {
    ags.micro.Carpet 1.1
    apv.Aspid 1.7
    cjm.Charo 1.1
    dz.GalbaMicro 0.11
    dz.GalbaMini 0.121
    kawigi.mini.Fhqwhgads 1.1
    kawigi.sbf.FloodMini 1.4
    robar.nano.Pugio 1.49
    rz.Apollon 0.23
    timmit.mini.TimVA 0.43
}
---

Next, a test bed of 5 bots from the main 1v1 Rumble that beat Diamond.

./bedmaker.pl -n 5 -r roborumble -ref Diamond -max 50
Fetching roborumble rankings... DONE.
More than one bot in roborumble matched pattern: Diamond
  [1] voidious.Diamond 1.444
  [2] voidious.Diamond 1.432
  [3] jab.DiamondStealer 5
Which bot would you like to use? 1
Using reference bot: voidious.Diamond 1.444
Fetching details for voidious.Diamond 1.444 in roborumble... DONE.

  44.31%  darkcanuck.Holden 1.13a
  41.23%  davidalves.Phoenix 1.02
  44.58%  jk.mega.DrussGT 1.3.17
  46.13%  voidious.Dookious 1.573c
  43.80%  zyx.mega.YersiniaPestis 3.0
  AVERAGE SCORE: 44.01%
Is this test bed OK? (If not, I'll regenerate.) [y/n] n

Generating new test bed...
  38.91%  abc.Shadow 3.83c
  34.85%  darkcanuck.Pris 0.88
  41.23%  davidalves.Phoenix 1.02
  46.13%  voidious.Dookious 1.573c
  43.80%  zyx.mega.YersiniaPestis 3.0
  AVERAGE SCORE: 40.98%
Is this test bed OK? (If not, I'll regenerate.) [y/n] y

Copying bot JARs from RoboRumble dir...
  ./robocode_bots/abc.Shadow_3.83c.jar already exists, skipping.
  Copied darkcanuck.Pris_0.88.jar to ./robocode_bots.
  ./robocode_bots/davidalves.Phoenix_1.02.jar already exists, skipping.
  ./robocode_bots/voidious.Dookious_1.573c.jar already exists, skipping.
  ./robocode_bots/zyx.mega.YersiniaPestis_3.0.jar already exists, skipping.
Challenge file:
---
BedMaker Test Bed
PERCENT_SCORE
35

All Unformatted {
    abc.Shadow 3.83c
    darkcanuck.Pris 0.88
    davidalves.Phoenix 1.02
    voidious.Dookious 1.573c
    zyx.mega.YersiniaPestis 3.0
}
---

Feature ideas

There are lots more ways we could optionally filter bots, but I've only thought of a couple for now:

  • Blacklist - Specify a list of bots (or packages or string patterns) that will be ignored from consideration.
  • Or, conversely, a whitelist that will only consider certain packages.
  • Target APS: Instead of (or in addition to) specifying a min and mix APS/score, specify an average APS/score to aim for.