feat(engine): add zone bounds to VisibleState for bot awareness
Per plan §3.7, the shrinking zone is a forcing function that should force combat engagement. Previously, bots could not see the current zone state (center, radius, active) and would move away from the zone center, dying without understanding why. Changes: - Add Zone field to VisibleState (types.go) - Populate zone bounds in GetVisibleState() when zone enabled (game.go) This allows HTTP and local bots to see the zone and react strategically (e.g., move toward center to avoid zone death while engaging enemies). Test: zone bounds now appear in VisibleState JSON with correct values. Closes: bf-tfyy
This commit is contained in:
parent
d21c621485
commit
1df567b15f
2 changed files with 10 additions and 0 deletions
|
|
@ -326,6 +326,15 @@ func (gs *GameState) GetVisibleState(playerID int) *VisibleState {
|
|||
}
|
||||
}
|
||||
|
||||
// Include zone bounds if enabled
|
||||
if gs.Config.ZoneEnabled {
|
||||
vs.Zone = &ZoneBounds{
|
||||
Center: gs.ZoneCenter,
|
||||
Radius: gs.ZoneRadius,
|
||||
Active: gs.ZoneActive,
|
||||
}
|
||||
}
|
||||
|
||||
return vs
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -291,6 +291,7 @@ type VisibleState struct {
|
|||
Cores []VisibleCore `json:"cores"`
|
||||
Walls []Position `json:"walls"`
|
||||
Dead []VisibleBot `json:"dead"`
|
||||
Zone *ZoneBounds `json:"zone,omitempty"` // Current zone state (nil if zone disabled)
|
||||
}
|
||||
|
||||
// VisibleBot represents a bot visible to a player.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue