Botania

Botania

133M Downloads

Extreme tps issues/hangs when firing a spreader into a whole lot of resistance lenses

quat1024 opened this issue ยท 2 comments

commented

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.

image

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)

commented

A simple solution is simply arbitrarily capping the amount of mana burst simulation ticks that can happen. Basically, just capping this loop

https://github.com/Vazkii/Botania/blob/968a3b4742df5c5397740c070a05777c6f97d8e5/src/main/java/vazkii/botania/common/entity/EntityManaBurst.java#L367-L368

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

commented

Fixed by merging that Pr which fixes that and a few more mana burst related performance issues