MassBattle Docsv1.19.20

Traffic.h

USTRUCT ×9 UENUM ×1

Source/MassBattle/Public/Fragments/Traffic.h

概述 Overview

叠加在 ORCA 避障之上的交通规则共享 fragment FTrafficShared(FA_MassBattleBaseSharedFragment 派生)、枚举 ETrafficSide 与 8 个规则子结构。每条规则有独立开关且默认全开;总闸 FAvoidance::bUseTrafficRules(默认关)是启用整个交通层的唯一开关,每条规则 bEnable 关闭时干净退化。规则分三类:预解算机动原语(求解器运行前施加于 DV:SideStep 仅静止,LaneShift 与 Flank 仅移动,WallSlide 始终生效)、责任仲裁(ComputeAvoidanceRatio 内逐对应用:单一 Arbitration 让步矩阵 + Combat.RightOfWay 攻击者路权 + Arbitration.ReturnPriorityDist 远归位路权)、求解器范围规则(LivingVsDying 采集过滤 / Combat.SkipAvoidance 整段跳过)。质量加权由全局唯一的 Arbitration.MassWeighting 统一承担(取代旧各规则独立的 MassWeightingStrength)。以可变共享片段分发:相同 authored 值在每个原型中合并为一个实例(模拟 FTrafficShared / FAnimShared 模式),同时允许 GetMutableSharedFragment 运行时调整。

Traffic-rule shared fragment FTrafficShared (derived from FA_MassBattleBaseSharedFragment) layered on top of ORCA avoidance, plus the ETrafficSide enum and 8 rule sub-structs. Each rule has an independent on/off switch and all default ON; the master gate FAvoidance::bUseTrafficRules (default OFF) is the single switch that arms the whole layer, and each rule's bEnable degrades cleanly when off. The rules fall into three classes: pre-solve maneuver primitives (applied to DV before the solver runs: SideStep is idle-only, LaneShift and Flank are moving-only, WallSlide is always on), yield arbitration (applied per neighbor pair inside ComputeAvoidanceRatio: the single Arbitration yield matrix + Combat.RightOfWay attacker right of way + Arbitration.ReturnPriorityDist far-returner right of way), and solver-scope rules (LivingVsDying gather filter / Combat.SkipAvoidance whole-solver bypass). Mass weighting is carried by the single global Arbitration.MassWeighting (replacing the former per-rule MassWeightingStrength knobs). Distributed as a mutable shared fragment so identical authored values dedupe to one instance per archetype (mirroring the FTrafficShared / FAnimShared pattern) while still allowing runtime tweaks via GetMutableSharedFragment.

ETrafficSide UENUM

对头车道形成的世界侧约定,由 FTrafficArbitration::TrafficSide 使用;歧义判侧(横向证据落在 CommitBand 死区内时)也退回该约定。

World-side convention for head-on lane formation, used by FTrafficArbitration::TrafficSide; ambiguous side picks (lateral evidence inside the CommitBand dead-zone) also fall back to it.

值 Value说明 Description
Right靠右行驶(CW 转向,历史默认)。Drive on the right (CW steer, historical default).
Left靠左行驶。Drive on the left.

FLivingVsDyingRule USTRUCT

采集阶段过滤规则:关闭时,死亡邻居从 RVO 邻居列表中移除——自身可穿过倒下身体。PBD 物理碰撞由 Collider.bCollideWithDyingAgent 单独控制。

Gather-phase filter rule: when disabled, dying neighbors are removed from the RVO neighbor list — self walks through falling bodies. PBD physical collision is governed separately by Collider.bCollideWithDyingAgent.

成员变量 Members

名称 Name类型 Type默认值说明 Description
bEnableboolfalse启用后死亡邻居仍计入 RVO 邻居列表并正常避让;关闭则采集阶段过滤死亡单位。When enabled, dying neighbors stay in the RVO list and are avoided like normal agents; when disabled they are filtered out during gathering.

FTrafficArbitration USTRUCT

L2 责任仲裁(Docs/TrafficRedesignPlan.md):单一让步矩阵取代旧五条责任规则(ArrivedVsReaching / OffPathVsOnPath / NonObstAvoidingVsObstAvoiding / NonAttackerVsAttacker / AttackerVsAttacker)。逐对裁决谁让多少:档位低方、离路径方、同向追尾后方、封锁面对方统一承担 YieldBias,对方承担其余;唯一全局 MassWeighting 缩放不对称对(取代旧四条规则各自的强度)。同时携带机动层共享参数:行进侧约定(TrafficSide)、判侧死区(CommitBand 滞回)、统一幅度语义(最大速度 × BiasSpeedFrac,BiasCapFactor 封顶)。关闭 → 旧基线(可让对称 0.5、不可移动 1.0)。

L2 yield arbitration (Docs/TrafficRedesignPlan.md): a single matrix replacing the five former responsibility rules (ArrivedVsReaching / OffPathVsOnPath / NonObstAvoidingVsObstAvoiding / NonAttackerVsAttacker / AttackerVsAttacker). ComputeYield decides per pair who yields how much: the lower-rank side, the off-path mover, the same-lane rear and the blockade-facing agent take YieldBias, the other side the rest; one global MassWeighting scales asymmetric pairs (replacing the four per-rule strengths). Also carries the shared maneuver-layer knobs: the traffic-side convention (TrafficSide), the side-pick dead-zone (CommitBand hysteresis) and the unified magnitude semantics (MaxSpeed × BiasSpeedFrac, capped at × BiasCapFactor). Disabled → legacy baseline (symmetric 0.5, immovable 1.0).

成员变量 Members

名称 Name类型 Type默认值说明 Description
bEnablebooltrue启用责任仲裁矩阵。关闭→旧基线:可让对对称 0.5、对不可移动方全额 1.0(攻击者对在 Combat.RightOfWay 关闭时也回退对称)。Enable the yield matrix. Disabled → legacy baseline: symmetric 0.5 for every movable pair, full yield (1.0) vs immovable others (attacker pairs fall back to symmetric unless Combat.RightOfWay is enabled).
YieldBiasfloat0.8f任意不对称对中让步方的基础承担比例——路权阶梯(移动 > 回归 > idle)、同向偏航方、追尾后方、攻击者对后方;对方承担 1 - 该值。0.5 = 对称(编辑器 0.5-1.0)。Base yield share for the YIELDING side of any asymmetric pair — right-of-way ladder (Moving > Returning > Idle), same-lane off-path mover, overtake rear, attacker-pair rear; the other side takes 1 - this. 0.5 = symmetric (editor 0.5–1.0).
MassWeightingfloat0.f全局质量不对称强度(取代旧四条规则各自的 MassWeightingStrength),同时作用于责任与偏置幅度:按 2×OtherMass/(SelfMass+OtherMass) 缩放——轻己多让、重己少让。0=关闭,1=完全(编辑器 0-1)。Global mass-asymmetry strength (replaces the four per-rule MassWeightingStrength knobs); scales asymmetric yields and bias magnitudes by 2×OtherMass/(SelfMass+OtherMass) — light self yields more, heavy self less. 0 = off, 1 = full (editor 0–1).
TrafficSideETrafficSideRight对头车道与歧义判侧的世界侧约定。右 = 靠右行驶(CW,历史默认)。World-side convention for head-on lane formation and ambiguous side picks. Right = drive on the right (CW steer, historical default).
CommitBandfloat25.f判侧死区(厘米,无状态滞回):横向证据(对头叉角 / 路径侧偏)落在 ±带宽内时退回行进侧约定,杜绝抖动换边。0 = 旧极小阈值。Side-pick dead-zone in cm (stateless hysteresis): when the lateral evidence (lane-shift cross angle or path lateral offset) falls within ±this band, the pick falls back to the TrafficSide convention instead of flip-flopping with jitter. 0 = legacy tiny epsilon.
BiasSpeedFracfloat1.f统一机动幅度语义:每邻居偏置基数 = 最大速度 × 此值(SideStep 用;LaneShift 与 Flank 用角度)。Unified maneuver magnitude semantics: per-neighbor bias base = MaxSpeed × this (SideStep; LaneShift and Flank use degrees).
BiasCapFactorfloat2.f统一上限:累加偏置总幅 ≤ 最大速度 × BiasSpeedFrac × 此值(SideStep)。Unified cap: total additive bias magnitude ≤ MaxSpeed × BiasSpeedFrac × this (SideStep).
ReturnPriorityDistfloat0.f远归位阈值(厘米,2D 距 goal 口径),三重职责:(1) 路权——回归中且达阈值者发布 TrafficRank 3(仅次战斗、高于移动),低档位者让行侧让;(2) 占用豁免——达阈值时 goal 被占也照样前往(挤入),阈值内被占不走;(3) 延迟豁免——达阈值时跳过 InitDelay,出 retrigger 线第一帧即触发。0 = 全关(档位 1、占用门恒生效)。Far-returner threshold (cm, 2D dist-to-goal), triple role: (1) right of way — a RETURNING agent at/beyond it publishes TrafficRank 3 (below only combat, above Moving), lower ranks yield and sidestep; (2) occupied-goal bypass — at/beyond it the return proceeds even when the goal is occupied (press in); inside it the occupancy gate holds; (3) delay bypass — at/beyond it InitDelay is skipped: the return triggers on the first frame outside the retrigger line. 0 = all off (rank 1, gate always applies).

FCombatRule USTRUCT

战斗与交通的交互(合并旧攻击者路权与 AttackerSkipAvoidance 两条规则):攻击状态单位与避障/交通系统的交互方式,两个独立子开关。状态模型:Aim/前摇/后摇与追击接受半径内的 Cooling 是同一个锁定态(站定、有路权);超出追击接受半径的 Cooling 是攻击追击——Agent 主动走近目标并正常参避(Attack.Range > Chase.AcceptanceRadius 的压进配置:远射程开火、冷却期间压进)。

Combat interplay with traffic (merges the former attacker right-of-way and AttackerSkipAvoidance rules): how attack-state agents interact with the avoidance/traffic system, via two independent sub-toggles. State model: Aim/PreCast/PostCast and Cooling-within-chase-acceptance are ONE locked state (planted, right of way); Cooling BEYOND the chase acceptance is attack-chase — the agent actively walks in and participates in avoidance (the Attack.Range > Chase.AcceptanceRadius press-in config: fire from max range, close in during cooldown).

成员变量 Members

名称 Name类型 Type默认值说明 Description
bRightOfWaybooltrue攻击者路权:攻击者在网格注册时发布 bCanAvoid=false,非攻击者视其为不可移动并绕行;攻击者自身忽略非攻击者;攻击者间不可移动对按 Arbitration.YieldBias 前后划分(后方让)。覆盖 Aim/前摇/后摇与追击接受半径内的 Cooling(站定);攻击追击(在程外冷却、正在走近)像普通移动者一样参避。Attackers have right of way: they publish bCanAvoid=false at grid registration so non-attackers treat them as immovable and route around; a self-attacker ignores non-attackers; attacker-vs-attacker immovable pairs split rear/front via Arbitration.YieldBias (rear yields). Covers Aim/PreCast/PostCast and Cooling within the chase acceptance radius (planted); attack-chase (cooling beyond acceptance, walking in) participates like any mover.
bSkipAvoidanceboolfalse战斗跳过避障总开关:Aim/前摇/后摇跳过整套避障求解(DV 原样通过,无求解器、无预解算原语、空闲侧让抑制——站定,与瞄准同权)。Cooling 仅在追击接受半径内跳过;在程外是攻击追击——Agent 主动走向目标并像普通移动者一样参避。距离用统一胶囊表面距尺子判定(与攻击进入判定同一函数)。Combat skip-avoidance master switch: Aim/PreCast/PostCast skip the entire avoidance solver (DV verbatim, no solver, no pre-solve primitives, idle sidestep suppressed — plant feet, same right of way as aiming). Cooling skips only while INSIDE the chase acceptance radius; cooling beyond it is attack-chase — the agent actively walks toward the target and participates in avoidance like any mover. Range judged by the unified capsule surface-to-surface ruler (same helper as attack entry).

FFlankRule USTRUCT

绕行机动原语:移动非攻击者旋转 DV 以绕开前进路径走廊内的挡路者——不可移动体(bCanAvoid=false)与更重单位一并处理(旧两种模式合并,由责任仲裁决定谁绕)。带缝隙瞄准:走廊内 ≥2 个阻挡者夹出横向缝隙且净宽(边到边)≥ 2×自身半径 + MinGapWidth 时,以缺口缩放的前馈偏置瞄准缝心穿过(对准即归零);更窄的缝物理上不可通行,直接排除(窄缝扑口是堆积主因之一)。无可钻缝 → 逐阻挡者距离加权远离推力(绕开整簇)。所有侧向量均在路径绝对系下计算。

Flank maneuver primitive: a moving non-attacker rotates its DV to clear blockers in its forward path corridor — immovable bodies (bCanAvoid=false) and heavier agents alike (the two former Flank modes merged; the yield matrix already arbitrates who detours). Gap seeking: when ≥2 corridor blockers bound a lateral gap whose free width (edge-to-edge) ≥ 2×SelfRadius + MinGapWidth, a deficit-scaled feedforward nudge aims at the gap center (magnitude → 0 as self lines up); narrower gaps are physically impassable and excluded (mouth pile-up). No threadable gap → per-blocker distance-weighted away-nudge (flank around the cluster). All lateral quantities are computed in path-absolute coordinates.

成员变量 Members

名称 Name类型 Type默认值说明 Description
bEnablebooltrue移动非攻击者旋转期望速度以绕开前进走廊内的挡路者(不可移动体与更重单位)。旋转角直接可控、与速度无关;|DV| 不变。Moving non-attacker self rotates its DesiredVelocity to clear blockers in its forward path corridor (immovable bodies and heavier agents). The rotation angle is direct and speed-independent; |DV| unchanged.
LateralBufferfloat200.0f额外横向间距(厘米),加到(自身半径 + 对方身体半径)上。越大走廊越宽。Extra lateral clearance (cm) added to (SelfRadius + other body radius). Larger = wider corridor.
MinGapWidthfloat50.0f缝宽门(厘米):相邻阻挡者之间的横向缝隙净宽(边到边)≥ 2×自身半径 + 此值才允许钻缝;更窄的缝保持绕行横移——绕开整簇而非硬挤。Gap-width gate (cm): a lateral gap between adjacent corridor blockers is threaded only if its free width (edge-to-edge) ≥ 2×SelfRadius + this. Narrower gaps keep the flank nudge — the agent goes around the cluster instead of squeezing through.
GapCommitBandfloat100.0f缝宽门过渡带(厘米):缝隙净宽从需求值到需求值 + 此带之间时,钻缝权重 0→1 平滑爬升。0 = 硬切换。防止接近过程中测量宽度波动导致钻缝/绕行逐帧翻转。Smooth transition band (cm) above the required gap width: thread weight ramps 0→1 as gap width goes Required → Required + Band. 0 = hard switch. Prevents per-frame flip-flop between threading and flanking as the measured width fluctuates while approaching.
PerBlockerDegfloat180.f远离推力路径:每单位带符阻挡权重的旋转角(度;|权重和| ≈ 按接近度衰减的有效阻挡数)。镜像 LaneShift 的每邻居角度语义。坦克实测 180(远 = 温和漂移,近 = 果断绕行)。Away-nudge path: rotation (deg) per unit of signed blocker weight (|weight sum| ≈ proximity-falloff-weighted effective blocker count). Mirrors LaneShift's PerNeighborDeg semantics. Empirically 180 for tanks (far = gentle drift, near = decisive).
MaxDeflectDegfloat180.fflank 总旋转角硬上限(度,编辑器 0-360)。模长不变,前向按 cos() 分摊。<90 结构性只向前;>90 刻意命令倒向航向(能倒车的载具可用)——把 DV 预旋出速度障碍锥可保持 ORCA 约束失活、满速通行。Hard cap (deg) on the total flank rotation (editor 0–360). |DV| unchanged; forward speed takes the cos() share of the budget. Below 90 the deflection is structurally forward-only; above 90 deliberately commands a reverse-intent heading (vehicles that CAN reverse may use it) — pre-rotating DV out of the velocity-obstacle cone keeps ORCA constraints inactive so full speed passes through.
BlockerSpeedRatiofloat0.5f低速阻挡规则(限域):仅当自身为任务驱动移动(bMovingToGoal 且非回归)、邻居主动移动中(TrafficRank 2)、且同向(对方期望方向位于自身前向半圆,点积>0——只做超越;反向对归 LaneShift)时生效。idle(0)/回归(1/3)/反向邻居绝不被此规则绕行。当前对当前速度比值使共同加速对不触发。0=关闭。1.0=任何更慢的同向主动移动者(编辑器 0-1)。Slow-blocker rule (scoped): fires ONLY when self is TASK-driven moving (bMovingToGoal and NOT returning), the neighbor is ACTIVELY moving (TrafficRank 2), AND the pair is SAME-direction (dot>0 — overtaking only; opposing pairs belong to LaneShift). Idle(0)/returning(1/3)/opposing neighbors are NEVER flanked by this rule. Current-vs-current speed ratio keeps mutually-accelerating pairs out. 0 = off. 1.0 = any slower same-direction active mover (editor 0–1).
SpeedMultfloat1.f绕行期间的提速乘数(本帧施加了旋转时生效):期望速度与所有下游速度上限(ORCA LP 半径 / ForceField 移动钳制 / 贴场景钳制)同时乘以此值——移动速度 2000、钳制 0-2000、乘数 1.5 时绕行 agent 最高可达 3000。1.0=关闭(编辑器 0.1-10)。Speed multiplier while actively flanking (a rotation was applied this frame): both the desired velocity and every downstream speed cap (ORCA LP radius / ForceField locomotion clamp / scene-contact clamp) scale by this — MoveSpeed 2000 with clamp 0-2000 and mult 1.5 lets a flanking agent reach 3000. 1.0 = off (editor 0.1–10).

FLaneShiftRule USTRUCT

车道偏移机动原语(取代 HeadOnLaneBias):移动自身向来车反方向、行进侧约定侧旋转 DV。对头锥为结构阈值(≈135°,不可调);幅度按责任加权——对称对保持历史每邻居角度,不对称对倾斜。

Lane-shift maneuver primitive (replaces HeadOnLaneBias): moving self rotates its DV away from oncoming moving neighbors, toward the TrafficSide convention. The head-on cone is a structural threshold (≈135°, no tuning knob); magnitude is yield-weighted — symmetric pairs keep the historical per-neighbor rotation, asymmetric pairs tilt.

成员变量 Members

名称 Name类型 Type默认值说明 Description
bEnablebooltrue一切在途自身(移动或归位)将来车反方向旋转 DV(对向朝向,结构锥 ≈135°),向行进侧约定偏移以促成车道。横穿车流的归位者保持归位推进的同时并入车道。Any IN-TRANSIT self (moving or returning) rotates its DV away from oncoming transit neighbors (anti-parallel headings, structural cone ≈ 135°) toward the Arbitration.TrafficSide convention, encouraging lane formation. Returners crossing traffic keep homeward progress while joining the lane.
PerNeighborDegfloat15.0f每个对头邻居的基础旋转角度(度)。经全局质量加权与责任加权——对称对保持此值。总角度以 MaxDeg 封顶。Base rotation magnitude per head-on neighbor, in degrees (mass-weighted via Arbitration.MassWeighting, yield-weighted so symmetric pairs keep this exact value). Total clamped to MaxDeg.
MaxDegfloat45.0f所有对头邻居累加旋转的硬上限(度)。Hard cap on |total rotation| across all head-on neighbors, in degrees.
bEnableCrossingbooltrue将 LaneShift 的触发锥从对头(≈135°)扩展到交叉带(航向差 45°–135°)——垂直穿插流。判侧为纯 TrafficSide 约定(人人让向己方行进侧):几何互补——一股过前、一股过后,双双不停步;密集交叉流中涌现对角条纹穿插(行人研究的「条纹」现象)。交叉幅度复用每邻居角度 / 总封顶与责任×2、质量加权;不进对头的 steer-away 证据判侧(该判侧在对称交叉下产出对撞组合)。默认开;关闭恢复仅对头的旧行为。Extend LaneShift's trigger cone from head-on (≈135°) into the CROSSING band (45°–135° heading difference) — perpendicular streams. Side pick is the PURE TrafficSide convention (everyone deflects to their OWN traffic side): geometrically complementary — one stream passes in front, the other behind, both keep moving; interleaved diagonal stripes emerge in dense crossing flows (the pedestrian 'stripe' phenomenon). Crossing magnitude shares Per-Neighbor Rotation / Max Rotation Cap and the yield×2 + mass weighting; it does NOT feed the head-on steer-away evidence pick (that side rule produces the colliding mix on symmetric crossings). Default ON; turn OFF to restore legacy head-on-only behavior.

FSideStepRule USTRUCT

侧让机动原语(取代 OncomingSideStep):仅静止自身沿每个来袭邻居速度的垂直方向添加横向 DV 分量以侧让,而非被推着走。归位者与移动者同属在途,走 LaneShift 而非侧让(在途有真实期望速度,车道旋转比逐邻居侧让更连贯)。来袭锥为结构阈值。幅度按净空缺口驱动(感知体型):只让出几何所需——对方扫掠走廊半宽(避障副轴,采集时已含旋转扫掠膨胀)+ 自身沿侧让方向厚度 + ClearanceMargin,减去自身到对方路径线的当前垂距;缺口按 ClearanceTime 折算成速度(统一 BiasSpeedFrac × 最大速度 封顶,再按质量 / 强度 / 责任加权),总量以 Arbitration.BiasCapFactor 封顶。走廊让净即停——步兵路过人群几乎不动,坦克路过让出整条通道。

Side-step maneuver primitive (replaces OncomingSideStep): IDLE self only adds a lateral DV component perpendicular to each approaching neighbor's velocity so it steps aside instead of being pushed along the lane. Returners and movers are in-transit and use LaneShift instead (in-transit agents have a real desired velocity; a lane rotation is more coherent than per-neighbor sidesteps). The approach cone is a structural threshold. Magnitude is clearance-deficit driven (size-aware): the step only covers what geometry demands — the passer's swept corridor half-width (avoidance minor axis, rotation-sweep-inflated at gather) plus self's extent along the step direction plus ClearanceMargin, minus the current lateral gap to the passer's path line; the deficit converts to speed over ClearanceTime (capped by BiasSpeedFrac × MaxSpeed, then mass/strength/yield-weighted), total capped by Arbitration.BiasCapFactor. Corridor clear → step stops — infantry passers barely nudge the crowd, tank passers get a full lane yielded.

成员变量 Members

名称 Name类型 Type默认值说明 Description
bEnablebooltrue静止自身对来袭邻居侧让而非被推着走。归位/移动属在途,改用 LaneShift。冷却+追击锁定者抑制(站定瞄准)。IDLE self steps aside (lateral DV component) for approaching neighbors instead of being pushed along the lane. Returners/movers are in-transit and use LaneShift instead. Suppressed for cooling+chase-locked agents (plant feet to aim).
Strengthfloat1.0f侧让强度系数,0-1。1.0 = 全强度(默认),0 = 静止/归位方完全不让路。Sidestep strength scale, 0–1. 1.0 = full strength (default), 0 = never steps aside.
ClearanceMarginfloat25.f让出走廊时在接触净空之外保留的余量(厘米)。所需横向距离 = 对方扫掠半宽 + 自身沿侧让方向厚度 + 此余量。Extra clearance (cm) kept beyond contact when yielding the corridor. Required lateral distance = passer's swept half-width + self's extent along the step direction + this margin.
ClearanceTimefloat0.5f侧让速度 = 净空缺口 / 此时间(秒),以 BiasSpeedFrac × 最大速度 封顶。越大让得越从容,越小反应越快。Sidestep speed = clearance deficit / this time (seconds), capped by BiasSpeedFrac × MaxSpeed. Larger = lazier, smoother steps; smaller = snappier.

FWallSlideRule USTRUCT

贴墙滑行规则(ORCA 求解器前置的预解算偏置):自身 DV 有朝向障碍物分量(DV·N < 0)时,将速度向墙壁切线方向投影。强度按环形区缩放:身体接触(Dist ≤ SelfRadius)→ Strength=1(完全贴墙滑行);避障椭圆边缘(Dist ≥ Outer)→ Strength=0(不变);中间 C0 连续。不重归一化——移除向内分量自然减速。

Wall-slide rule (pre-solve bias ahead of the ORCA solver): when self's DV has a component INTO an obstacle (DV·N < 0), the velocity is projected toward the wall tangent. Strength scales over the annular zone: at body contact (Dist ≤ SelfRadius) → Strength=1 (full slide, pure tangent); at the avoidance ellipse rim (Dist ≥ Outer) → Strength=0 (no change); C0-continuous between. No renormalization — removing the inward component decelerates naturally.

成员变量 Members

名称 Name类型 Type默认值说明 Description
bEnablebooltrue朝向障碍物移动时,期望速度逐渐向切线方向偏转。Self heading INTO an obstacle has its DesiredVelocity gradually steered toward the wall tangent.
Rangefloat0.f该规则的距离上限(厘米)。0 = 无限(以避障椭圆边缘为界)。Range 限制(不扩展)活动区域。Per-rule range cap (cm) on wall-to-self distance. 0 = unlimited (use the avoidance ellipse rim as the only outer bound). Range caps (never extends) the active zone.

FPressureRule USTRUCT

压力场人群解耦(求解器后置偏置):启用后压力梯度将求解器输出引向稀疏区域,使 Agent 主动绕开密集人群而非仅在 PBD 接触后反应。消费与物理漂移路径(Collider.bPushedByPressureField)相同的 FFix64 压力网格;本规则是避障层的按原型开关(压力场本身由沉积方 Collider.bDepositToPressureField 供源)。

Pressure-field crowd decoupling via avoidance (a post-solve bias): when enabled, the pressure gradient steers the solver output toward sparser areas so agents proactively route around dense crowds instead of only reacting after PBD contact. Consumes the same FFix64 pressure grid as the physics drift path (Collider.bPushedByPressureField); this rule is the per-archetype opt-in for the AVOIDANCE layer (the pressure field itself is fed by Collider.bDepositToPressureField on the depositing agents).

成员变量 Members

名称 Name类型 Type默认值说明 Description
bEnableboolfalse启用压力场人群解耦(避障路径)。Enable pressure-field crowd decoupling via avoidance.
BiasStrengthfloat50000.0f转向灵敏度(cm/秒/梯度单位),越高对越弱梯度也有反应。Steering sensitivity (cm/s per gradient unit). Higher = responds to weaker gradients.
BiasMaxFractionfloat0.3f压力驱动速度上限,占 MoveSpeed 的比例。Cap on pressure-driven velocity as a fraction of MoveSpeed.
Rangefloat0.f已摘除编辑器/BP 暴露(无任何配置启用过):固定默认 0 = 不受限(激活阈值 = 双方避障半径之和);两条求解路径仍读取该字段。Editor/BP exposure retired (no authored config ever used it): fixed default 0 = unlimited (activation threshold = sum of both agents' avoid radii); both solver paths still read the field.

FTrafficShared USTRUCT

交通规则的共享 fragment(FA_MassBattleBaseSharedFragment 派生)——每个原型一份,所有 Agent 共享读取;以可变共享片段分发,允许 GetMutableSharedFragment 运行时调整。8 条规则聚合于此,各自独立开关且默认全开;总闸 FAvoidance::bUseTrafficRules(默认关)是启用整个交通层的唯一开关。DeterministicHash 是确定性 CRC32 种子,模板构建时从 asset path(GetPathName)赋值,保证双端避障行为一致。

Shared fragment for the traffic rules (derived from FA_MassBattleBaseSharedFragment) — one instance per archetype, read by all agents; distributed mutable so runtime tweaks via GetMutableSharedFragment are possible. All 8 rules aggregate here with independent toggles, all defaulting ON; the master gate FAvoidance::bUseTrafficRules (default OFF) is the single switch that arms the whole layer. DeterministicHash is a deterministic CRC32 seed, set from the asset path (GetPathName) at template build so avoidance behavior is identical across lockstep peers.

成员变量 Members

名称 Name类型 Type默认值说明 Description
LivingVsDyingFLivingVsDyingRule—采集阶段过滤规则(见上)。Gather-phase filter rule (see above).
ArbitrationFTrafficArbitration—L2 责任仲裁矩阵 + 机动层共享参数(行进侧约定 / 判侧死区 / 统一幅度语义,见上)。L2 yield matrix + shared maneuver-layer knobs (traffic side / commit band / unified magnitude semantics, see above).
CombatFCombatRule—战斗与交通的交互:攻击者路权 + 战斗跳过避障(见上)。Combat interplay with traffic: attacker right of way + combat skip-avoidance (see above).
FlankFFlankRule—走廊绕行机动原语(不可移动体 + 更重单位,缝宽门,见上)。Corridor flank maneuver primitive (immovable bodies + heavier agents, gap-width gate, see above).
LaneShiftFLaneShiftRule—车道偏移机动原语(可扩展交叉带,见上)。Lane-shift maneuver primitive (extensible into the crossing band, see above).
SideStepFSideStepRule—静止侧让机动原语(净空缺口驱动,见上)。Idle side-step maneuver primitive (clearance-deficit driven, see above).
WallSlideFWallSlideRule—贴墙滑行规则(见上)。Wall-slide rule (see above).
PressureFPressureRule—压力场人群解耦(避障路径,见上)。Pressure-field crowd decoupling via avoidance (see above).
DeterministicHashint320确定性 CRC32 种子。模板构建时从 asset path(GetPathName)赋值。Deterministic CRC32 seed, set from the asset path (GetPathName) at template build.

管线角色 Pipeline Role

FTrafficShared 在 MassBattle 管线中的位置:由 MassBattleAgentMoveProcessor / MassBattleAgentMoveProcessorFP 的避障求解段读取(预解算机动原语、ComputeAvoidanceRatio 责任仲裁、求解器范围规则),MassBattleGridUpdateProcessor 在网格注册时读取(攻击者旗标、交通等级)。规则受 FAvoidance::bUseTrafficRules 总闸控制(默认关)。

Position of FTrafficShared in the MassBattle pipeline: read by the avoidance-solver sections of MassBattleAgentMoveProcessor / MassBattleAgentMoveProcessorFP (pre-solve maneuver primitives, ComputeAvoidanceRatio yield arbitration, solver-scope rules); MassBattleGridUpdateProcessor reads it at grid registration (attacker flags, traffic ranks). All rules are gated by FAvoidance::bUseTrafficRules (default OFF).