fix(ground-ai): improve firing on the move
Share a distance-based speed cap between tactics and the fire gate. Brake toward it and try a short halt when speed or aim keeps blocking a ready shot. Measure tracking drift relative to the aim direction and use the close-range alignment window for quick shots. Expose the controls in the launcher and record measured and permitted speeds in diagnostics. Verified both TypeScript typechecks, 2.61.0.58 and 2.61.0.60 patch checks and builds, and daScript loading in the guarded 2.61.0.58 client.
This commit is contained in:
1 parent
0167c3ea7d
commit
688406bb76
17 files changed
+218
-114
No files matched your search
@@ -190,6 +190,7 @@ function readNavigationSection(nav: TuningReader): GroundAiTuning['navigation']
|
||||
deadEchoSec: nav.number('deadEchoSec', { min: 0.3, max: 10 }),
|
||||
controlTimeoutSec: nav.number('controlTimeoutSec', { min: 0.3, max: 10 }),
|
||||
cornerBrakeAccel: nav.number('cornerBrakeAccel', { min: 0.5, max: 8 }),
|
||||
movingFireSpeedRampMps: nav.number('movingFireSpeedRampMps', { min: 0.2, max: 5 }),
|
||||
pivotAngleDeg: nav.number('pivotAngleDeg', { min: 25, max: 150 }),
|
||||
stuckWindowSec: nav.number('stuckWindowSec', { min: 1, max: 15 }),
|
||||
stuckMinMoveM: nav.number('stuckMinMoveM', { min: 0.5, max: 10 }),
|
||||
@@ -221,6 +222,7 @@ function readStateMachineSection(sm: TuningReader): GroundAiTuning['stateMachine
|
||||
}
|
||||
return {
|
||||
preaimAngleDeg: sm.number('preaimAngleDeg', { min: 1.0, max: 30.0 }),
|
||||
movingShotWaitSec: sm.number('movingShotWaitSec', { min: 0.25, max: 5.0 }),
|
||||
shortHaltMaxSec: sm.number('shortHaltMaxSec', { min: 0.5, max: 12.0 }),
|
||||
shortHaltCooldownSec: sm.number('shortHaltCooldownSec', { min: 0.5, max: 20.0 }),
|
||||
turnLaunchSpeedMps: sm.number('turnLaunchSpeedMps', { min: 0.5, max: 6.0 }),
|
||||
@@ -283,6 +285,11 @@ function readFireControlSection(fc: TuningReader): GroundAiTuning['fireControl']
|
||||
if (midRangeM <= closeRangeM || longRangeM <= midRangeM) {
|
||||
throw new TuningError('tuning file ground-ai.jsonc: fireControl ranges must satisfy closeRangeM < midRangeM < longRangeM');
|
||||
}
|
||||
const closeRangeMaxSpeedKmh = fc.number('closeRangeMaxSpeedKmh', { min: 3.6, max: 100 });
|
||||
const pointBlankMaxSpeedKmh = fc.number('pointBlankMaxSpeedKmh', { min: 3.6, max: 100 });
|
||||
if (pointBlankMaxSpeedKmh < closeRangeMaxSpeedKmh) {
|
||||
throw new TuningError('tuning file ground-ai.jsonc: fireControl.pointBlankMaxSpeedKmh must be >= closeRangeMaxSpeedKmh');
|
||||
}
|
||||
return {
|
||||
maxEngageRangeM: fc.number('maxEngageRangeM', { min: 150, max: 3000 }),
|
||||
closeRangeM,
|
||||
@@ -290,6 +297,8 @@ function readFireControlSection(fc: TuningReader): GroundAiTuning['fireControl']
|
||||
longRangeM,
|
||||
midSlowSpeedRatio: fc.number('midSlowSpeedRatio', { min: 0.1, max: 1.0 }),
|
||||
midSlowMaxMps: fc.number('midSlowMaxMps', { min: 1.0, max: 15.0 }),
|
||||
closeRangeMaxSpeedKmh,
|
||||
pointBlankMaxSpeedKmh,
|
||||
stopSpeedMaxMps: fc.number('stopSpeedMaxMps', { min: 0.1, max: 2.0 }),
|
||||
longRangeWindowSec: fc.number('longRangeWindowSec', { min: 1.0, max: 15.0 }),
|
||||
baseAlignDeg: fc.number('baseAlignDeg', { min: 0.1, max: 3.0 }),
|
||||
|
||||
@@ -102,6 +102,8 @@
|
||||
"deadEchoSec": 1.2,
|
||||
"controlTimeoutSec": 1.0,
|
||||
"cornerBrakeAccel": 1.75,
|
||||
// Speed error at which the moving-fire controller applies full throttle or braking.
|
||||
"movingFireSpeedRampMps": 1.0,
|
||||
"pivotAngleDeg": 75.0,
|
||||
"stuckWindowSec": 3.6,
|
||||
"stuckMinMoveM": 2.0,
|
||||
@@ -126,6 +128,8 @@
|
||||
// Per-bot hull state machine timings and thresholds (offline values).
|
||||
"stateMachine": {
|
||||
"preaimAngleDeg": 8.0,
|
||||
// Time a ready gun can be held up by speed or aim before attempting a short halt.
|
||||
"movingShotWaitSec": 1.0,
|
||||
"shortHaltMaxSec": 3.0,
|
||||
"shortHaltCooldownSec": 4.0,
|
||||
"turnLaunchSpeedMps": 2.1,
|
||||
@@ -174,10 +178,14 @@
|
||||
"longRangeM": 800.0,
|
||||
"midSlowSpeedRatio": 0.45,
|
||||
"midSlowMaxMps": 5.5,
|
||||
// Moving-fire speed rises from the mid-range limit through the close-range boundary to point blank.
|
||||
"closeRangeMaxSpeedKmh": 30.0,
|
||||
"pointBlankMaxSpeedKmh": 35.0,
|
||||
"stopSpeedMaxMps": 0.45,
|
||||
"longRangeWindowSec": 4.0,
|
||||
"baseAlignDeg": 0.42,
|
||||
"closeHitRadiusM": 0.85,
|
||||
// Outside close range, the rate at which barrel alignment drifts relative to the aim direction.
|
||||
"barrelSettleDegSec": 1.8,
|
||||
"closeSettleHoldSec": 0.08,
|
||||
"settleHoldSec": 0.20,
|
||||
|
||||
Reference in new issue
Block a user