Extreme tps issues/hangs when firing a spreader into a whole lot of resistance lenses
quat1024 opened this issue ยท 2 comments
I could have SWORN there was an issue on this, went to go discuss it with someone, and turns out it never made its way to the issue tracker! Aaa
Aiming a mana spreader at a collection of Mana Prisms with Resistance Lenses causes the game to lagspike or even hang.
This is because the mana spreader attempts to precalculate the path of the mana burst (for "should I fire" purposes), but the huge amount of resistance lenses makes the mana burst travel slowly and almost never despawn.
Selecting a Wand of the Forest while a nearby spreader is in the above state causes unplayable client lag (around 1/8 FPS for me, with the pictured setup)
A simple solution is simply arbitrarily capping the amount of mana burst simulation ticks that can happen. Basically, just capping this loop
to a fixed number of ticks. Of course this technically changes behavior, since if you set the value to 20 seconds or whatever, and aim a spreader at something where the burst would take more than 20 seconds to reach its target, it wouldn't automatically fire anymore.
Capping it to 20 seconds is a reasonable tradeoff between adverse behavior changes and, well, playability