19 "usage: r-type_bot [--host <address>] [--port <tcp port>] [--name <player name>]\n"
20 " [--count <bots>] [--inputs <script file>] [--seconds <play time>]\n"
21 " [--seed <number>] [--stats <csv file>] [--help] [--version]\n";
50 std::optional<std::filesystem::path>
inputs;
53 std::optional<std::filesystem::path>
stats;
64[[nodiscard]] std::variant<BotOptions, std::string>
A player without a window: joins a server and holds random or recorded inputs.
R-Type game code, built on the Aegis2D engine.
Definition enemy_scripts.hpp:16
BotCommand
What the bot was asked to do.
Definition bot_options.hpp:27
@ Run
Join the server and play.
@ Version
Print the version and exit.
@ Help
Print the usage and exit.
@ Run
Start the game and listen on the ports.
constexpr std::string_view bot_usage
Usage line printed by --help and after a command line error.
Definition bot_options.hpp:18
std::variant< BotOptions, std::string > parse_bot_options(std::span< const std::string_view > args)
Reads the command line of r-type_bot.
constexpr std::uint32_t max_bots
Most bots --count runs in one process.
Definition bot_options.hpp:24
Settings of a bot run, read from the command line.
Definition bot_options.hpp:37
std::uint32_t count
--count: number of bots, 1 to max_bots, named and seeded by bot_team().
Definition bot_options.hpp:47
std::optional< std::filesystem::path > stats
--stats: CSV file written at the end, one line per bot that played (bot_stats_header,...
Definition bot_options.hpp:53
BotCommand command
What to do; the settings only matter for BotCommand::Run.
Definition bot_options.hpp:39
std::optional< std::uint32_t > seconds
--seconds: leave after playing this long; nothing plays until Ctrl+C.
Definition bot_options.hpp:45
bool seeded
--seed was given: otherwise each run draws its own.
Definition bot_options.hpp:43
BotSettings settings
Server, name (bot by default) and seed.
Definition bot_options.hpp:41
std::optional< std::filesystem::path > inputs
--inputs: script replayed by every bot instead of random inputs, read with load_input_script().
Definition bot_options.hpp:50
What a bot needs to join a server.
Definition bot.hpp:54