diff --git a/PPO_Bot/PPO_Bot.nim b/PPO_Bot/PPO_Bot.nim index 0324b50..79dcf15 100644 --- a/PPO_Bot/PPO_Bot.nim +++ b/PPO_Bot/PPO_Bot.nim @@ -139,6 +139,8 @@ method onRoundEnded*(bot: PPOBot, e: RoundEndedEventForBot) = printToStdOut(&"R:{roundCounter} ticks:{ticks} buf:{bot.buffer.len} sinceUpd:{roundsSinceUpdate}/{hpUpdateInterval} avgR:{avgRStr} score:{e.results.totalScore}\n") echo &"R:{roundCounter} ticks:{ticks} buf:{bot.buffer.len} sinceUpd:{roundsSinceUpdate}/{hpUpdateInterval} avgR:{avgRStr} score:{e.results.totalScore}" + writeFile(weightsRoot / "round_counter.txt", $roundCounter) + if bot.buffer.len == 0: bot.hasLastTrans = false return @@ -152,7 +154,6 @@ method onRoundEnded*(bot: PPOBot, e: RoundEndedEventForBot) = # checkpoint save, but keep advancing/writing round_counter.txt so run.sh's # remaining-rounds bookkeeping still works, and keep the game line above. if evalOnly: - writeFile(weightsRoot / "round_counter.txt", $roundCounter) bot.buffer.clear() bot.hasLastTrans = false roundsSinceUpdate = 0