feat(ModularBot): anti-surfer gun + wave-surf movement module

- Anti-surfer gun: inverse GF targeting for wave-surfing enemies
- Wave-surf movement: danger histogram dodge (not wired yet, needs movement selector)
- 7 guns total, battle-tested

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-09-20 01:28:29 +02:00
parent 1cb35e9e0e
commit ebe5b1b7f1
8 changed files with 362 additions and 3 deletions
+35
View File
@@ -0,0 +1,35 @@
## Gauntlet: ModularBot vs WaveSurfer, SpinBot, Crazy — 10 rounds each.
## Captures [gun] lines and scores. Run with:
## nim c -r --path:../../common_libs tests/test_gauntlet.nim
import std/[os, strformat]
import test_framework/test_framework
const
modularBotDir = currentSourcePath().parentDir.parentDir
samplesDir = "/home/davide/Downloads/robocode-tankroyale/sample-bots-nim-linux-1.0.7"
waveSurferDir = "/home/davide/Projects/SirRoboGarage/WaveSurfer_garage"
spinBotDir = samplesDir / "SpinBot"
crazyDir = samplesDir / "Crazy"
if not fileExists("/home/davide/Projects/tank-royale/server/build/libs/robocode-tankroyale-server-0.35.5-all.jar") or
not fileExists("/home/davide/Projects/tank-royale/runner/examples/lib/robocode-tankroyale-runner.jar"):
echo "Skipping: Tank Royale JARs not found"
quit(0)
proc runAndReport(label, enemyName, enemyDir: string) =
echo fmt"\n=== {label} ==="
let r = runBattle(@[modularBotDir, enemyDir], rounds = 10, timeout = 240000)
var mbScore = 0
var enScore = 0
for b in r.results:
if b.name == "ModularBot": mbScore = b.totalScore
if b.name == enemyName: enScore = b.totalScore
let winner = if mbScore > enScore: "ModularBot" else: enemyName
echo fmt" ModularBot: {mbScore} {enemyName}: {enScore} → {winner} wins"
echo fmt" Rounds: {r.rounds.len}"
runAndReport("Battle 1/3: vs WaveSurfer", "WaveSurfer", waveSurferDir)
runAndReport("Battle 2/3: vs SpinBot", "SpinBot", spinBotDir)
runAndReport("Battle 3/3: vs Crazy", "Crazy", crazyDir)
echo "\nGauntlet complete."