Next Previous Contents

## 7. Running simulations

There are several built in ways to run battles and tournaments, here we will go through them one by one.

## 7.1 Running normal battle simulation

    1. Make sure that the bots you want to simulate are compiled.
    In case they're not, load up the bot creator, load the bot
    source and press assemble. When the assembler tells you
    assemble successful the bot is compiled.

    Also, make sure the correct config file is loaded. Do this by
    firing up the config editor, press load existing config. Then
    load the correct config (the standard ones are under
    /usr/local/droidbattles/.. ), and then apply current config.

    2. Press start single battle.

    3. Press load and choose the correct .bot file

    4. repeat step 3 until all the bots you want to simulate are loaded
    (max 8).

    5. Choose how many battles the bots should go

    6. Choose the maximum time before a draw is called

    7. Choose the X and Y size of the battlearea

    8. If you want to run a team-battle, toggle the team-checkbox
       And then choose the teams for all bots (the comboboxes with values 1-4 in)

    9. Press OK

    Also, if you want to test your bots quickly as you edit them you can use the
    quick battle feature in the bot-creator. You need to configure the quick battle
    function once, but after that all you have to do is assemble the bot and press
    quick battle and your bot is in a fight.

    Also when running a quick battle a debugwindow with some basic info (register
    contents, mem contents etc...) is shown.

## 7.2 Running survival battle simulation

    A survival battle is started almost the same way as a normal battle. There are
    no team option in survival ,but there is a fast battle choice.
    No "number of fights" option but instead a number of lives.

    In actual combat the difference between normal and survival is that when you die
    in survival, you get your number of lifes decreased, and then (if you're not out
    of lifes) respawn, with a new fresh bot. The last bot with lives left wins. (Or
    if time runs out, the bot with the most lives left wins).

## 7.3 Running deatchmatch battle simulation

    A deathmatch battle is started almost exactly as a survival battle.
    Only, instead of "number of lives" you select "number of frags".
    That is, How many frags a bot should get in order to win (and the
    battle end).

## 7.4 Running league tournaments

    1. Make sure that the bots you want to simulate are compiled.
    In case they're not, load up the bot creator, load the bot
    source and press assemble. When the assembler tells you
    assemble successful the bot is compiled.

    Also make sure the correct config is loaded.

    2. Press start tournament.

    3. Press load and choose the correct .bot file

    4. repeat step 3 until all the bots you want to simulate are loaded
    (max 64).

    5. Choose how many battles the bots should go

    6. Choose the maximum time before a draw is called

    7. Choose the X and Y size of the battlearea

    8. If you have many bots in you might want to check the "fast battles"
       checkbox, in order to have the battles go VERY fast.

    9. Press OK

    In a tournament, the bots go one on one, and all bots in the tournament
    meets. This means that If there are 4 bots in the tourney, 6 matches will
    be played. Be warned that this number increases rapidly. If n bots are in
    the tourney and each match consists of f fights this formula applies:

    total fights = ((n^2-n)/2)*f
    for n = 16 bots and f = 5 fights this means:
    total fights = ((16^2-16)/2)*5 = 600 fights.

    For this, I have included the "fast battles" option in tournaments. The battles
    will go quite fast (on a fast computer that is), but you won't see much of the
    battles.

    The result of the tournament is NOT put out on the screen directly. Rather it
    is output to tournament.html in an HTML formatted table document.

## 7.5 Running KOTH tournaments

    KOTH tournaments is started in the same way as league tournaments.
    But the actual battles fought are different.
    In the first battle the two bots at the bottom fight, the loser is put
    on the lowest rank while the winner challenges the bot above.

    And so it continues, the winner in the battles continue moving up in the
    table and the loser stops in the table. This way a bot can in a single
    KOTH tournament run gain positions all the way to the top, but a bot
    can only lose one position in a single round.

    When all fights the way up to the top have been fought the results are
    written to two files: One HTML formatted file (Kothresults.html)containing
    the new table and the list of all matches that had been run in this round

    One file named currentKOTH.table which contains the current table and other
    options set in the start KOTH window.

    When you want to run the next round you should press "load list" button in
    the startKOTH window and select currentKOTH.table (or what you renamed that
    file to). and then all you have to do is press start and a new round is fought.

## 7.6 Running Cup tournaments

    Cup tournaments is started the same way as League tournaments.
    However, the number of bots must be either: 4,8,16,32 or 64.
    The actual battles fought are also different. The bots pair up one on one and
    fight. The winners go through to the next round, and the losers is out. This way
    it goes until only one bot is left (that wins). The results, with all battles
    fought is written to the file Cupresults.html.

## 7.7 Running in textmode

    As of version 1.0.5 it is possible to run battles and perform other operations
    in textmode.

    If you want to do something in textmode, the first argument to droidbattles must
    allways be -textmode (eg. run droidbattles -textmode)
    However, droidbattles in textmode is NOT an interactive run. All options for the
    operation you want to perform must be given on the command-line starting
    droidbattles.

    Possible operations are:
    -assemble <file> , example: droidbattles -textmode -assemble /home/bluefire/mybot.basm
    Will assemble the bot mybot.basm

    -check <file> , example: droidbattles -textmode -check /home/bluefire/mybot.bot
    Will check whether that bot passes the rules of the currently loaded config

    -loadconfig <file> , example: droidbattles -textmode -loadconfig /home/bluefire/light.cfg
    Will load the config light.cfg

    -battle <a load of other options>
    -battle is used to run a battle. The options you can give (and sometimes have to give) to
    -battle is:

    -normal , specifies that the battle is a normal battle
    -survival , specifies that the battle is a survival battle
    -deathmatch , specifies that the battle is a deathmatch battle
    -team <number 1-4>, if you want to run a team battle this specifies the team of the
    bot following this specification
    -xsize <number> , This specifies the xsize of the arena
    -ysize <number> , This specifies the ysize of the arena
    -numfights <number> , This specifies the number of bouts in normal mode, the number of
    lives in survival mode and the needed number of frags in deathmatch mode
    -maxrounds <number> , This specifies the max length of battle, eg the number of battle
    "ticks" before a "draw" is called.
    -bot <file> , to specify one of the bots fighting (maximum 8 bots can be specified, minimum 2)

    Note that in order to play tournaments this way you need an external script to run
    droidbattles many times as the tournament forms are not directly accessible
    this way.

Next Previous Contents