Skip to content

Add headless AI tournament mode for statistical benchmarking#7

Draft
chrisraff with Copilot wants to merge 2 commits into
masterfrom
copilot/create-ai-matchup-system
Draft

Add headless AI tournament mode for statistical benchmarking#7
chrisraff with Copilot wants to merge 2 commits into
masterfrom
copilot/create-ai-matchup-system

Conversation

Copilot AI commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

No built-in way to compare AI strategies across many games — only real-time play was possible, making it impractical to measure win-rate edges.

Changes

  • tournament.js (new): Headless game simulation engine + HTML overlay UI

    • AI_REGISTRY auto-detects all loaded AI functions at page load — new AIs are picked up automatically
    • Simulates battles, supply, and turn advancement directly (no CreateJS dependency), running ~100 games near-instantly via setTimeout batching to keep the browser responsive
    • Shows Results by AI (aggregate win % across all slots using that AI) and Results by Player Slot (per-slot breakdown to surface positional bias)
  • index.html: Tournament overlay div + CSS, tournament.js script tag, "Tournament / Benchmark" link below canvas

  • main.js: TOURNAMENT button added to title screen (button index 8)

UI

Configuration panel — player count (2–7), games (1–10,000), AI assignment per slot:

Tournament config

Results after 100 games (default 7-player config):

Tournament results

ai_defensive shows a clear edge (~50%+ win rate) vs. ai_default (~28%) and ai_example (~19%) in the default 7-player setup.

Original prompt

can you make a way to quickly have different aid play against each other to determine which ones have statistical edges?


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: chrisraff <22504698+chrisraff@users.noreply.github.com>
Copilot AI changed the title [WIP] Add system for AI matchups to analyze performance Add headless AI tournament mode for statistical benchmarking Mar 14, 2026
Copilot AI requested a review from chrisraff March 14, 2026 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants