Halite II game rules

The mechanics implemented by the Zig engine, condensed for bot writers. Numbers below are the engine defaults.

The map & turns

Matches are played by 2–4 bots on a rectangular map over at most 200 turns. Each player starts with 3 ships. Every turn, each bot receives the full game state and replies with one command per ship. All commands are resolved simultaneously.

Ships

  • 255 health, radius 0.5 units.
  • Move with a thrust command: integer speed 0–7 units/turn and integer angle 0–359°.
  • Two ships closer than 1.0 units collide — both are destroyed instantly. Ramming is a legitimate (if costly) tactic.

Planets & docking

  • Each planet has ⌊radius⌋ docking spots and a finite halite reserve (the visualizer shrinks planets as it depletes).
  • To dock, a ship must be within planet radius + 4.5 units of the planet center and the planet must have a free spot. Docking takes 5 turns; undocking takes 5 turns too.
  • Docked ships cannot move. Only one player can be docked at a planet at a time.

Mining & ship production

  • Each docked ship mines 2% of the planet's remaining halite per turn into your resource bank, so yields shrink over time.
  • Every 8 turns, each planet where you have docked ships spawns a new ship next to it — if you can pay the 40 halite cost.

Combat

  • Combat is automatic — there is no attack command. Ships fight all enemy ships in their vicinity (the engine resolves combat in 5×5-unit cells).
  • Each ship deals 64 damage per turn to every enemy ship near it. Four hits kill a fresh ship.
  • Docked ships still fight back, but they can't move — catching a mining operation undefended is usually lethal.

Winning

The match ends when only one player has ships left, or when the turn limit is reached. At the limit, the winner is the player with the most ships, with total mined halite as the tie-breaker.

Command reference

Bots talk to the engine over stdin/stdout. The starter packs wrap this for you, but the raw per-ship commands are:

CommandEffect
t <id> <speed> <angle>Thrust: move the ship at speed 0–7 toward angle 0–359°.
d <id> <planet>Dock the ship at the given planet (must be in range).
u <id>Undock the ship from its planet.

Full protocol details live in PROTOCOL.md.