feat(test_framework): add WallsBot adversary for lead prediction testing
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"name": "WallsBot",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"authors": ["Test"],
|
||||||
|
"description": "Traces arena perimeter clockwise — test adversary for lead prediction",
|
||||||
|
"gameTypes": ["classic", "1v1"],
|
||||||
|
"platform": "Nim",
|
||||||
|
"programmingLang": "Nim"
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
exec ./out/WallsBot 2>> /tmp/wallsbot_stderr.log
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
--path:"../../.."
|
||||||
|
switch("outdir", "out")
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"name": "WallsBot",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"authors": ["Test"],
|
||||||
|
"description": "Traces arena perimeter clockwise — test adversary for lead prediction",
|
||||||
|
"gameTypes": ["classic", "1v1"],
|
||||||
|
"platform": "Nim",
|
||||||
|
"programmingLang": "Nim"
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
# WallsBot — traces arena perimeter clockwise. No firing; pure evasion target.
|
||||||
|
# Turns right 90° on wall hit, then charges forward at max speed.
|
||||||
|
|
||||||
|
import std/os
|
||||||
|
import tankroyale_botapi
|
||||||
|
|
||||||
|
const botJsonPath = currentSourcePath().parentDir / "WallsBot.json"
|
||||||
|
|
||||||
|
type WallsBot = ref object of Bot
|
||||||
|
|
||||||
|
method onRoundStarted*(bot: WallsBot, e: RoundStartedEvent) =
|
||||||
|
setTurnRate(90.0) # begin with a right turn to face along the nearest wall
|
||||||
|
|
||||||
|
method onHitWall*(bot: WallsBot, e: HitWallEvent) =
|
||||||
|
setTurnRate(90.0) # turn right 90° then keep going
|
||||||
|
|
||||||
|
method run*(bot: WallsBot) =
|
||||||
|
while isRunning():
|
||||||
|
setTargetSpeed(MAX_SPEED)
|
||||||
|
go()
|
||||||
|
|
||||||
|
when isMainModule:
|
||||||
|
var bot = WallsBot()
|
||||||
|
start(bot, botJsonPath)
|
||||||
Reference in New Issue
Block a user