Projectile Overlap at high speeds

Hi!
I’m trying to build a complex character damage system and relatively realistic bullet/projectile ballistics for a game. I’ve made a body-part-and-organs system for characters and a generic projectile that’s given an initial velocity, mass, drag coefficient, and a sphere diameter (used as the collision collider). As the projectile passes through a character’s body, its kinetic energy changes based on tissue density and the bullet’s frontal area. In other words, the bullet can “get stuck” in the target.

There’s one small problem: I implemented all of this using Overlap and tested it at 100x time dilation. At real-time speed, once the projectile is moving faster than ~250 m/s, Overlap starts registering the exit from the target with a delay, which is unacceptable. Instead of getting stuck (when the kinetic energy has dropped below the threshold needed to penetrate), the bullet travels a few more meters during that tick, hits the next target, and only then gets destroyed. Plus, at high speeds, because the point where the overlap ends is offset, it can’t correctly calculate the kinetic-energy loss.

So the question is: is there any way to make EndOverlap fire not at the end of the tick and to get Overlap to work properly at near-realistic bullet speeds (up to 1000 m/s)? I tried enabling CCD— with it, the minimum speed at which the energy calculation doesn’t glitch drops even further, i.e., it actually makes things worse. Max simulation timestep/iterations didn’t affect anything. Collision Query Only. Thanks!

P.S. That’s how bullets behave at 100x slow-mo https://www.youtube.com/watch?v=OY0TPKitM7k

You can try doing a line test in front of the projectile (increase distance with the faster it’s going) and once it registers a hit position, once a hit is no longer detected it can snap the projectile back into the last registered hit point.

As an alternative, I was thinking of ditching Overlap and, on OnBounce, recording the impact location; doing a sphere trace with the start point shifted about ~1-5 meters along the velocity vector and with the end at the impact location; checking the intersection against the same object that was originally hit; and then either spawning a new projectile at that point with updated characteristics or destroying it if no penetration occurred. But that’s such a hack… I’m really hoping I can get away with just Overlap.

Since you mentioned drag coefficient, I expect you’ve done some modeling with ballistics calculators. A calculator I’m familiar with performs the physics/trajectory calculation at something like 10,000hz; unreal is calculating significantly less than that, with a unit of FPS rather than Hz.

If the editor is running at 60fps, and you set global time dilation to 0.01, the editor is still running at 60fps; your projectile location is being calculated 60 times a second regardless of it’s time-dilated velocity. Therefore, at 0.01 time dilation, your projectile is getting more calculations per unit of it’s travel than it would at 1.0.

My experience in the past with high-speed projectiles using OnOverlap was that they would occasionally totally miss the target. For example, if your projectile is moving at 600m/s, and the game is running at 60fps, the projectile is calculated as having moved 10m every tick. This is more than enough to overshoot the target.

I am unaware if the projectile movement component “sweeps” collision from the last calculation position by default, or if you would have to manually set and check it’s position last frame, and trace from the actor’s position last frame to the actor’s current location to determine if there was a “hit" between ticks. In the case of multiple targets hit, a MultiSphereTrace should return an array with the actor hit closest to the trace start position first, and closest to the end position last, but you’d have to test it to be sure. This way, you might be able to calculate velocity loss per hit actor.