feat(ground-ai): add the trigger decision channel

Estimate hit probability and request movement speed from the weapon solution.
Use visible aim samples, stock shell penetration, and separate burst paths.
This commit is contained in:
N0VAN0M4LY committed 2026-12-06 01:11:55 +08:00
1 parent 1590a2fea9
commit 4e658cae9c
20 files changed
+693 -113

No files matched your search

@@ -555,7 +555,7 @@
"estimation": "Sample-based velocity lead, exit watch and natural shot spread",
"threat": "How dangerous each discovered enemy is: distance, aim, line of sight and recent hits",
"turret": "Where the turret looks without a target: threats, cues and scanning along the route",
"fireControl": "Range bands, speed gates, barrel settle and ballistic safety",
"fireControl": "Hit probability and fire threshold, autocannon bursts, secondary weapons, barrel settle and ballistic safety",
"navigation": "Drive backend, pivot turns and tactical reverse",
"navEngine": "Baked map navigation packs, their fallback, and path costs per surface for tracked and wheeled vehicles",
"pathFollow": "Replanning, lookahead steering, corner and arrival braking, narrow passages, bumper rays, passing stopped vehicles and wrecks, giving way, three-level unstick and temporary path costs",
@@ -699,12 +699,33 @@
"stopSpeedMaxMps": "Stopped speed threshold",
"longRangeWindowSec": "Long-range clear LOS window",
"baseAlignDeg": "Base gun alignment tolerance",
"closeHitRadiusM": "Close-range hit acceptance radius",
"barrelSettleDegSec": "Max aim error drift outside close range",
"closeSettleHoldSec": "Close-range settle hold time",
"settleHoldSec": "Standard settle hold time",
"unstabilizedStopSpeedMps": "Unstabilized stop speed cap",
"stabilizedCreepSpeedMps": "Stabilized creep fire speed cap",
"aimErrorDeg": "Crew aim error (spread)",
"moveErrDegPerMps": "Aim error per m/s of own speed",
"turnErrDegPerDegSec": "Aim error per deg/s of hull turn",
"stabErrFactor": "Motion error factor with a stabilizer",
"targetHalfHeightM": "Half height of a fully visible target",
"fireThreshold": "Base hit probability needed to fire",
"minFireThreshold": "Lowest fire threshold",
"aimingThresholdBonus": "Threshold drop when the target aims at the bot",
"closeThresholdBonus": "Threshold drop at point blank",
"enemyReloadThresholdBonus": "Threshold drop after the target fired",
"enemyReloadSec": "How long a target counts as reloading after it fired",
"fleetingThresholdBonus": "Threshold drop for a target about to slip away",
"fleetingLateralMps": "Crossing speed of a slipping-away target",
"bigGunThresholdPenalty": "Threshold rise for big slow-loading guns",
"retreatThresholdPenalty": "Threshold rise while pulling back to cover",
"minShotIntervalSec": "Minimum main-gun shot interval",
"autocannonAimSlack": "Autocannon aim slack (times target size)",
"burstSec": "Burst length",
"burstPauseSec": "Pause between bursts",
"burstRecheckSec": "Safety re-check interval within a burst",
"autocannonReloadDetectSec": "Autocannon not-ready time that counts as a reload",
"auxWeapons": "Fire secondary and coaxial weapons",
"auxMaxRangeM": "Secondary and coaxial weapon range",
"auxFireAtArmor": "Secondary and coaxial weapons also fire at armored targets",
"friendlyCorridorM": "Friendly fire corridor width",
"ballisticStepMaxM": "Ballistic occlusion step length",
"ballisticSweepRadiusM": "Ballistic sphere sweep radius",
@@ -555,7 +555,7 @@
"estimation": "本车目击测速、守出口时长与自然散布",
"threat": "每个已发现敌人的危险程度:距离、是否瞄着本车、视线与最近是否命中本车",
"turret": "没有目标时炮塔看哪里:威胁、线索与沿路线扫视",
"fireControl": "距离分档、车速门槛、稳定等待与弹道防误伤",
"fireControl": "命中概率与开火门槛、机炮点射、副武器、炮管稳定和弹道安全",
"navigation": "驱动方式、原地转向与战术倒车",
"navEngine": "离线地图导航包的启用与降级,以及履带 / 轮式车在各类地表上的寻路代价",
"pathFollow": "重新寻路、前瞻跟路、弯道与到达前减速、窄路限速、车头射线、绕过停车和残骸、会车让路、三级脱困与临时寻路代价",
@@ -699,12 +699,33 @@
"stopSpeedMaxMps": "停稳判定最高车速",
"longRangeWindowSec": "远距连续射界观察窗",
"baseAlignDeg": "主炮对准允许角误差",
"closeHitRadiusM": "近距命中判定半径",
"barrelSettleDegSec": "近距以外瞄准误差最大变化速度",
"closeSettleHoldSec": "近距稳定保持时间",
"settleHoldSec": "常规稳定保持时间",
"unstabilizedStopSpeedMps": "无稳定器停稳车速上限",
"stabilizedCreepSpeedMps": "带稳定器慢速射击上限",
"aimErrorDeg": "炮手瞄准误差(散布)",
"moveErrDegPerMps": "本车每 m/s 车速增加的瞄准误差",
"turnErrDegPerDegSec": "车体每 °/s 转向增加的瞄准误差",
"stabErrFactor": "有稳定器时行进误差的倍数",
"targetHalfHeightM": "完全露出的目标半高",
"fireThreshold": "开火所需的基础命中概率",
"minFireThreshold": "开火门槛下限",
"aimingThresholdBonus": "目标瞄着本车时门槛降低",
"closeThresholdBonus": "贴脸时门槛降低(近距内按距离过渡)",
"enemyReloadThresholdBonus": "目标刚开过火时门槛降低",
"enemyReloadSec": "目标开火后视为装填中的时长",
"fleetingThresholdBonus": "目标即将离开视线时门槛降低",
"fleetingLateralMps": "视为即将离开视线的横穿速度",
"bigGunThresholdPenalty": "大口径慢装填火炮的门槛升高",
"retreatThresholdPenalty": "退入掩体途中的门槛升高",
"minShotIntervalSec": "主炮最短开火间隔",
"autocannonAimSlack": "机炮放宽倍数(目标尺寸的倍数)",
"burstSec": "点射时长",
"burstPauseSec": "点射间隔",
"burstRecheckSec": "点射中复查弹道和友军的间隔",
"autocannonReloadDetectSec": "机炮持续未就绪多久算换弹",
"auxWeapons": "使用副炮和并列武器",
"auxMaxRangeM": "副炮和并列武器的射击距离",
"auxFireAtArmor": "副炮和并列武器也打装甲目标",
"friendlyCorridorM": "友军弹道禁射走廊宽度",
"ballisticStepMaxM": "弹道硬遮挡检测步长",
"ballisticSweepRadiusM": "弹道扫掠半径",
@@ -54,7 +54,7 @@ function hasValidCrossFieldRules(effective: GroundAiTuningValues, patch: TuningP
if (est.watchMaxSec < est.watchMinSec || est.velStableSpanSec <= est.velSampleMinSpanSec) return false;
const fc = mergeSection(effective.fireControl, patch.fireControl);
if (fc.midRangeM <= fc.closeRangeM || fc.longRangeM <= fc.midRangeM) return false;
return fc.pointBlankMaxSpeedKmh >= fc.closeRangeMaxSpeedKmh;
return fc.minFireThreshold <= fc.fireThreshold && fc.pointBlankMaxSpeedKmh >= fc.closeRangeMaxSpeedKmh;
}
export function BotTuningPanel({ data, saving, onSave }: Props) {
@@ -270,12 +270,33 @@ export const BOT_TUNING_GROUPS: readonly BotTuningGroup[] = [
num('fireControl', 'stopSpeedMaxMps', 0.1, 2, 'm/s'),
num('fireControl', 'longRangeWindowSec', 1, 15, 's'),
num('fireControl', 'baseAlignDeg', 0.1, 3, '°'),
num('fireControl', 'closeHitRadiusM', 0.25, 2.2, 'm'),
num('fireControl', 'barrelSettleDegSec', 0.2, 12, '°/s'),
num('fireControl', 'closeSettleHoldSec', 0.02, 0.5, 's'),
num('fireControl', 'settleHoldSec', 0.05, 1.5, 's'),
num('fireControl', 'unstabilizedStopSpeedMps', 0.1, 3, 'm/s'),
num('fireControl', 'stabilizedCreepSpeedMps', 1.5, 15, 'm/s'),
num('fireControl', 'aimErrorDeg', 0.01, 2, '°'),
num('fireControl', 'moveErrDegPerMps', 0, 3, '°'),
num('fireControl', 'turnErrDegPerDegSec', 0, 0.5),
num('fireControl', 'stabErrFactor', 0.02, 1),
num('fireControl', 'targetHalfHeightM', 0.3, 2, 'm'),
num('fireControl', 'fireThreshold', 0.05, 0.95),
num('fireControl', 'minFireThreshold', 0.01, 0.9),
num('fireControl', 'aimingThresholdBonus', 0, 0.5),
num('fireControl', 'closeThresholdBonus', 0, 0.5),
num('fireControl', 'enemyReloadThresholdBonus', 0, 0.5),
num('fireControl', 'enemyReloadSec', 0, 15, 's'),
num('fireControl', 'fleetingThresholdBonus', 0, 0.5),
num('fireControl', 'fleetingLateralMps', 0.5, 15, 'm/s'),
num('fireControl', 'bigGunThresholdPenalty', 0, 0.5),
num('fireControl', 'retreatThresholdPenalty', 0, 0.6),
num('fireControl', 'minShotIntervalSec', 0.1, 5, 's'),
num('fireControl', 'autocannonAimSlack', 1, 10),
num('fireControl', 'burstSec', 0.2, 6, 's'),
num('fireControl', 'burstPauseSec', 0, 5, 's'),
num('fireControl', 'burstRecheckSec', 0.05, 2, 's'),
num('fireControl', 'autocannonReloadDetectSec', 0.1, 3, 's'),
{ id: 'groundAi.fireControl.auxWeapons', section: 'fireControl', field: 'auxWeapons', kind: 'bool' },
num('fireControl', 'auxMaxRangeM', 30, 1500, 'm'),
{ id: 'groundAi.fireControl.auxFireAtArmor', section: 'fireControl', field: 'auxFireAtArmor', kind: 'bool' },
num('fireControl', 'friendlyCorridorM', 1, 10, 'm'),
num('fireControl', 'ballisticStepMaxM', 5, 80, 'm'),
num('fireControl', 'ballisticSweepRadiusM', 0.02, 0.5, 'm'),
+24 -3
View File
@@ -257,12 +257,33 @@ const GroundAiFireControlSchema = z.object({
stopSpeedMaxMps: z.number().min(0.1).max(2),
longRangeWindowSec: z.number().min(1).max(15),
baseAlignDeg: z.number().min(0.1).max(3),
closeHitRadiusM: z.number().min(0.25).max(2.2),
barrelSettleDegSec: z.number().min(0.2).max(12),
closeSettleHoldSec: z.number().min(0.02).max(0.5),
settleHoldSec: z.number().min(0.05).max(1.5),
unstabilizedStopSpeedMps: z.number().min(0.1).max(3),
stabilizedCreepSpeedMps: z.number().min(1.5).max(15),
aimErrorDeg: z.number().min(0.01).max(2),
moveErrDegPerMps: z.number().min(0).max(3),
turnErrDegPerDegSec: z.number().min(0).max(0.5),
stabErrFactor: z.number().min(0.02).max(1),
targetHalfHeightM: z.number().min(0.3).max(2),
fireThreshold: z.number().min(0.05).max(0.95),
minFireThreshold: z.number().min(0.01).max(0.9),
aimingThresholdBonus: z.number().min(0).max(0.5),
closeThresholdBonus: z.number().min(0).max(0.5),
enemyReloadThresholdBonus: z.number().min(0).max(0.5),
enemyReloadSec: z.number().min(0).max(15),
fleetingThresholdBonus: z.number().min(0).max(0.5),
fleetingLateralMps: z.number().min(0.5).max(15),
bigGunThresholdPenalty: z.number().min(0).max(0.5),
retreatThresholdPenalty: z.number().min(0).max(0.6),
minShotIntervalSec: z.number().min(0.1).max(5),
autocannonAimSlack: z.number().min(1).max(10),
burstSec: z.number().min(0.2).max(6),
burstPauseSec: z.number().min(0).max(5),
burstRecheckSec: z.number().min(0.05).max(2),
autocannonReloadDetectSec: z.number().min(0.1).max(3),
auxWeapons: z.boolean(),
auxMaxRangeM: z.number().min(30).max(1500),
auxFireAtArmor: z.boolean(),
friendlyCorridorM: z.number().min(1).max(10),
ballisticStepMaxM: z.number().min(5).max(80),
ballisticSweepRadiusM: z.number().min(0.02).max(0.5),