案例研究:AI 助手編寫 JavaScript 戰鬥機械人並登上公開排行榜
Case study: an AI assistant wrote a JavaScript combat bot and put it on a public ladder
AI 助手為作者編寫並操作一個 JavaScript 戰鬥機械人,參加 battle.training 公開排行榜上的 2D 戰鬥。上載約三小時後,機械人累積 133 場比賽,取得 53 勝、43 負、37 和,評分為 1048,沒有逾時或執行時異常。這個機械人沒有使用機器學習或規劃器;作者指出,單一機械人在單一競技場的成績只是編程輸出的一個數據點,並非模型評測。
Written by Oren Rot with AI help in the writing process.
Disclosure: this article is part of a paid campaign for battle.training. The bot described below was designed, tested, and is operated by an AI assistant working for the author. Ladder figures come from the platform API; benchmark and replay figures come from local runs with the platform's SDK. All are dated October 28, 2026.
battle.training is a combat arena where a JavaScript bot plays ranked 2D battles against other bots on a public ladder. Each match opens with a draft phase (units such as scouts, APCs, MBTs, engineers, missile launchers, drones), then runs a deterministic fixed-point simulation with fog of war, terrain effects, and a central hill that scores points per tick and can lock the game. A bot issues orders every tick.
The bot. The assistant wrote a deliberately simple bot: scouts push vision, armor groups toward the hill, engineers repair damaged units, and the bot moves to re-contest the hill when the opponent approaches a lock. The bot contains no machine learning and no planner. It was uploaded on October 28, 2026, and the ladder runs matches continuously.
Ladder record (platform API, October 28, 2026, about three hours after upload): 133 games, 53 wins, 43 losses, 37 draws, rating 1048, zero timeouts or runtime exceptions. One bot, one arena, one day: a datapoint about coding output, not a model evaluation.
How the bot got there, with evidence
Local benchmarking before upload. The arena's SDK includes built-in house bots for offline testing. The uploaded version was benchmarked over 160 local games (40 against each of four house bots) and won 113, lost 47, drew 0. Two later variants were tested and rejected: one changed nothing (identical 113-47-0), and one regressed slightly, winning 49 of 80 games against the two aggressive house bots where the uploaded version won 50 of 80. Neither variant reached the ladder.
Deterministic replay verification. Every match can be downloaded and re-simulated tick by tick with the SDK verifier, which hashes the game state at every tick, so any divergence is pinned to an exact tick. In one documented set, the bot lost 0-2: game one ended 0-1400 by hill lock, game two by elimination at 0-0. Re-simulation reproduced both recorded results exactly (all 4,301 and 3,739 tick hashes matched). One real integration gotcha: the SDK's simulator defaults to season-1 rules, so season-2 replays fail verification with a rules_mismatch error unless the season-2 rules are passed explicitly. This is visible in the SDK source (the match constructor defaults to its season-1 ruleset) and was confirmed by re-running both replays with the correct rules.
Observed patterns, labeled as such. The snapshot included 37 draws in 133 games. In the documented set loss, the opponent accumulated 1,400 hill points in game one while this bot scored none. A plausible hypothesis is that passive play cedes the hill and loses to the lock timer, but that is an observation from one bot's match history, not a controlled experiment.
Drafts are auditable. The full draft for both sides is recorded in every replay header, so draft decisions can be reviewed with the same tooling as the games themselves.
Where this fits
A bot arena is a useful supplementary test of coding output: the producing agent must deliver a complete, correct program that survives an adversarial environment, and the scoring is objective. It is not a company evaluation and not a general capability measure. The record above describes this bot, in this arena, on this date.
The ladder is free, and the SDK runs locally: battle.training.
來源:DEV Community · dev.to