CLI
Note
The Command-Line-Interface is not available on every platform.
Currently, only Linux and Windows are supported.
We also offer experimental, stripped-down Web support.
By passing command-line arguments to the game, you can configure startup options or enable additional features.
To view all possible command line options, you can use the --help
option.
$ terratactician-expandoria --help
Some arguments have a short variant.
They can be called using both the long and the short version.
The long version is better for readability, but the short version saves time.
# long version
$ terratactician-expandoria --help
# short version
$ terratactician-expandoria -h
Attention
The command depends on the platform you are on, and if the game is in your PATH.
For example, on Windows, the command name probably ends in .exe
.
If the game isn’t in your PATH, you have to specify the full path to the executable.
If you are using the Flatpak version, you have to use flatpak run page.codeberg.terratactician_expandoria.game
.
Starting a game
By selecting a gamemode, a new session will be started with the selected gamemode.
To specify a gamemode, add one of the following flags:
challenge
(short:-c
) - starts the game in Challenge Modecreative
(short:-k
) - starts the game in Creative Modezen
(short:-z
) - starts the game in Zen Modecampaign
(short:-p
) - starts the game in Campaign Mode
$ terratactician-expandoria --challenge
Setting a seed
Some gamemodes allow you to change the seed, which is used when generating the card deck. By default, the game generates a random seed for this.
You can use the --seed
argument to set a custom seed.
(A -s
shorthand is also available.)
$ terratactician-expandoria --challenge --seed "your-seed"
Campaign Mode
When starting a campaign game, you have to specify the campaign group and the campaign level you want to start.
If you know the group ID and level ID, you can start the campaign level directly. Let’s say you want to start the Camera Tutorial:
$ terratactician-expandoria --campaign --group "tutorial" --level "camera"
To list all available groups or levels, you have to set group
or level
to list
.
Display Mode
When starting the game from the command line, you also have the ability to specify how the game is launched.
You can launch it in Headless Mode by passing --headless
(short: -d
),
which disables the UI and only outputs to the TTY.
Or you can launch it in Graphic Mode by passing --graphic
(short: -g
).
This is the default, so you can omit it.
To be able to run the game in Headless Mode, you have to connect a bot or select a record to replay.
Connecting a Bot
You can set custom bot URLs, by setting the --bot
argument (short: -b
).
In Headless Mode, you also have to specify the gamemode to launch.
In Graphic Mode, you can omit the gamemode. This will open the game on the Configure Game screen without starting it.
Note: The connection to the bot will only be established once you launch a Gamemode.
# Connect to a custom bot
$ terratactician-expandoria --headless --challenge --bot "example.com:7738"
# Connect to a bot running on the default URL (localhost:7738)
$ terratactician-expandoria --headless --challenge --bot "localhost:7738"
# You can do the same, by omitting the bot value
$ terratactician-expandoria --headless --challenge --bot
Running the bot in Headless Mode significantly increases the simulation speed, as it doesn’t have to be rendered, making it ideal to quickly check if it reaches a certain goal.
All Gamemodes support connecting bots, but not all Campaign Levels allow connecting bots.
Replaying the game
Note
When using the Flatpak on Linux, you have to make sure that the Flatpak is allowed to access the file you are pointing to.
By default, only the Pictures
and Downloads
folders are allowed.
You can use a tool like Flatseal to update the folder permissions.
Recording a replay
You can either export a replay from within the game (if you have enabled it on the gamemode configuration screen)
or by setting the --recorder-file
CLI argument (short: -r
):
$ terratactician-expandoria --recorder-file path/to/record.json
You can also set a nickname, which is linked in the record file, by setting the --replay-nickname
argument (short: -n
):
$ terratactician-expandoria --recorder-file path/to/record.json --replay-nickname "Your Name"
Playing back a replay
To play back a recorded game, you can pass the path to the JSON file to the --replay-file
(short: -y
).
$ terratactician-expandoria --replay-file path/to/record.json
Generating a report
Note
When using the Flatpak on Linux, you have to make sure that the Flatpak is allowed to access the file you are pointing to.
By default, only the Pictures
and Downloads
folders are allowed.
You can use a tool like Flatseal to update the folder permissions.
A report contains information about the game, including replay information, if you are recording a replay.
It can be used to track a bot or record score after the game exits.
You can export a report by setting the --report-file
argument (short: -t
).
$ terratactician-expandoria --report-file path/to/report.json
Alternative Web Support
⚠ Warning
Passing arguments to the web version is currently considered experimental
To pass arguments to the web version,
you have to specify them as query parameters.
Contrary to the Command Line Arguments, the query parameters only support long key variants, and make heavier use of right-hand values.
For example, you can select the gamemode to Challenge by setting gamemode=challenge
. Try it now
The following parameters are currently available:
gamemode
; can be set to one of:challenge
,creative
,zen
,campaign
display_mode
; can be set to one of:graphic
(default),headless
seed
; the value will be used as the custom seed (i.e.seed=my-seed
)group
; the value will be used as the campaign group ID (i.e.group=tutorial
)level
; the value will be used as the campaign level ID (i.e.level=camera
)bot
; Enables bot support if set. The value will be used as the custom bot URL. If no value is specified,localhost:7738
is used.
In Headless Mode, the canvas won’t be used.
By default, all log messages will be printed to the Web Developer Console.
You can redirect the output to the website view by setting log=dom
.
This will be slower than using the native console,
but it allows viewing the log files in browsers without access to the developer tools.
For example, you can simulate your bot in Headless Mode with the log shown on the page by opening the following link: https://terratactician-expandoria.codeberg.page/game/?gamemode=challenge&bot=localhost:7738&display_mode=headless&log=dom