#24 — PRD: Command abstraction layer for PPO action space
What to build
Rewrite the action decoding layer (mapActions in actions.nim) to translate the new 6-dim network output into goto/aimTo commands and fire decisions.
New action mapping:
Dim
Output
Encoding
0
goto x
sigmoid × battlefield width
1
goto y
sigmoid × battlefield height
2
aimTo x
sigmoid × battlefield width
3
aimTo y
sigmoid × battlefield height
4
fire decision
tanh → fire if ≥ 0
5
fire power
sigmoid × 2.9 + 0.1
mapActions should:
Decode goto(x, y) and aimTo(x, y) from sigmoid-bounded outputs
Call the goto controller (from issue slice 1) to get (targetSpeed, turnRate)
Call the aimTo controller (from issue slice 1) to get gunTurnRate
Decode fire decision and fire power as before (threshold + sigmoid scaling)
Return a BotActions struct (may need new fields for goto/aimTo targets)
mapActions will need additional parameters: bot position, heading, speed, gun direction (for the controllers). Update BotActions struct if needed to carry goto/aimTo target coordinates (PPO_Bot needs them for state vector computation).
Acceptance criteria
mapActions accepts 6-dim raw action tensor
Goto x, y are bounded to [0, arenaWidth] and [0, arenaHeight]
AimTo x, y are bounded to [0, arenaWidth] and [0, arenaHeight]
Fire decision triggers when dim 4 ≥ 0 and gunHeat ≤ 0
Fire power is in [0.1, 3.0]
Controllers are called correctly (goto → targetSpeed + turnRate, aimTo → gunTurnRate)
Unit tests verify coordinate bounds and fire logic
## Parent
#24 — PRD: Command abstraction layer for PPO action space
## What to build
Rewrite the action decoding layer (`mapActions` in `actions.nim`) to translate the new 6-dim network output into goto/aimTo commands and fire decisions.
**New action mapping:**
| Dim | Output | Encoding |
|-----|--------|----------|
| 0 | goto x | sigmoid × battlefield width |
| 1 | goto y | sigmoid × battlefield height |
| 2 | aimTo x | sigmoid × battlefield width |
| 3 | aimTo y | sigmoid × battlefield height |
| 4 | fire decision | tanh → fire if ≥ 0 |
| 5 | fire power | sigmoid × 2.9 + 0.1 |
`mapActions` should:
1. Decode goto(x, y) and aimTo(x, y) from sigmoid-bounded outputs
2. Call the goto controller (from issue slice 1) to get `(targetSpeed, turnRate)`
3. Call the aimTo controller (from issue slice 1) to get `gunTurnRate`
4. Decode fire decision and fire power as before (threshold + sigmoid scaling)
5. Return a `BotActions` struct (may need new fields for goto/aimTo targets)
`mapActions` will need additional parameters: bot position, heading, speed, gun direction (for the controllers). Update `BotActions` struct if needed to carry goto/aimTo target coordinates (PPO_Bot needs them for state vector computation).
## Acceptance criteria
- [ ] `mapActions` accepts 6-dim raw action tensor
- [ ] Goto x, y are bounded to [0, arenaWidth] and [0, arenaHeight]
- [ ] AimTo x, y are bounded to [0, arenaWidth] and [0, arenaHeight]
- [ ] Fire decision triggers when dim 4 ≥ 0 and gunHeat ≤ 0
- [ ] Fire power is in [0.1, 3.0]
- [ ] Controllers are called correctly (goto → targetSpeed + turnRate, aimTo → gunTurnRate)
- [ ] Unit tests verify coordinate bounds and fire logic
## Blocked by
- #25 — Goto and AimTo controller functions
- #26 — Network and state vector dimension changes
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Parent
#24 — PRD: Command abstraction layer for PPO action space
What to build
Rewrite the action decoding layer (
mapActionsinactions.nim) to translate the new 6-dim network output into goto/aimTo commands and fire decisions.New action mapping:
mapActionsshould:(targetSpeed, turnRate)gunTurnRateBotActionsstruct (may need new fields for goto/aimTo targets)mapActionswill need additional parameters: bot position, heading, speed, gun direction (for the controllers). UpdateBotActionsstruct if needed to carry goto/aimTo target coordinates (PPO_Bot needs them for state vector computation).Acceptance criteria
mapActionsaccepts 6-dim raw action tensorBlocked by
Implemented in commit c713585 on branch research/goto-controller.