ModularBot: [result] round/battle outcome log lines (TR_RESULT_LOG, default on)

One greppable '[result]' line per round plus one at battle end, stdout only:
  [result] round 3/7  WE WON    (enemy destroyed)  | us 42.1 energy, them 0.0, 812 ticks | rounds won 3/7
  [result] battle END: rounds won 4/7

Outcome is authoritative from RoundEndedEventForBot.results.rank (1 = winner);
death observations (our onDeath, enemy onBotDeath) and onWonRound refine it
into WE WON (enemy destroyed) / WE DIED (killed) / BOTH DIED (score decided) /
TIMEOUT (score decided). Our own death is reported the instant it happens.
TR_RESULT_LOG registers in the boot env report; default on, only explicit
off-values disable it. No behaviour change - logging/state only.
This commit is contained in:
2026-09-25 22:50:46 +02:00
parent a50c0125d5
commit dc071b83f3
2 changed files with 122 additions and 0 deletions
+3
View File
@@ -48,6 +48,7 @@ type
trackerProbe*: bool
trackerProbePath*: string
powerLog*: bool
resultLog*: bool
gunStatsPath*: string
shotLogPath*: string
disabledGuns*: HashSet[int]
@@ -186,6 +187,7 @@ proc printEffectiveValues(ctx: EnvReportContext) =
emit("TR_VBULLET_ADMIT_ONLY", onOff(ctx.vBulletAdmitOnly),
sourceOf("TR_VBULLET_ADMIT_ONLY"))
emit("TR_POWER_LOG", onOff(ctx.powerLog), sourceOfPresence("TR_POWER_LOG"))
emit("TR_RESULT_LOG", onOff(ctx.resultLog), sourceOf("TR_RESULT_LOG"))
emit("TR_RECORD_WORLDSTATE", onOff(ctx.recordWorldState),
sourceOfPresence("TR_RECORD_WORLDSTATE"))
emit("TR_RADAR_FORCE_SPIN", onOff(ctx.radarForceSpin),
@@ -417,6 +419,7 @@ proc knownEnvNames*(): seq[string] =
"TR_RADAR_FORCE_SPIN", "TR_RADAR_SCANLOG", "TR_RADAR_SCAN_LOG_PATH",
"TR_TRACKER_PROBE", "TR_TRACKER_PROBE_PATH", "TR_VBULLET_ADMIT_ONLY",
"TR_POWER_LOG",
"TR_RESULT_LOG",
"TR_RAM_OPPORTUNITY", "TR_RAM_OPP_DIST", "TR_RAM_OPP_MARGIN",
"TR_RAM_ABORT_DMG", "TR_RAM_PLAN", "TR_RAM_PLAN_DIST",
"TR_RAM_PLAN_MARGIN", "TR_RAM_PLAN_HITRATE", "TR_RAM_LOG",