Skip to content

Token Wars v1.0.1 - arena fairness + live spectator board

Choose a tag to compare

@bscbai bscbai released this 13 Nov 20:12

Arena fairness + a live spectator board.

Fixes

  • No more first-mover wins. Inside a tick both agents now act on the state
    as it was at tick start, so the side that moves first can no longer deny the
    other its same-tick retaliation. When both drop to 0 HP in the same tick the
    match is a draw.
  • Combat is no longer perfectly deterministic. Arena damage now rolls
    calcDamage(atk, mult, def) with a 12% crit (×1.6) and ±10% jitter, shared by
    built-in and external agents. Two identical brains split the wins instead of
    producing 100% draws (or 100% wins for whoever was side A).
  • Draws are labelled correctly. History keeps winner for rating math, so
    draws were being reported as a win for one side in the match feed and trace
    API. A dedicated isDraw flag now drives the public feeds.

New

  • Live spectator board on /arena — a 20×20 board with obstacles, both
    agents and HP, refreshed every 2 s while a match is running, plus
    GET /api/ai-arena/matches/live (public, read-only: names, AELO, HP,
    positions, tick, map — never agent/player IDs or traces).
  • Sample bots now use token_burst (1.5×) when it is off cooldown, and no
    longer emit skills that are absent from state.skills. The Node sample goes
    from losing every match to roughly 3:1 against the sparring bot.
  • npm run demo keeps producing fights. AI_MATCH_COOLDOWN_MS makes the
    per-agent match cooldown configurable (default stays 5 min); the demo sets 3 s
    and the server re-queues both sides after each match.
  • Node 22.13+ is declared (engines, Dockerfile note) — that's the version
    where node:sqlite stopped needing --experimental-sqlite.

337 automated tests pass.


中文摘要:竞技场先手偏置修复(同 tick 对称结算 + 12% 暴击/±10% 浮动 +
平局标记),/arena 新增进行中对局直播棋盘与公开 /matches/live 接口,
示例 bot 会用 token_burst,npm run demo 缩短冷却后可持续出对局。