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

@@ -642,8 +642,8 @@
"decayPerSec": "Exposure decay rate per second",
"gunFovHalfDeg": "Gun sight half-angle",
"nearAwareM": "Close all-round awareness range",
"nearArcDeg": "Close awareness arc around the hull",
"midAwareM": "Commander awareness range (hull front half)",
"nearArcDeg": "Close awareness arc around the barrel",
"midAwareM": "Medium awareness range (barrel front hemisphere)",
"nearSpotMul": "Close awareness spotting time multiplier",
"midSpotMul": "Commander awareness spotting time multiplier",
"lookAroundSec": "Look-around interval",
@@ -682,7 +682,8 @@
"minDwellSec": "Minimum time on a chosen look direction",
"switchMargin": "Extra danger needed to turn from the engaged target",
"scanArcDeg": "Scan arc either side of the route",
"scanPeriodSec": "Scan sweep period"
"scanPeriodSec": "Scan sweep period",
"fixedMountYawSpanDeg": "Max yaw range for hull-mounted guns"
},
"behavior": {
"scoreIntervalSec": "Behavior scoring interval",
@@ -642,8 +642,8 @@
"decayPerSec": "失联曝光每秒衰减率",
"gunFovHalfDeg": "瞄准镜视野半角",
"nearAwareM": "近距环视感知距离",
"nearArcDeg": "近距感知覆盖车体周围的角度",
"midAwareM": "车长感知距离(车体前半球)",
"nearArcDeg": "以炮口为基准的近距感知角度",
"midAwareM": "中距感知距离(炮口前半球)",
"nearSpotMul": "近距感知看清耗时倍数",
"midSpotMul": "车长感知看清耗时倍数",
"lookAroundSec": "环视间隔",
@@ -682,7 +682,8 @@
"minDwellSec": "选定的观察方向至少保持的时间",
"switchMargin": "从交战目标转向其他威胁所需高出的危险度",
"scanArcDeg": "沿路线向两侧扫视的角度",
"scanPeriodSec": "扫视一个来回的时长"
"scanPeriodSec": "扫视一个来回的时长",
"fixedMountYawSpanDeg": "判定为固定炮座时的最大水平射界"
},
"behavior": {
"scoreIntervalSec": "行为打分间隔",
@@ -247,6 +247,7 @@ export const BOT_TUNING_GROUPS: readonly BotTuningGroup[] = [
num('turret', 'switchMargin', 0, 3),
num('turret', 'scanArcDeg', 0, 180, '°'),
num('turret', 'scanPeriodSec', 1, 30, 's'),
num('turret', 'fixedMountYawSpanDeg', 0, 180, '°'),
],
},
{
@@ -227,6 +227,7 @@ const GroundAiTurretSchema = z.object({
switchMargin: z.number().min(0).max(3),
scanArcDeg: z.number().min(0).max(180),
scanPeriodSec: z.number().min(1).max(30),
fixedMountYawSpanDeg: z.number().min(0).max(180),
});
const GroundAiBehaviorSchema = z.object({
@@ -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