Skip to content

Latest commit

 

History

History
104 lines (78 loc) · 2.78 KB

File metadata and controls

104 lines (78 loc) · 2.78 KB

Game Overview

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.

Universe

  • 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.

Map Structure

  • 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 Rules & Mechanics

Turn Structure:

  1. Game engine calls get_actions() for both agents.
  2. Actions are applied simultaneously.
  3. Game state is updated (movement, gathering, combat, etc.).
  4. Victory condition is checked.

Actions:

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

Energy:

  • Each agent starts with 10 energy.
  • Max energy: 100.
  • First to 100 wins, or other win conditions apply.

Health:

  • Each unit has 20 HP.
  • Units die when HP ≤ 0.
  • Agent loses if all units die.

Cooldowns:

  • Attacks and scans have cooldowns.
  • Cooldowns decrease by 1 per turn.

Victory Conditions

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:
    1. More units alive
    2. Higher total HP
    3. More energy
    4. Draw

Strategic Design Features

  • 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.

Map Generator

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.


File Format

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]}
}