fix(ground-ai): follow up the Berlin decision layer review

The first battles with the single-vehicle decision layer showed bots
sensing from a stale turret direction, fixed mounts and elevation-limited
guns that never got the hull turned for them, and bots braking late for
vehicles and wrecks.

- Perception samples the live barrel before sensing; near, mid and sight
  arcs are all measured from the barrel, and visible near and mid contacts
  in the barrel's front half are ranked with the same danger model.
- The turret may swing to a contact before it is confirmed; the trigger
  still waits for visual confirmation.
- A short halt only brakes. A fixed mount beyond its yaw span
  (turret.fixedMountYawSpanDeg) asks the hull to turn; an elevation-limited
  gun asks for a hull turn only when the stock elevation table shows the
  turn opens a sector that reaches the target.
- Friendly and enemy vehicles and wrecks take part in front and rear
  dynamic braking; detours try the sides, then backing off.

Builds and loads on the 2.61.0.64 lab client; played in three lab battles
together with the replay trace.
This commit is contained in:
N0VAN0M4LY committed 2026-12-06 13:53:51 +08:00
1 parent 038d897b1e
commit 0b841ce2a2
28 files changed
+518 -284

No files matched your search

@@ -371,6 +371,7 @@ function readTurretSection(turret: TuningReader): GroundAiTuning['turret'] {
switchMargin: turret.number('switchMargin', { min: 0, max: 3 }),
scanArcDeg: turret.number('scanArcDeg', { min: 0, max: 180 }),
scanPeriodSec: turret.number('scanPeriodSec', { min: 1, max: 30 }),
fixedMountYawSpanDeg: turret.number('fixedMountYawSpanDeg', { min: 0, max: 180 }),
};
}
+9 -11
View File
@@ -265,12 +265,10 @@
"normalSpotSec": 0.60,
"farSpotSec": 1.45,
"decayPerSec": 1.5,
// Layered awareness (decision layer design, section 3): the gun sight sees gunFovHalfDeg either
// side of the barrel; within nearAwareM the crew notices enemies all round the hull except a
// rear blind arc (nearArcDeg wide is covered), and every lookAroundSec for lookAroundHoldSec
// the rear too; within midAwareM the commander covers the hull's front half. Near and mid
// spotting take nearSpotMul / midSpotMul times as long as through the gun sight. An enemy whose
// exposure reaches discoverScore counts as discovered (position known, not yet fireable).
// Every visual arc is relative to the barrel. The sight covers gunFovHalfDeg either side;
// near awareness covers nearArcDeg around the barrel and every lookAroundSec opens the rear
// for lookAroundHoldSec. Mid-distance awareness covers the barrel's front half.
// Near and mid spotting use nearSpotMul and midSpotMul respectively.
"gunFovHalfDeg": 30.0,
"nearAwareM": 150.0,
"nearArcDeg": 270.0,
@@ -335,15 +333,15 @@
"hitMul": 2.0
},
// Turret channel (decision layer design, section 5): with no target in sight the turret looks at
// the most dangerous discovered threat, then at cues, then sweeps scanArcDeg either side of the
// route over scanPeriodSec. It turns from the engaged target to another threat only when that
// one is switchMargin more dangerous, and keeps a chosen look for at least minDwellSec.
// The turret gives visible contacts attention by danger, then checks memory and directional cues.
// While engaged, the competing threat needs switchMargin more danger to take over.
// The turret sweeps the route when it has no contact or cue.
"turret": {
"minDwellSec": 0.6,
"switchMargin": 0.25,
"scanArcDeg": 60.0,
"scanPeriodSec": 6.0
"scanPeriodSec": 6.0,
"fixedMountYawSpanDeg": 60.0
},
// Hull channel: choose a behavior by score, holding each for its configured commitment time