fix(PPO_Bot): state vector bearing uses game coords (north=0° CW)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-08-16 16:40:28 +02:00
parent fd22535f5b
commit bbc9e51166
2 changed files with 18 additions and 5 deletions
+1 -1
View File
@@ -61,7 +61,7 @@ proc buildStateVector*(bot: BotStateData; enemy: EnemyTracker): Tensor[float32]
# Relative bearing to enemy (signed, from bot perspective)
let dx = enemy.current.x - bot.x
let dy = enemy.current.y - bot.y
let absDir = (180.0 * arctan2(dy, dx) / PI + 360.0) mod 360.0
let absDir = (180.0 * arctan2(dx, dy) / PI + 360.0) mod 360.0
let relBearing = ((absDir - bot.direction) + 540.0) mod 360.0 - 180.0
result[16] = float32(relBearing / 180.0)
# Distance to enemy