Open xezon opened 2 years ago
Reducing MaxSegments
to 4 looks like this.
ToxinTruckProjectileStream
is not cheap. 25 FPS is low this.
Looks ok. Nothing to do here.
Looks like something else is expensive however.
ToxinTruckProjectileStream
is removed.
Also happens with Tox Rebels, using similar kind of weapon.
I suspect the cause of this slowdown is identical to what is slowing #423.
Weapon ToxinTruckGun
ProjectileObject = ToxinTruckStreamProjectile
DelayBetweenShots = 40
...
End
The Toxin Tractor gun, and all other stream guns, spawn a Projectile object every 2 frames, 66 milliseconds. I suspect what makes it so expensive is the overwhelming amount of object spawn and despawn.
I tested this theory by increasing DelayBetweenShots to 120, aka spawn a Projectile object every 4 frames, 133 milliseconds, effectively twice as cheap.
Performance drops from 370 to 124 FPS
Performance drops from 370 to 180 FPS
The theory is proven correct. Reducing the number of spawned objects in the weapon makes it cheaper.
GLA Toxin Tractor projectile stream has 14 segments (
MaxSegments = 14
). Could potentially be reduced to save performance.Likely the same issue as
423