Command Line Interface

Basic Usage Examples

  • Run 1,000 games with Random Players

    catanatron-play --num 1000 --players R,R,R,R 
  • Run 10 1v1 games between VictoryPointPlayer and ValueFunctionPlayer

    catanatron-play --num 10 --players VP,F 
  • Pit 3-player Catan with basically no discard limit

    catanatron-play --num 1 --players W,F,AB:2 --config-discard-limit 999
  • Play 1v1 against ValueFunctionPlayer until 15 points with discard limit set to 9 (would not recommend 😅; its much better to play using the GUI)

    {% code overflow="wrap" %}

    catanatron-play --num 1 --players F,H --quiet --config-discard-limit 9 --config-vps-to-win 15 

    {% endcode %}### Using Different Players

Many of the Bots are ready to be used from the CLI using the --players flag. Specify players by using <id>:<param1>:<param2>:... syntax. For example,

  • G:10 is GreedyPlayoutsPlayer with rollouts = 10

  • AB:3:True is AlphaBetaPlayer with 3 ply look-ahead and prunning turned on

  • ...

For more information, use:

catanatron-play --help-players
catanatron-play --help-players output

Saving Game Results

You can save the output of games using the --output and --output-format flags. For example:

JSON Format

Inspecting the data directory you should see all 5 games.

Other Formats

You can also generate data in CSV and Parquet for Machine Learning and similar applications. See more at Data and Machine Learning.

Last updated