Files
SirRoboGarage/test_decaygf_battles.nim
T
SirStone c94ba1f2fe feat(ModularBot): decay-GF gun (recency-weighted), 13 guns total
- Decay-GF: exponential decay on GF histogram (0.998/tick, ~350-tick half-life)
- Adapts faster to mid-battle strategy changes than standard GF
- Battle-tested vs WaveSurfer, Crazy, RandomMover
2026-09-20 01:52:22 +02:00

28 lines
1.1 KiB
Nim

import std/[os, strformat]
import common_libs/test_framework/test_framework
const
modularBotDir = "/home/davide/Projects/SirRoboGarage/ModularBot_garage"
samplesDir = "/home/davide/Downloads/robocode-tankroyale/sample-bots-nim-linux-1.0.7"
crazy = samplesDir / "Crazy"
waveSurfer = "/home/davide/Projects/SirRoboGarage/WaveSurfer_garage"
randomMover = "/home/davide/Projects/SirRoboGarage/RandomMover_garage"
const serverJar = "/home/davide/Projects/tank-royale/server/build/libs/robocode-tankroyale-server-0.35.5-all.jar"
const runnerJar = "/home/davide/Projects/tank-royale/runner/examples/lib/robocode-tankroyale-runner.jar"
if not fileExists(serverJar) or not fileExists(runnerJar):
echo "Skipping: Tank Royale JARs not found"
quit(0)
proc battle(name: string, dir: string) =
echo fmt"--- ModularBot vs {name} (10 rounds) ---"
let r = runBattle(@[modularBotDir, dir], rounds = 10, timeout = 300000, maxSpeed = true)
for result in r.results:
echo fmt" {result.name}: score={result.totalScore} rank={result.rank}"
echo ""
battle("WaveSurfer", waveSurfer)
battle("Crazy", crazy)
battle("RandomMover", randomMover)