Skip to main content

Get started with cambc starter

If you haven’t already, run cambc starter to scaffold your project. When prompted, choose to create the starter bot — it gives you a working bot to build on.
The starter bot demonstrates core mechanics: the core spawns builder bots, builders explore by laying roads, and when they find ore they build harvesters on it. Run it against itself to see it in action:

Bot structure

Every bot is a Python file containing a Player class with a run method. The engine creates one Player instance per unit and calls run(controller) once per round.
main.py

Key concepts

Each unit (core, builder bot, turret) gets its own Player instance. Instance variables persist across rounds for that unit, but are not shared between units. Use markers for inter-unit communication.
The controller argument passed to run() provides all game queries and actions. See the full Controller API reference.
from cambc import * gives you all game types: Team, EntityType, Direction, Position, ResourceType, Environment, GameConstants, GameError, and Controller.
Each unit gets 2ms of CPU time per round, plus a 5% buffer that refills when you use less. Locally there are no time limits — use remote test runs to check performance on the actual hardware.
Only Python standard library modules are available. External packages like numpy or scipy cannot be imported — bots run in a sandboxed environment with no pip install.

Next steps

Run a local match

Test your bot against itself or an example opponent.

Game rules

Understand the full game mechanics before optimising.

API reference

Every method available via the Controller object.

Types and enums

All game types: Team, EntityType, Direction, Position, and more.