Quick Start

What is Splatbot?

Splatbot is a game made for programmers, where players compete to color the most number of tiles in a given time frame by creating, well… splatbots! The game is divided up into a series of turns, also referred to as ticks. Each tick, the splatbots will be prompted to make a decision about what action they would like to perform. Then, the game will apply those actions to the bots.

Example of a tick:

  • The game prompts both splatbots to make a decision about what action to perform.
  • Splatbot 1 decides it wants to move west.
  • Simultaneously, splatbot 2 decides it wants to perform a “splat”.
  • The game applies both of these actions at the same time.
  • The game continues on to the next tick.

Example bots are provided, but it is easy to upload custom bots as well! Simply go to the home page, select the “Choose File” under whichever side the bot should play for. Then press the start button to begin the match!

How To Write A Bot

A bot is a Python script: define a class Bot with decide(self, game_state) that returns one action each tick. The full walkthrough (template, memory, printing, edge cases) is in Writing bots.

Download starter code

Actions

On each tick, decide must return a single action. Interactive demos for each one are on the Actions page.

Action Description
move Step one hex forward and paint it.
turn_left Turn left 1–5 steps.
turn_right Turn right 1–5 steps.
turn_180 Turn around.
face_direction Turn to face a specified direction.
skip Do nothing.
splat Paint all neighboring tiles.
shoot_paintball Paint a straight line forward without moving.
dash Move 2–6 hexes forward; paint only the destination.

Utils

There are helper functions available to make writing a Bot even easier. They are desccribed in the Python API reference.

Reading Game State

The game_state passed into decide is read-only; you change the match only by returning an action. Field meanings (and BotInfo details) are documented under Game State in Writing bots. Hex layout and coordinates are covered on the Hex Grid page.

Field Meaning
game_state.me Your BotInfo — position, facing, stun, cooldowns.
game_state.opponents Other players’ BotInfo, keyed by player id.
game_state.opponent The single opponent in 1v1, or None in other modes.
game_state.grid All hexes on the map (Hex); each tile has a controller (BotInfo or None).
game_state.turn Current turn index.
game_state.max_turns Match length.

For static typing against these shapes, use utils.splatbot_data_types. Larger sample bots are in Examples.

Pages

  1. Quick Start — For people who don’t want to read the entire documentation
  2. Actions — What each action does, with interactive examples
  3. Writing bots — An overview of everything that goes into creating a bot
  4. Examples — Larger bot examples
  5. Hex Grid — How the game represents the map and hexes
  6. Debugging — Tips and tools useful for debugging your bots