The Agent Programming Contest is a 1v1, turn-based, grid-based strategy game where each team controls a group of units. The battlefield contains resources, power nodes, and walls.
- The world is an 11x11 grid.
- Obstacles (
X), resources (R), and power nodes (P) populate the grid. - Each agent starts with 2 units at opposite corners.
- Agents operate autonomously using pre-programmed strategies.
- Walls (X) block movement.
- Resources (R) grant +10 energy when gathered.
- Power Nodes (P) are strategic control points.
- Agents (A/B) have 2 starting units each.
- 5+ maps are supported with a generator script.
- Game engine calls
get_actions()for both agents. - Actions are applied simultaneously.
- Game state is updated (movement, gathering, combat, etc.).
- Victory condition is checked.
| Action | Description |
|---|---|
| move | Up/Down/Left/Right if cell is passable |
| gather | Collect energy if standing on a resource |
| attack | Attack adjacent enemy (10 damage, 2-turn cooldown) |
| scan | No-op action (3-turn cooldown) |
| wait | Do nothing |
- Each agent starts with 10 energy.
- Max energy: 100.
- First to 100 wins, or other win conditions apply.
- Each unit has 20 HP.
- Units die when HP ≤ 0.
- Agent loses if all units die.
- Attacks and scans have cooldowns.
- Cooldowns decrease by 1 per turn.
A game ends when any of the following is true:
- One team’s units are all dead.
- One team reaches 100 energy.
- One team controls all power nodes for 5 turns.
- Max turns (1000) reached → tiebreaker:
- More units alive
- Higher total HP
- More energy
- Draw
- Agents must balance between:
- Gathering energy
- Controlling power nodes
- Attacking opponents
- Maps with tight chokepoints and spread-out resources encourage both aggressive and evasive play.
- Agents can patrol, flank, ambush or defend zones.
Script map_gen.py creates dynamic maps with:
- Balanced resource spread
- Power node placements
- Random but fair wall distributions
Maps are stored in maps/map1.json, maps/map2.json, etc.
Each map is a JSON object with:
{
"grid": [...],
"units": {"1": [[0,0], [0,1]], "2": [[10,10], [10,9]]},
"power_nodes": [[2,2], [8,8]],
"resources": [[1,0], [2,3], ...],
"energy": {"1": 10, "2": 10},
"health": {"1": [100, 100], "2": [100, 100]}
}