Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.battlecode.cam/llms.txt

Use this file to discover all available pages before exploring further.

Every turret except the launcher faces in one of 8 directions.

Ammo

Gunners, sentinels, and breaches require ammo to fire. Ammo is simply a stack of resources sitting inside the turret — each shot consumes a fixed number of resources from that stack (see per-turret tables below). Launchers do not use ammo. Ammo must be fed to turrets via conveyors, an adjacent harvester, an adjacent foundry, or a bridge targeting the turret’s tile, from any direction except the direction the turret is facing. Diagonal turrets can be fed from all four sides. Ammo-based turrets can hold up to one stack of one resource type and only accept incoming resources when completely empty.
If a builder bot is standing on a building, turret attacks on that tile hit only the builder bot.
Raw axionite fed into a turret is destroyed. Only the ammo types listed below have any effect. Breach turrets additionally accept and destroy all resource types (including titanium) — see Breach.

Gunner

Gunner Has a vision radius of √13. Fires along the forward ray up to range. Empty tiles and markers do not block line of sight. Markers are still targetable. Walls block the ray but are not targetable. Builder bots and non-marker buildings are both targetable and blocking, so nothing beyond the first such blocker is legal. Using refined axionite as ammo deals 25 damage instead of 10.
Markers are the only occupied tiles that do not block a gunner. Walls block but are not targetable. Builder bots and non-marker buildings are both targetable and blocking.
c.get_gunner_target() returns the closest targetable occupied tile on the forward line. It may return a marker even if a farther legal target also exists behind that marker.
Gunners can rotate to any direction with c.rotate(direction). This costs 10 Ti from the global pool and applies a 1-turn cooldown. Use c.can_rotate(direction) to preflight the move.
PropertyValue
HP40
Base cost10 Ti
Scaling10%
Damage10 (25 with refined axionite)
Reload1 round
Ammo per shot2
Vision r²13
Attack r²13 (same as vision)
Gunner range — cardinal direction

Sentinel

Sentinel High range support turret. Can hit all tiles within 1 king move (Chebyshev distance) of the straight line in its facing direction, within vision range. Using refined axionite instead of titanium as ammo adds +5 to the action and move cooldown of any unit directly hit — acting as a stun.
PropertyValue
HP30
Base cost30 Ti
Scaling20%
Damage18
Reload3 rounds
Ammo per shot10
Vision r²32
Attack r²32 (same as vision)
Sentinel range — cardinal direction
Sentinels with refined axionite ammo still disrupt builder bots by delaying both movement and actions.

Breach

Breach Very high damage with splash. Attacks in a 180° cone in the facing direction.
PropertyValue
HP60
Base cost15 Ti, 10 Ax
Scaling10%
Damage40 direct + 20 splash (8 surrounding tiles)
Reload1 round
Ammo per shot5 (refined axionite only)
Vision r²2
Attack r²24
Breach range — cardinal direction
Breach turrets accept all resource types, but only refined axionite is stored as ammo. Titanium and raw axionite delivered to a breach are consumed and destroyed on receipt. This prevents resources from backing up on conveyors feeding a breach.
Breach turrets have friendly fire on the splash damage (8 surrounding tiles). They do not damage themselves.

Launcher

Launcher Picks up and throws adjacent builder bots to a target tile within range. The target tile must be bot-passable. Unlike other turrets, launchers have no facing direction and do not use ammo.
PropertyValue
HP30
Base cost20 Ti
Scaling10%
Reload1 round
Vision r²26
Attack r²26 (same as vision)
Launcher range — blue is vision, red is throw range
# Build a launcher (no direction needed)
c.build_launcher(pos)

# Launch a builder bot to a distant position
if c.can_launch(bot_pos, target_pos):
    c.launch(bot_pos, target_pos)

Querying turret geometry

c.get_attackable_tiles() returns the raw geometric attack pattern for the turret you are controlling, and c.get_attackable_tiles_from(position, direction, turret_type) returns the same pattern for a hypothetical turret at any position — callable from any controller. Both ignore ammo, cooldown, occupancy, blockers, and other legality checks. To check whether a shot is actually legal right now, use c.can_fire(target) on a real turret, or c.can_fire_from(position, direction, turret_type, target) to test a hypothetical shot against the current map’s range and obstruction rules. See the Controller reference for full method signatures.