OpenFront Environment
Both the OpenFront client and server can be configured using environment variables. These variables should be set in the .env file located in the OpenFront directory.
Default configuration should work for most cases. While you may want to tweak the configuration for your development environment, keep in mind that when we actually make the bots fight with one another, they will be running with the default configuration on our infrastructure. So make sure to test your bot with the default configuration before submitting it to the tournament.
Let us know if you think there is a problem with the default configuration.
TIP
Refer to the openfront/example.env file for the default configuration. Copy-paste it to your own .env file and modify it as you see fit.
Client Environment Variables
Those environment variables that are relevant for the OpenFront client (the part of OpenFront that runs inside the browser).
ENABLE_MANUAL_INPUTS
By default, manual user inputs are enabled (ENABLE_MANUAL_INPUTS=1).
However, when testing your algorithm/bot, it can be impractical to have manual inputs enabled, because you might accidentally send inputs to the game while observing the bot. To avoid this, you can set ENABLE_MANUAL_INPUTS to 0. User inputs will still be enabled in the menu (to create a lobby, for example), but they will be disabled in the game.
CONQUERHACK_WS_HOST
Specifies which host the OpenFront client should try to connect to when establishing a websocket connection with the bot.
Default value is localhost.
CONQUERHACK_WS_PORT
Specifies which port the OpenFront client should try to connect to when establishing a websocket connection with the bot.
Default value is 12345.
API_DOMAIN
Specifies the host name of the OpenFront server.
Can be localhost, an IP address, or a domain name.
If the env var is unset, the value localhost is used. If you are running the client and server on different machines, make sure to set this variable to the server's IP address or domain name, so that the client can connect to the server correctly. Also make sure that all machines have the same value for this variable.
This variable will be properly set when we run your bot in our infrastructure, so you don't need to worry about it for the tournament.
CONQUERHACK_IS_SPECTATOR
You do not need to use this environment variable to test your algorithm. Try it out for fun if you want.
For displaying the leaderboard during tournament games, a custom client (spectator client) is used to watch the game and save leaderboard data periodically.
By default, CONQUERHACK_IS_SPECTATOR is set to 0. Set it to 1 to make your client consider itself a spectator.
CONQUERHACK_LEADERBOARD_HOST
The HTTP host to which leaderboard data will be sent.
Has no effect if CONQUERHACK_IS_SPECTATOR is not set to 1.
CONQUERHACK_LEADERBOARD_PORT
The HTTP port to which leaderboard data will be sent.
Has no effect if CONQUERHACK_IS_SPECTATOR is not set to 1.
CONQUERHACK_LEADERBOARD_UPDATE_INTERVAL_TICKS
Number of ticks between each leaderboard data update.
Has no effect if CONQUERHACK_IS_SPECTATOR is not set to 1.
See Tick for more information about game ticks.
CONQUERHACK_GAME_SPEED_MULTIPLIER
Game speed multiplier for training. This controls how fast the game runs.
For example, a multiplier of 2 means the game runs twice as fast (turn interval is 50ms instead of 100ms). See Tick for more information about game ticks.
For official games, this will be set to 3. You should set it to 1 (normal speed) if you want to play the game manually, otherwise the game might be too fast for you to react.
Make sure to use the same value for both the OpenFront client and your bot, otherwise the game might run at different speeds for the client and the bot, which can cause problems.
Server Environment Variables
Those environment variables that are relevant for the OpenFront server (the part of OpenFront that runs on the backend and manages the game state and matchmaking).
WARNING
Remember that during the actual tournament, the OpenFront server will be running on our infrastructure with the default configuration. So make sure to test your bot with the default configuration before submitting it to the tournament.
PUBLIC_LOBBIES_RANDOM_SPAWN
Whether to enable random spawn in public lobbies. Note that there is no in-between, either all public lobbies will have random spawn enabled, or none of them will.
1 means enabled, 0 means disabled.
INFO
Note that this only affects public lobbies. If you create a private lobby manually, you can choose whether to enable random spawn or not, regardless of the value of this variable.
PUBLIC_LOBBIES_DIFFICULTY
The difficulty level for public lobbies. This controls the difficulty of the AI opponents in public lobbies.
- 0 for Easy
- 1 for Medium
- 2 for Intense
- 3 for Impossible
PUBLIC_LOBBIES_DISABLE_TEAMS
Whether to DISABLE teams in public lobbies.
Disabling teams means all public lobbies are in FFA (Free-For-All) mode.
Unlike random spawn, teams being enabled does not mean all public lobbies will be in team modes, but some of them may.
1 means disable teams, 0 means enable teams.
Default is 0 (teams are enabled) if the variable is not set.
INFO
Note that this only affects public lobbies. If you create a private lobby manually, you can choose whether to enable teams or not, regardless of the value of this variable.
Though bots are not meant to play in teams, so we would advise against taking teams mode as a reference for your bots. But you can try it out to see what happens.
MULTIPLAYER_SPAWN_PHASE_DURATION_TICKS
Spawn phase duration for multiplayer games, in game ticks. See Tick for more information about game ticks.
A game tick is expected to be 100ms, so a value of 10 means 1 second. Note that the duration of a game tick may vary depending on server performance and load.
Default is 300 (30 seconds) if the variable is not set.
SOLO_SPAWN_PHASE_DURATION_TICKS
Spawn phase duration for solo games, in game ticks.
A game tick is expected to be 100ms, so a value of 10 means 1 second. Note that the duration of a game tick may vary depending on server performance and load.
Default is 100 (10 seconds) if the variable is not set.
ENABLED_*
Configuration of which units (buildings, missiles, ...) are enabled for public lobbies.
The format is ENABLED_<UNIT_TYPE>=<0 or 1>, where <UNIT_TYPE> is the type of the unit, and 0 means disabled while 1 means enabled.
Existing units are:
ENABLED_UNITS_CITY
ENABLED_UNITS_FACTORY
ENABLED_UNITS_PORT
ENABLED_UNITS_DEFENSE_POST
ENABLED_UNITS_MISSILE_SILO
ENABLED_UNITS_SAM_LAUNCHER
ENABLED_UNITS_WARSHIP
ENABLED_UNITS_ATOM_BOMB
ENABLED_UNITS_HYDROGEN_BOMB
ENABLED_UNITS_MIRVINFO
Note that this only affects public lobbies. If you create a private lobby manually, you can choose whether to enable or disable any unit type.
Keep in mind that during the tournament, all units will be disabled.
MAP_*
Weights for the random map selector of public lobbies.
The format is MAP_<MAP_NAME>=<weight>, where <MAP_NAME> is the name of the map, and <weight> is a non-negative number representing the weight of the map in the random selection process. A higher weight means the map is more likely to be selected.
INFO
Note that this only affects public lobbies. If you create a private lobby manually, you can choose which map to use, regardless of the value of these variables.
Builtin Maps
Maps built into the original game (not specific to ConquerHack) are listed below.
Note that all builtin maps are disabled in the default ConquerHack configuration, because they contain water-separated areas that are not supported by the bots.
As a comment on the right side of the list, you can find the original weight the map had in the game before we disabled it. Yes, some of them were already disabled.
MAP_AFRICA=0 # 7
MAP_ASIA=0 # 6
MAP_AUSTRALIA=0 # 4
MAP_ACHIRAN=0 # 5
MAP_BAIKAL=0 # 5
MAP_BAIKAL_NUKE_WARS=0 # 0
MAP_BETWEEN_TWO_SEAS=0 # 5
MAP_BLACK_SEA=0 # 6
MAP_BRITANNIA=0 # 5
MAP_DEGLACIATED_ANTARTICA=0 # 4
MAP_EAST_ASIA=0 # 5
MAP_EUROPE=0 # 3
MAP_EUROPE_CLASSIC=0 # 3
MAP_FALKLAND_ISLANDS=0 # 4
MAP_FAROE_ISLANDS=0 # 4
MAP_GATEWAY_TO_THE_ATLANTIC=0 # 5
MAP_GIANT_WORLD_MAP=0 # 0
MAP_HALKIDIKI=0 # 4
MAP_ICELAND=0 # 4
MAP_ITALIA=0 # 6
MAP_JAPAN=0 # 6
MAP_MARS=0 # 3
MAP_MENA=0 # 6
MAP_MONTREAL=0 # 6
MAP_NORTH_AMERICA=0 # 5
MAP_OCEANIA=0 # 0
MAP_PANGAEA=0 # 5
MAP_PLUTO=0 # 6
MAP_SOUTH_AMERICA=0 # 5
MAP_STRAIT_OF_GIBRALTAR=0 # 5
MAP_WORLD=0 # 8
MAP_YENISEI=0 # 0Custom Maps
Custom maps added to the game by ConquerHack are listed below.
MAP_ROLEX=1
MAP_EPFL_MAP=1
MAP_LOGITECH=1
MAP_LOGO_OUT=1
MAP_POLYDOME=1
MAP_SWITZERLAND=1
MAP_VAUDOISE_ASSURANCE=1Infrastructure Environment Variables
You may notice a section called ENV FOR INFRA CONFIGURATION in the example.env file.
Those variables are used to deploy OpenFront in production. You will not need them to run OpenFront locally, and you should not change them. In fact, you can ignore that section completely.
