Finally figured it out. The bug was hilarious but too technical to explain. Fix incoming.
You know you want to tell us
Yeah…
Finally figured it out. The bug was hilarious but too technical to explain. Fix incoming.
Try us. Im sure it will make for an entertaining Dev blog.
OK fine.
So I started by looking at the anomaly’s creature script. The fact that this was a consistent teleport at 50% made it seem like it would be an easy thing to track down, and the creature script was the likely culprit.
The anomaly had a script handler listening for it to hit 50% health. In this handler was a call to teleport it to the center of the map, presumably the designer who originally built the anomaly put it there as a safeguard, but it should not be needed. I figured, “maybe the teleport is failing and picking the wrong navmesh?” so I just deleted the whole handler.
The boss still teleported at 50%…
OK so it isn’t the creature script, so I looked at everything referencing the anomaly with regards to its 50% health threshold, and the only thing left was a map script. This map script did nothing but set a trigger, but there was a handler listening for this trigger that fired a skill at the feet of the anomaly “Unstable Matrix”, which is the skill that targets everyone and makes platforms fall.
This skill is not sourced from the boss, since the boss is doing his own thing at this time. Instead, the skill is sourced from an invisible, unattackable gadget that spawns right at the feet of the anomaly. These types of gadgets are called “skill launchers” and are used in places throughout the game, though we try to avoid them these days as they have a tendency to be buggy. For instance, until last year, some player skills such as the revenant sword 2 would randomly target these skill launchers, and players would see their projectiles flying at invisible objects.
All gadgets in our game have flags that define their behavior. Skill launchers were properly flagged to be unattackable and non targetable, but I discovered that they, hilariously enough, were not flagged as “No Collide”.
The skill launcher at the anomaly’s feet was colliding with him when it spawned. And when colliding gadgets collide with a creature when they initialize, they “Eject” said creatures, causing them to teleport to nearby navmesh. The reason the boss would teleport back to the center at 25% was because of those teleport safeguards on the creature script. But of course the next time Unstable Matrix fired it would teleport back out.
Flagging skill launchers as no collide solved this bug (and probably some elsewhere), and then Bill fixed some issues that could cause creatures to teleport too far away when ejecting, as the anomaly had.