Files
WT-Offline/game-ai/ground/wto_ai_order_common.das
T
N0VAN0M4LY 7e5eb99696 feat(ground-ai): add task order, mode-aware commander v1, and world fixes
Replace the per-bot greedy cap scorer (wto_ai_macro_common.das) with a
whole-team commander and explicit task order contract, and fix the world,
spec, and navigation bugs found during the codebase audit:

- Classify ground battle modes (bttl, conq, dom) in multiplayer-missions
  v5 from mislist.blk categories (with suffix fallback for event maps) and
  emit wtoGroundMode in customRules/customBots.
- Add the commander section to tuning/ground-ai.jsonc with range and sum
  validation, compiled into WTO_AI_CMD_* constants.
- Split zone/mode/spawn refresh into wto_ai_world_zones_common.das and fix
  four world snapshot bugs: stop double-recording deaths in wreck scans
  and deduplicate with a ring cursor, refresh units before spawn fallback
  while retrying real respawn points, fall back battleCenter to spawns
  when capCount is 0, and relax cap radius clamping to 10..180 m.
- Fix limited-traverse yaw overwrite in wto_ai_specs_common.das and
  compute pivot turn angle against wishDir in wto_ai_nav_common.das.
- Introduce WtoTaskOrder (wto_ai_order_common.das) and whole-team
  commander v1 (wto_ai_commander_common.das +
  wto_ai_commander_anchors_common.das): mode-aware role quotas (Bttl,
  Conq, Dom), deterministic distance + vehicle-suitability matching,
  20-second role hysteresis, separate total-assigned vs cap-insider
  counters, frontline-relative SPAA anchors, EventZoneCaptured immediate
  rebalance, and per-team WTO_AI|CMD telemetry.

Verified root and launcher type checks, multiplayer-missions v5 dataset
extraction (1140 missions with Bttl/Conq/Dom classification), isolated
2.61.0.58 build (18 ground AI modules packed), and clean in-engine
daScript compilation/load (wto_ai_runtime.das loaded in 155 ms, 0 compile
errors). Live battle tuning and acceptance deferred until the full
pipeline is wired.
2026-12-03 17:20:17 +08:00

54 lines
1.6 KiB
Plaintext

// Task order contract between the team commander and per-bot hull behavior.
// Every per-bot decision reads `WtoTaskOrder` rather than guessing team intent.
options indenting = 2
options no_global_heap = true
module wto_ai_order_common shared
let public WTO_MODE_UNKNOWN = 0
let public WTO_MODE_BTTL = 1
let public WTO_MODE_CONQ = 2
let public WTO_MODE_DOM = 3
let public WTO_CMD_ASSAULT = 0
let public WTO_CMD_FLANK = 1
let public WTO_CMD_OVERWATCH = 2
let public WTO_CMD_DEFEND = 3
let public WTO_CMD_RESERVE = 4
let public WTO_CMD_SPAA = 5
let public WTO_URGENCY_LOW = 0
let public WTO_URGENCY_MED = 1
let public WTO_URGENCY_HIGH = 2
[safe_when_uninitialized]
struct public WtoTaskOrder
valid : bool = false
role : int = 0
capIndex : int = -1
goalPos : float3 = float3(0.0, 0.0, 0.0)
urgency : int = 1
maxStopRangeM : float = 800.0
assignedAt : float = -100.0
expiresAt : float = -100.0
cautious : bool = false
overwatchOutside : bool = false
spaaAnchorValid : bool = false
spaaAnchorPos : float3 = float3(0.0, 0.0, 0.0)
spaaRelocateAt : float = -100.0
[never_inline]
def public wto_order_is_offensive(role : int) : bool
return role == WTO_CMD_ASSAULT || role == WTO_CMD_FLANK
[never_inline]
def public wto_order_max_stop_range(role, urgency : int; maxEngageRangeM : float) : float
if role == WTO_CMD_ASSAULT || role == WTO_CMD_FLANK
return 300.0
if role == WTO_CMD_OVERWATCH
return maxEngageRangeM
if role == WTO_CMD_DEFEND
return urgency == WTO_URGENCY_HIGH ? 300.0 : maxEngageRangeM
if role == WTO_CMD_RESERVE
return 800.0
return 300.0