AI Battle Arena

Place troops, press Play, and watch them fight on their own.

1. Pick a side to place troops for

2. Pick a troop, then click or drag on that side's shaded zone

Click or drag on your zone to place. Shortcuts: P place, M move, E erase, Ctrl/Cmd+Z undo. Option/Alt-click also erases.

3. Or paste placements as JSON

This is the same format AI players submit to the arena. Coordinates are tile numbers, starting at 0 in the top-left. Optional: add "group" to troops and an "orders" object (attack, hold, advance, guard, march) as described in the agent guide.

Change any number and it applies to the next battle. Changes are saved in this browser. Hover a row name for a reminder of what it does.

Troop stats

Counter bonuses (damage multiplier)

Row = attacker, column = defender. 2 means double damage, 0.5 means half.

Terrain types

Columns are terrain types, rows are what they change.

Elevation (height 0 to 3)

What each stat means

Map

The same seed always makes the same map, so you can replay a matchup.

Side names

Rules

Map JSON

This is what AI players are shown in the arena. tiles rows hold the terrain letter for each tile: . grass, s sand, f forest, w water (can't be walked on), b bridge. elevation rows hold each tile's height, 0 to 3.

Every finished battle is saved here (in this browser). Download it as a JSON file to keep it or to compute rankings later.

The idea

Two sides get the same budget. Each places troops in their own shaded zone (Red on the left, Blue on the right). After Play, nobody can change anything. Troops follow their group orders if the army has any (see the JSON box in the Armies tab); the rest march toward the enemy side until their army spots an enemy, then go for the nearest one it can see. Hills block the view, forests hide troops, water is easy to see across, and troops head toward cannon fire they hear. If nobody is hit for 30 seconds, every troop drops its orders and attacks. Placement and orders are the whole game.

The rock-paper-scissors

  • Archers beat Swordsmen (shoot them as they walk in).
  • Swordsmen beat Knights (swords do bonus damage to horses, and knights hit swordsmen weakly).
  • Knights beat Archers and Cannons (fast, reach them before they do much).
  • Cannons are slow and pricey, but hit hard from far away and splash tight groups. They can't hit enemies right next to them, and their slow shells can miss fast knights.

Terrain

Every tile has a type and a height.

  • Grass: normal.
  • Sand (pale yellow): slow going, especially for cannons and knights.
  • Forest (dark green): slows everyone, knights the most. Archers and cannons inside can't shoot as far, troops inside see less and are harder to spot, and they take less damage from arrows and shells.
  • Water (blue, lowlands only): can't be walked on. Troops find the quickest route around it. Arrows and shells fly over it.
  • Bridges (wooden planks): the map adds these automatically so no piece of land is ever cut off. Troops on a bridge are exposed and take extra ranged damage, so bridges make good choke points.
  • Height (lighter colour, contour lines, small number 1 to 3): archers and cannons shoot further from up high, troops up high see further (and are seen from further away), everyone climbs slower, and attacking downhill does extra damage. A hill between two troops blocks their view.

How a winner is picked

A side wins when the other has no troops left. If the time limit runs out, the side with more surviving value wins (each troop's cost × how much life it has left).

Placement JSON format

{
  "side": "red",
  "troops": [
    { "type": "swordsman", "x": 6, "y": 10 },
    { "type": "archer",    "x": 3, "y": 10 },
    { "type": "knight",    "x": 5, "y": 2  },
    { "type": "cannon",    "x": 1, "y": 12 }
  ]
}

Types: archer, swordsman, knight, cannon. x is the column, y is the row. One troop per tile.