Thread:Icefirephoenix/@comment-34929636-20180718193932

I mentiond that that the plasma bug had to do with fast moving objects in simulations. Here is why:

The black square represents the projectile, and each positions of the square represents one game tick. The projectile's position is defined in pixels (or meters) per tick.

Note the gaps in the first sequence. the projectile's hitbox never existed in these gaps, and as such, it can "phase through" the light blue wall without ever triggering the collision code.

Obviously, this is undesirable behavior. In order to fix this, we must use interpolation. This means that besides checking the position at each tick, we must also check a line connecting the current position to the last position for collisions. This almost completely fixes case one, with exception being the graphics. The graphics can still show that the particle assed through the target due to them being updated before the collision check is complete, but the collision is still detected.

Case two occurs when there are two objects within the check region. In this case, a blue robot and a purple wall are in the path of the projectile. However, due to the update system above, (which is about the only good way to do it) both the wall and the robot are in range in a single check. This causes a problem, because we need to figure out which object should execute the collision code. In the case of the Plasma bug, this collision is executed on the wall, rather than the robot.

It should be noted that slower objects, such as Orkan rockets, have a high enough point density along their path that the phasing bug is not possible. A line object, such as gekko's beam, use a fundamentally different algorithm to detect collision (and it has virtually zero latency, but is incompatible with weapons such as taran). As for shocktrain, Zeus, ion, and scourge, due to the lock-on feature, the system already knows where they are going to hit, allowing the use of the low latency line-algorithm, instead of the higher latency iterative algorithm used by Taran.

As for aphid, vortex, thermite, spiral, hydra, and chimera, the way they use the lock-on feature requires that they use the iterative algorithm. This is not a problem for the longer range missile, due to their slow speed, but for the burst missiles, the same problem that affects Taran is what allows them to sometimes phase through walls and shields. (they probably do not use interpolation) 