Tronk

Learn all about this year's game.

Tronk is a custom multiplayer arcade game inspired on the popular game Snake. We tried to keep it as simple and minimalistic as possible. Here's everything you need to know.

Objective

The objective of Tronk is to be the last player standing by strategically walking around on the game field and avoiding other players and picking up gemstones to grow and trap your opponents. That's it.

Preview of the Arena
Gameplay Mechanics
  • Each player controls a character (those round colorful thingies with cute eyes) on a hexagonal field containing 91 tiles.
  • Every 10000th tick, players move one tile forward in the direction they are facing, as long as that tile exists and is not occupied by another player.
    • Moving to a tile occupied by another player or non-existing tile will result in a game-over. If multiple players want to move to the same tile, they also crash.
    • Moving to a tile occupied by a gemstone (round green thingies on the game field) will result in the player getting one tile longer. A new gemstone will spawn on another empty tile.
  • At any time, players can set the direction in which they want to move by turning their character.
  • Players can only turn to face the tile in front, to the left or to the right with respect to the tile they moved from. They thus cannot take sharp turns.
Rules
  • The game starts with all 6 players placed in the corners on the arena, and 6 gemstones in the locations indicated above.
  • Each player's bot code is executed simultaneously, not in turns.
  • Each player has one life. When a player loses this life by moving to a non-empty tile, they are eliminated from the game.
  • When a player dies, their character remains on the game field.
  • Every 10000 ticks, all players will move one tile in the direction they are facing simultaneously.
  • Players can become longer by walking on tiles with gemstones.
    • When a gemstone is picked up, it is removed from the game. A new gemstone is automatically placed on a random empty tile on the game field.
    • If no gemstone is picked up after 50000 ticks (5 steps), a new gemstone is added on a random empty tile every 10000 ticks (1 step), until some player picks up a gemstone.
  • The game continues until only one player remains, who is declared the winner.
Technical Requirements
  • Participant must submit their bot as a single code file with a maximum size of 1MB. You may upload as many bots as you like, though only one can be active at any time.
  • Bots may not crash. If the execution of your code file exits, your bot will instantly die.
Example Gameplay

You can take a look at the livestream here or the replay videos of past games to get an idea of how the gameplay of Tronk looks.

You can also play around with your bots in de web editor!

Detailed Description

Below, you'll find some more detailed information about various aspects of the game. You don't necessarily need to know these in order to start writing your bot, but they will be useful if you plan on optimizing your algorithm to get the most out of your bot.

Game field
The game is played on a hexagonal game field with a total of 91 tiles. There are 6 tiles on every edge of the field.
Legal moves
Every 10000 ticks, all players move one tile in the direction they are facing. There are a few scenarios that can occur:
  • The tile is outside the game field.
    If you move to a tile outside the game field, your player is eliminated from the game.
  • The tile is occupied by a player.
    If someone else (or you yourself) is occupying a tile, you cannot move there and your bot will die.
  • The tile is not occupied by a player and you're the only one moving there.
    If you're the only one moving to an empty tile or a tile with a gemstone, your player will step to that tile and continues to live.
  • The tile is not occupied by a player and there are multiple players moving there.
    If two or more players are moving to the same empty tile of tile with a gemstone, they both die.
Gemstones
Gemstones are the apples from the game Snake. If a player moves to a tile with a gemstone on it, the gemstone is removed and the player's character increases its length by one tile. There is no limit on how long a player can get.
Gemstone spawning
At the start of every game, 6 gemstones are placed close to the center (see the locations indicated on the arena preview above). When a gemstone is removed from the game (because some player moved to that tile), a new one is generated automatically and placed on a random empty tile of the game field. Additionally, if no player moves to a tile with a gemstone in 50000 ticks (5 steps), a new gemstone is added on a random empty tile every 10000 ticks (1 step). This continues until a player picks up a gemstone, after which this timer is reset.
Tick system
The game runs on a tick-based system. Each tick, every living player's bot code is advanced by one step. Players physically move once every 10,000 ticks. This means your bot has a budget of 10,000 ticks between moves to decide which direction to turn.

Every function your bot calls has a tick cost. For example, calling turnLeft() costs 100 ticks, meaning your bot is paused for 100 ticks while the turn is processed. Regular statements (assignments, conditions, loops) each cost 1 tick. If your bot uses up all 10,000 ticks before the next move, it simply moves in whatever direction it was last set to face.

Tick costs of game functions:
  • turnLeft(), turnRight(), turnForward(), turn(dir): 100 ticks
  • getPlayerInfo(id): 50 ticks
  • getTileAbs(q, r), getTileRel(q, r): 20 ticks
  • getTurn(): 10 ticks
  • relToAbs(q, r): 5 ticks
  • getPlayerId(), getTick() : 1 tick
Simultaneous execution
All players' bots are ticked in order (player 0 through 5) each game tick, but movement happens simultaneously. When the 10,000-tick boundary is reached, all players' moves are validated at once before any player actually moves. This means two players moving toward the same empty tile will both die. Neither has priority.

Game-specific Functions

Here you find an extended description of the game-specific functions available in Tronk.