Boomerman
Boomerman is an interactive game in which team strategies control players moving on a rectangular field and competing against each other in a turn-based strategy mode.
The competition runs throughout the contest and consists of games.
Each game is specified by a GameConfig
which you can obtain via the request to the game server.
It consists of game_duration_ticks
ticks where ticks happen roughly each second. Note that the games are not run back to back, and there are pauses in between them.
Each team should implement its game strategy using any programming language, run, and maintain it on its own. Communication between a strategy and the game server occurs via the gRPC protocol (download the .proto files).
A strategy connects to the server, subscribes to a message stream via the Listen()
method, and receives game states each tick.
If a team wants to take part in a particular game, a strategy should call the EnterGame()
method and the team's strategy becomes a participant of the current game. Note that you can join a game at any moment.
A team does not take part in the current game until the method EnterGame()
is called.
Between ticks, a strategy can send commands to the server that applies the player’s actions at the next tick (available commands are described below). At each tick, all players’ actions are applied simultaneously and atomically, the order of application of various actions and their impact on the game state are described below. A strategy can send any number of commands of each available action between ticks, but only the last command for each type of action will be applied.
Each team can control only one player in each game. So, even if a team opens multiple connections to the server, all requested actions apply to the same player.
During the game, player earns points, which are awarded for:
- each tick when their player is in the game and alive,
- for hitting other players with deployed bombs,
- for destroying walls,
- for defusing other players' bombs.
Score is a global counter of points, which carry over from game to game and are never decreased or spent. The scoring system and the logic of the conversion of points to the final score are described below.
While moving across the field, players collect coins and can spend them on actions.
Coins can be carried over from one game to the next using the formula min(coins_rollover_capacity, floor(coins / coins_rollover_factor))
. The coin balance is an internal currency for actions and does not affect the teams’ positions in the final scoreboard.
Rollover formula is applied at the moment of joining a game, i.e. if a team doesn't take part in a game, the coins remain intact until the game the team will enter.
Each player has a life counter. A player is considered active and can perform actions only if the life counter is positive; otherwise, a player can no longer perform actions during that game and disappears from the game field.
The initial value of the life counter is 1
. The counter increases by one each time a player: 1) moves into a cell with an extra life, or 2) when the strategy exchanges collected coins for an extra life.
The counter decreases by 1
each time a player is affected by bomb explosion(s). Lives are not transferable from game to game: a player always enters a game with the life counter of 1
.
Game Elements
Game Field
The game field is a rectangle consisting of H
rows with W
cells each.
Each cell can represent an undestroyable wall (denoted by the symbol #
), a destructible wall (%
), or an empty cell (.
).
Cell coordinates are denoted as (X, Y)
, where X
is the row index and Y
is the column index.
Rows are numbered from top to bottom starting with 0
, and columns are numbered from left to right starting with 0
.
For example, (0,0)
corresponds to the top-left cell of the field, (H-1, W-1)
corresponds to the bottom-right cell of the field.
Map sizes and configurations are not predefined and can vary from game to game. During some of the last ticks of the game, a Battle Royale mode may be introduced, in which the map is gradually filled from the edges to the center with undestroyable walls; this mode is described below.
Players
Each player, if it is a game participant and alive, has a position (X, Y)
on the field where and , and can move across the field via move commands on the next tick or via teleportation. Players can only occupy empty cells; walls (both destroyable and undestroyable) are impassable. All other game elements except walls (bombs, extra lives, coins, other players) are not obstacles; in particular, multiple players can occupy the same cell.
A player spawns in a random cell of the field chosen from a predefined set (undisclosed to the participants) after calling the EnterGame()
command and can take actions from the next tick. Note that multiple players can spawn in the same cell.
Bombs
Players can deploy bombs of three types (type0
, type1
, type2
). A bomb can be placed only if there are no other bombs of the player on the field. Each bomb type has a different cost (in coins) and damage pattern.
After placement, a bomb will explode after some number of ticks (see the table below).
Players caught in the explosion lose one life. A player cannot lose more than one life per tick, even if caught by the explosion of multiple bombs simultaneously.
Placed bombs can be defused by players using the corresponding action. Multiple bombs can be placed in the same cell of the game field.
If an explosion reaches a wall, its propagation stops. If it is a destructible wall, this wall is destroyed and is from the game map.
A player can be eliminated by its own bomb, but the player won't get points for such an event.
Please note that even after a player is eliminated, its bombs remain active and the player will receive points if the bomb successfully hits other players or walls.
Bomb actions:
Type | TTL | Damage Pattern |
---|---|---|
type0 | bomb0_ttl |
Cells in the same row or column until the nearest wall or edge of the field at a distance not exceeding bomb0_hit_range |
type1 | bomb1_ttl |
Cells with the shortest distance via the adjacent cells to the bomb position not exceeding bomb1_hit_range |
type2 | bomb2_ttl |
Cells in the same row or column until the nearest wall or edge of the field |
Coins
Each cell of the game field contains a random number of coins from 0 to 3, including. If a player moves into a field cell with coins, it collects them on the next tick. If multiple players enter the same cell simultaneously, each receives , where is the number of coins in the cell, and is the number of players entering that cell simultaneously. After that tick, the number of coins in the cell is set to zero and does not reappear during the game. Coins can be hidden in some destroyable wall cells and may become available after those walls are destroyed.
Extra Lives
Some cells contain extra lives. If a player moves into a field cell that contains an extra life, the player’s life counter increases by one. If multiple players enter the same cell simultaneously, each receives an extra life. After that tick, the extra life in the cell disappears and does not reappear later in the game. Extra lives are spawned only in non-wall cells.
Available Actions
Action | Cost | Effect |
---|---|---|
move | 0 | the player moves up, down, right, or left if the target cell is not a wall |
place a bomb | type0: 0 type1: bomb1_price type2: bomb2_price |
places a bomb of the chosen type in the current cell; the coin balance is reduced by the corresponding cost |
buy a life | extra_life_price |
the player’s life counter increases by one |
defuse bombs | defuse_bombs_price |
all bombs located in the player’s current cell (if any exist) disappear from the game field |
teleport | teleport_price |
the player teleports to any non-wall cell on the field |
Note: All actions are registered and applied independently, except for the "move" and "teleport" actions, which are processed as follows: if "teleport" is set, "move" will be ignored even if it is also set.
Battle Royale
The available game map gradually shrinks starting at map_shrink_start_tick
ticks. If map_shrink_start_tick
is bigger than game_duration_ticks
, Battle Royale never happens during the current game. Players must adapt to the reducing play area to avoid elimination and remain within the boundaries. During the Battle Royale, the game field is built up with indestructible walls from four edges toward the center at a rate of one new line every map_shrink_step
ticks. Players caught in the cells being built over are eliminated and removed from the field. Bombs, extra lives, and other game elements located in the built over cells are also removed from the game field.
Applying Player Actions to the Game Field
The order for applying player actions is the following. At each step actions of all players of a certain type are applied simultaneously.
- Purchase extra lives: each player who set the action gets an extra life.
- Defuse bombs: bombs are removed from positions of players who set the action.
- Deploy bombs: bombs are added to the game field.
- Move players: players change their positions if "move" or "teleport" actions are set.
- Collect coins and lives.
- Bomb explosions.
- Map shrinking during Battle Royale.
Available Information
Throughout games, players have access to all information about other players, the game field state, the locations of coins and bombs, the current score values, and the coin balances of all players, but not to other players' next actions (which remain private).
Scoring
During the game, players earn points for the following events:
Event | Points | Comments |
---|---|---|
player is alive during the current tick | alive_tick_bonus |
|
bomb hits another player | hit_player_bonus |
If multiple bombs from different players hit, each is awarded points by the formula ceil(hit_player_bonus / T) , where T is the number of players whose bombs caused hits |
bomb destroys a destroyable wall | destroy_wall_bonus |
If multiple bombs from different players destroy the same wall, each is awarded points by the formula ceil(destroy_wall_bonus / T) , where T is the number of players whose bombs contributed to the destruction |
player defuses other players' bombs | defuse_bomb_bonus |
If multiple bombs from different players destroy the same wall, each is awarded points by the formula ceil(defuse_bomb_bonus / T) , where T is the number of players who defused the bombs at that locations simultaneously |
The points earned in the game are added to the total number of points of a team.
The points will be doubled after the first 12 hours of the competition.
Values in the GameConfig
will be changed accordingly.
Your score for the problem is proportional to your number of points divided by the highest number of points: . The points are synchronized with the competition scoreboard after each game ends.
Game Configuration
During the competition GameConfig
can be changed during the pauses between games.
The initial values of the configuration are as follows.
If a value of the configuration is changed, the table below will be amended accordingly.
Variable | Value |
---|---|
game_duration_ticks |
120 |
map_shrink_start_tick |
90 |
map_shrink_step |
5 |
hit_player_bonus |
100 |
destroy_wall_bonus |
4 |
alive_tick_bonus |
2 |
defuse_bomb_bonus |
10 |
game_bomb_0_ttl |
6 |
game_bomb_1_ttl |
6 |
game_bomb_2_ttl |
6 |
bomb_0_hit_range |
3 |
bomb_1_hit_range |
3 |
game_bomb_0_price |
0 |
game_bomb_1_price |
10 |
game_bomb_2_price |
20 |
extra_life_price |
50 |
defuse_bombs_price |
30 |
teleport_price |
40 |
coins_rollover_factor |
2 |
coins_rollover_capacity |
100 |
Connection
The game server is available at grpc://boomerman.midnightcodecup.org:443
(via TLS). Please read the protocol definitions to get familiar with available commands and API methods.
Once entered, a player remains active till the end of the current game even if a connection dropped. Your strategy can re-connect and control the player again.
You should pass your team password for the testing system via the "authorization"
key in the metadata of each request.
Each team is limited to 10 RPS (requests per second) and no more than 3 simultaneous subscriptions to the Listen()
stream.
Visualization
Our junior vibe-coder implemented a visualizer. Use it on your own risk.