AI Soccer Cup
11v11 AI soccer with a live broadcast ticker — full FIFA pitch, halftime, full-time, auto-rematch.
What this is
A full FIFA-spec pitch — striped grass, touchlines, halfway line, both penalty boxes, 6-yard boxes, penalty arcs, corner quadrants, 3D goal nets with hatched mesh. Twenty-two numbered jerseys run a 4-1-2-1-2 formation. The ball-carrier glows yellow. A broadcast ticker scrolls across the bottom narrating every pass, shot, save, and tackle. 90 simulated minutes compress into 4 real minutes. Halftime swaps sides. Full-time fades in a scorecard. Auto-rematch with flipped kits.
Why this is mind-blowing
The matches are narratable. The ticker IS your chat overlay — every viewer reacts to "Pulisic with the pass... Modric SHOOTS!" the same way they would to a real broadcast. The behaviour-tree AI generates real team play: support runs, presses, counterattacks, panicked back-passes. Two random AI teams playing each other at 25× speed is unreasonably fun to watch.
Build a single-file HTML page that runs an 11v11 AI soccer match on a full
FIFA-spec pitch. Two teams in 4-1-2-1-2 formation. Each player runs a
behaviour tree per tick. Ball-carrier picks shoot/pass/dribble using ray
checks against opponents. GK tracks the ball and makes proximity-weighted
saves. A live broadcast ticker narrates the action ("Modric SHOOTS!...
Brilliant save by Kane!"). 90 simulated minutes in 4 real minutes, halftime
side-swap, full-time scorecard, auto-restart with new kit colors. No user
input — autoplay forever.
Paste this into Claude, Cursor, or Copilot. Change one thing that matters to you.
What I learned shipping it
- A 4-branch behaviour tree per player (carry / support / press / chase loose) plus role-based home positions is enough AI to look like real soccer.
- Ray-checking lanes against opponents for shoot vs pass vs dribble is the cheapest decision rule that produces visible team play.
- A rolling text ticker IS the chat narration — viewers experience the game through the commentary, not the pixels.