[Editor] Consolidated Deflect System Issues

After some pretty thorough testing, I have pinpointed a number of issues in the new Deflect system (added in 5.0) that severely limit its potential. I’m not sure if all of these issues can or will be resolved, so I will also post partial workarounds to some of them below.

  1. If an attack that consists only of a damage effect (such as the Marine or Zergling weapons) is deflected, the attack actor throws an error (ActionImpactPhysics message arrived before [attack actor] commenced) and launch assets are not created on the unit that is attacking.
  2. When any attack with an Action actor is deflected, launch assets are created on the deflecting unit as well, and the launch attachment is also unchanged. This looks very strange in some cases: for example, if an Archon deflects a Siege Tank attack, the Archon will have a noticeable smoke puff coming out of its right hand.
  3. If a Create Persistent effect, Set effect, or Buff behavior (or probably just about anything) creates multiple Damage or Launch Missile effects on a target, only the first of those damage/LM effects can be deflected. For example, if a Thor uses its Javelin anti-air to attack a unit that has a 100% deflect chance behavior, only the first of the Thor’s four missiles is deflected; the others go through to damage the target. This also applies to beam weapons, which are typically implemented with a channeled Create Persistent effect, so only the first instance of damage from the beam is deflected. And it applies to things like Psi Storm - only the first tick of damage from the same Psi Storm on the same unit can be deflected.
  4. Only the Damage and Launch Missile effect types have the Validate Impact Deflection flag, so only these types of effects can be deflected. But sometimes, an attack might have secondary effects such as a slow (typically contained within an impact Set effect) that you would also want to be deflected. As-is, this is only possible for projectile attacks, because you can put the impact Set into the Impact Effect field of the Launch Missile effect, but it is not possible for instant-type attacks.

These issues make the Deflect system very difficult to use given that many of the default weapons and spells in the game will trip over one or more of these problems. Partial workarounds for the respective issues:

  1. This can be avoided by creating a fake projectile attack using an invisible missile and a very fast mover speed. Set up the weapon’s attack actor to work off of the fake projectile and damage effects instead of the real damage effect. Then, just have your weapon execute both the instant damage effect and the fake projectile effects. The result looks and acts exactly like the original, except that it trips over issue (3) and so either the fake LM or the real damage effect cannot be deflected.
  2. Create a second attack actor for your weapon that inherits from the original attack actor. Then add a validator to the “Create” events on the original actor so that it is only created if the caster is the correct unit type, and add a negated version of the same validator to the second actor so that it is only created if the caster is a different unit type. You can also delete the launch assets on the second actor and set its launch attachment to Center, which looks much better. However, this is a clunky solution, and it doesn’t work if the deflecting unit is the same type as the attacking unit, or if the same weapon/spell is used by multiple different unit types.
  3. No clear workaround. You might be able to get it to work by implementing attacks and spells via triggers, but that would be pretty hacky.
  4. Wrap everything inside dummy Launch Missile effects, since those can spawn any effect type. This is also pretty hacky, and doesn’t preserve the “instant” property of things even if the fake projectile moves really fast. For example, say you wanted the Marine to also benefit from the Concussive Shells upgrade. If you want the slow behavior to be deflectable, you have to put it inside a dummy LM. Because of issue (3), you also have to put the damage effect inside the dummy LM. But then it is no longer quite instant; Marines will no longer avoid overkill in the same way they usually do.

My conclusion is that the deflect system, despite being very cool and exciting, is not really usable as-is except in very specific or controlled cases.

For the create persist issue. You can actually check the ‘Orphan Params’ flag on the CP effect, to make each child effect a standalone effect tree.

Well I’ll be. I never knew what that flag did, but you are correct. I can’t find anything similar for behaviors or Set effects, but theoretically this still allows one to work around the issue in a reasonable way, which is good enough for me. Thanks.