
Descrição
Your AI stops shooting its own people - and steps aside instead of standing there.
THE PROBLEM
Every AI shooter with allies has to answer one question before it pulls the trigger: is one of my own people standing in that shot? Almost every one of them answers it with a single line trace from the muzzle to the target, and that answer is wrong three ways at once. A bullet has width, a rocket has a blast radius, and a line is the one shape that describes neither. A team-mate walks, so a check against where he is now gives permission to fire at a man who is one stride from the lane - and he takes that stride while the bullet is in the air. And a dot product against an infinite ray says the man standing half a metre behind the shooter is on the firing line, which is why a hand-rolled gate holds fire whenever a squad bunches up behind its own gunner.
WHAT IT IS
The check done properly. The lane is a swept volume of the projectile’s real danger radius. Every friendly is projected forward along its own velocity before the lane is judged. And the verdict has a middle: a hard block and a graze are different answers, so your squad is neither reckless nor mute.
BLOCKED IS NOT STOP
Every hand-rolled version says no and stops there, which is why AI squads stand around looking stupid. FireLane returns the sideways step that would open the lane - longer when the blocker stands further down it, because moving the shooter pivots the lane about the target - and how many seconds until the blocker walks out on his own, where a negative number means never. "Wait a beat" and "go around" are different orders, and your behaviour tree finally has the information to tell them apart.
AND IT STAYS CHEAP
The friendly test is arithmetic and is never rationed. The geometry trace runs on a per-frame budget for the whole world, so sixty shooters cost what you decide they cost - and a verdict that had to answer without a trace says so instead of pretending.
WHAT IT DOES NOT DO
It does not choose who to shoot at, it does not move anybody, and it does not stop friendly-fire damage from landing. It stops the AI from choosing to fire, which is a different and earlier decision. The suggested step is a vector; what walks it is your behaviour tree, your StateTree or your movement component - deliberately, because every project already has an opinion about that.
Unreal Engine 5.8, one runtime C++ module, Win64, no AIModule, NavigationSystem or GAS dependency. Blueprint-first throughout. Five automation tests over the rules that fail quietly. A demo level that runs without pressing play. Full source included.




