Prototype goto controller and test in game #23

Closed
opened 2026-08-17 16:58:21 +02:00 by SirStone · 1 comment
Owner

Blocked by: Goto controller algorithm

Parent map: #18

Question

Does the goto controller feel right when tested in the actual game? Does the tank move fluidly to target positions? Does forward/reverse selection work correctly?

Build a minimal goto controller (whatever algorithm was decided in the goto controller ticket), wire it up with hardcoded goto targets (e.g. cycle between corners), and observe the tank's movement in the Tank Royale UI. Evaluate smoothness, arrival behavior, and reverse-driving logic.

**Blocked by:** [Goto controller algorithm](#20) Parent map: #18 ## Question Does the goto controller feel right when tested in the actual game? Does the tank move fluidly to target positions? Does forward/reverse selection work correctly? Build a minimal goto controller (whatever algorithm was decided in the goto controller ticket), wire it up with hardcoded goto targets (e.g. cycle between corners), and observe the tank's movement in the Tank Royale UI. Evaluate smoothness, arrival behavior, and reverse-driving logic.
SirStone added the wayfinder:prototype label 2026-08-17 16:58:21 +02:00
Author
Owner

Resolution

Goto controller validated in-game via GotoTest prototype bot.

Algorithm

Explicit proportional steering with forward/reverse at 90° bearing threshold, using getNewTargetSpeed from utils.nim for smooth deceleration. No tan(a)/cos(a) trick — explicit branching is more robust near walls.

AimTo controller

directionTo(target) - gunDirection → normalizeRelativeAngle → clamp to ±20°/tick. Gun independent of body via setAdjustGunForBodyTurn(true).

Test results

  • Diamond circuit (center → north → west → south → east → center) completed twice with smooth arcs
  • Wall-smash test (waypoint at Y=600, physically impossible): bot reaches Y≈579 (tank radius), arrival threshold 40px catches it, advances correctly
  • Forward/reverse selection works correctly
  • Debug graphics (waypoint circles + tracking line) functional
  • Known edge case: oscillation/stuck after ~1158 ticks on 3rd loop — stuck detector needs longer reversal window. Not a blocker for PPO integration.

Prototype location

GotoTest/ — throwaway bot, single file

## Resolution **Goto controller validated in-game via GotoTest prototype bot.** ### Algorithm Explicit proportional steering with forward/reverse at 90° bearing threshold, using `getNewTargetSpeed` from utils.nim for smooth deceleration. No `tan(a)/cos(a)` trick — explicit branching is more robust near walls. ### AimTo controller `directionTo(target) - gunDirection` → `normalizeRelativeAngle` → clamp to ±20°/tick. Gun independent of body via `setAdjustGunForBodyTurn(true)`. ### Test results - Diamond circuit (center → north → west → south → east → center) completed **twice** with smooth arcs - Wall-smash test (waypoint at Y=600, physically impossible): bot reaches Y≈579 (tank radius), arrival threshold 40px catches it, advances correctly - Forward/reverse selection works correctly - Debug graphics (waypoint circles + tracking line) functional - Known edge case: oscillation/stuck after ~1158 ticks on 3rd loop — stuck detector needs longer reversal window. Not a blocker for PPO integration. ### Prototype location `GotoTest/` — throwaway bot, single file
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SirStone/SirRoboGarage#23