Using the Game Software

Prerequisite Software

Extracting Files from the Archive

The software is distributed in a tar archive, named samurai2013.tgz, comrpessed with gzip. The first step of installation is to extract file and directory structure from the archive. Typically, gunzip on Unix-like systems, many archive software such as 7-zip or lhaplus on Microsoft Windows and Stuffit or Unarchiver on Macintosh.

The extracted directory should contain the following.

./translator
Gunbai script to C++ translator.
./runtime
Runtime system for the tournament.
./runtime/players
Scripts of copetitors should be stored here. Sample scripts are provided.
./visualizer
Game visualizer. A Java archive SamurAI_2013.jar is here, which is usually all what you need to run the visuzlizer.
./visualizer/src
The source file for the visualizer. You do not have use this if you are only to use the system.
./documents
Documents on the software.

Building the Game System

The following steps should be followed to build the game system, consisting of the Gunbai Script to C++ translator and the runtime system linked with compeitors' scripts.

  1. Prepare competitors' scripts the directory ./runtime/players An example should be found in ./runtime/players/greedy.gb.
  2. Make a list of competitor team names and their script file names, and place it in the file ./runtime/players/teamlist. An example should be found in ./runtime/players/teamlist.example.
  3. Issue make at the top level should automatically build the translator and the runtime system. To test with an example, issueing make example at the top level should copy the example team list to the teamlist file, and then build the system.

Running the Game System

After building the system, issue ./samuraiPlay with appropriate command line arguments in the ./runtime directory.

Command line arguments (all required in this order) are the following.

Number of rounds
Number of tournament rounds to play
Number of turns
Number of turns in each game
Cost limit
Cost limit of competitor scripts in each turn
Min. field size
Minimum field width or height (must be an odd number)
Max. field size
Maximum field width or height (must be an odd number)
Random seed
Seed of the random number used in the games
Gates of the game field are automatically placed in a randomized manner, and the number of games in a round is automatically decided based on the number of teams.

Executing samuraiPlay will output the game logs in the standard output. So, a typical command line would be as follows.

./samuraiPlay 1 100 10000 29 23 >test.samuraiLog
The file name extension .samuraiLog is recommended, as the visualizer expects that extension for its input. You can find description of game log format in the file ./documents/logformat.txt.

Running the Game Visualizer

The JAR file of the visualizer should be found in ./visualizer/SamurAI_2013.jar. How to start it may depend on individual systems, but on certain systems, it is by simply double clicking the file, or typing in

java -jar SamurAI_2013.jar
at a command prompt.