Which save moments can EvoBot actually act on? #90
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
part-of: #88
Question
From Robocode Tank Royale official docs/sources: which events reach the bot and allow acting — self BotDeathEvent, RoundEndedEvent, GameEndedEvent — and what (if anything) is deliverable on Ctrl-C / server drop / connection loss. Include delivery timing relative to round boundaries. Resolution output: table of trigger → fires on clean end? → fires on abort/kill? → usable as save moment y/n.
claimed by wayfinder-research-agent, 2026-08-26
Resolution — researched against official Tank Royale protocol schemas, server source (Kotlin), Java Bot API reference, and official flow docs. Events are platform-defined; findings hold for the .Nim binding insofar as it follows the protocol.
Trigger table
onDeath/ ownBotDeathEventaddPublicBotEvent, Java API)onRoundEnded(RoundEndedEventForBot)onWonRound(WonRoundEvent)onGameEnded(GameEndedEventForBot)stop-game) sends NO game-ended to anyonegame-aborted-event)broadcastGameAborted()→broadcastToObserverAndControllers, GameServer.kt L785); no bot API exposes a handleronDisconnected/onConnectionErrorfire in the still-alive bot process when the socket breaks → last-resort save hook (IBaseBot.onDisconnected)Key answers
BotDeathEventis a public bot event; the victim receives its own death (API splits it intoonDeath[self] vsonBotDeath[any bot]). Delivered in the dying turn's tick, i.e., before that round'sRoundEndedEvent.onDisconnected/onConnectionErrorwhen socket drops while process lives; (c) self-installed SIGINT/SIGTERM handlers. SIGKILL/power-loss = unrecoverable by design → argues for frequent periodic saves, not end-of-battle saves.tick-event-for-bot(carrying WonRound/BotDeath events) →round-ended-event-for-bot→ next round starts withround-started-event→ first tick. Client APIs dispatch all queued events during round-end handling before the next round begins (event-handling.md). Dead bots receive no further ticks except their death tick (server skips them unless they have pending events), but DO keep receiving RoundEnded/GameEnded.Implication for EvoBot checkpointing: the only trigger that fires reliably every round regardless of survival or how the match later ends is
onRoundEnded.onGameEndedis a bonus final flush, never the safety net. Abort/Ctrl-C/server-death give at mostonDisconnected(best-effort).