PPO_Bot wiring and integration test #28
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?
Parent
#24 — PRD: Command abstraction layer for PPO action space
What to build
Wire everything together in
PPO_Bot.nimand verify end-to-end with a battle runner integration test.PPO_Bot changes:
mapActions, store the goto/aimTo targetshypot(targetX - botX, targetY - botY)abs(normalizeRelativeAngle(directionTo(aimX, aimY) - gunDirection))buildStateVectorfor next tick's statesetTargetSpeed,setTurnRate,setGunTurnRatesetAdjustGunForBodyTurn(true)is set so gun is independent of bodyIntegration test:
tools/battle_runner/run.sh) against Target botAcceptance criteria
Blocked by
Resolution
Audited the full wiring. Previous tickets (#25–#27) had already done the heavy lifting:
gotoTick/aimToTickincontrollers.nim— donemapActionsdecodes 6-dim output → goto/aimTo targets → controller calls — donePPO_Bot.nimtick loop:remainingGotoDistance/remainingGunAnglecomputed frombot.lastActionsand fed intobuildStateVector— donesetAdjustGunForBodyTurn(true)already present inonRoundStarted— doneOne gap found and fixed:
bot.lastActions.gotoX/YandaimToX/Ywere uninitialized (zero) on round start, causing a spurious ~1200-unit "remaining distance" to (0,0) on tick 1. Fixed by seeding them to the bot's actual position at the top ofrun(), matching the same pattern used to seedprevEnergy.remainingGotoDistanceandremainingGunAngleare now correctly 0 on the first tick.Compiles cleanly. Closing.