Performance bug: spells (and arrows?) leak and cause slowdown.


#1

Some items from my playing today, which I’m posting here as a separate bug so they don’t get buried and lost, since this feels like a high-priority bug.

[ul] [li][b]Bug[/b]: (Performance) There was somewhere that FPS dropped to SPF, when facing in certain directions, I suspect because culling wasn't happening as intensely as wanted. I need to take better notes on this.[/li] [/ul]

[ul]
[li]: (Performance) Facing certain directions in the Arcanaeum, FPS drops to 2.[/li]
[/ul]

[ul]
[li]Bug: (Performance-Item Leak) Facing certain directions in the Athena’s Might, FPS again drops to 2, sometimes 1. Let’s go into debugging mode![/li]

[li]This is regardless of video quality and resolution, so probably not a video bottleneck? [/li]
[li]Task Manager’s Performance tab does not show anything spiking up when looking in that direction compared to others.[/li]
[li]My system’s reasonably beefy (NVidia Geforce GTX 1080 at 7-10%; Disks 0 and 1 at 0%; Ethernet not being used much; CPU i7-8700K@3.7GHz 30%; memory 47%, 14.8/32G – and most of that usage is most likely other apps).[/li]
[li]It seems to get slower with time, now about a 5 seconds per frame if I look in that direction, risen from about 0.5.
so it’s most likely something spawning a HUGE number of particles and not cleaning them up.[/li]
[li]There’s something making a sound there like it’s shooting some spell: I’m guessing the spells aren’t clearing once cast.[/li]
[li]I’ll try backing towards it to see what’s making the noise. Looks like it’s some dead lizardman corpses casting spells at each other.[/li]
[li]I wandered off to get coffee, came back and tried it, and it is over 30 seconds per frame now, CPU spikes up to 100% for a few seconds, then drops down to 10% again for a while. Memory usage has gone up to 18.8G but dipped by about half a gig during the CPU spike.[/li]
[li]It’s not even drawing the FPS count anymore. If I press keys it says (Not Responding) in the window title until the frame redraws after a minute or so.[/li]
[li]Reloading and switching back from (Windowed, Very Low quality, 1024x768, 60Hz, 90FoV) to my usual settings (Windowed, Ultra quality, 2160x1200, 60Hz, 120FoV), I’m still getting 40FPS or so after the reload, where I was getting fractional fps.[/li]
[li]After just running right in and try to kill the magic users asap, I died about 6 times, but killed quite a few magic users, ninjas and fighters. I also picked up about 85 arrows, so that could be the leak? 85 arrows in the few minutes it took me to kill them all… that would be a LOOOOT of arrows fairly soon. I’m still getting an easy 40+fps, so there’s been no noticeable slowdown in the area once I killed everything.[/li]
[li]On returning to Athena’s Might after about five-ten minutes, the corpses have again started casting magic at each other.[/li]
[li]I should have thrown them into the lava to destroy them completely. Destroying the corpses now doesn’t prevent the casting, since the casting seems to be coming from two glowing orbs where the magic users fell.[/li]
[li]OK this gives me a chance to prove the hypothesis of the leak. I’ll stand off at the other side of the abyss, and watch the corpses casting, and see if my FPS falls. It’s already down to a steady 17-18fps… 15-16fps… 13-14fps… 11-12fps. Yeah, this seems a fairly linear slowdown, within a couple of minutes.[/li]
[li]I think the hypothesis is proven: spells aren’t being cleaned up.[/li]
[li]They seem to be casting two spells: the black fireball that explodes in a cloud of black electric; and the red star/rose made of a square and a diamond. They seem to be casting about one spell a second.[/li]
[li]On returning to the Forge of the Gods, there is an identical problem: I see spells being cast from glowing blobs marking dead NPCs, and hear arrows being fired. It claims 1 fps when looking at the forge.[/li]
[li]I found a pile of over 200 individual arrows. All in a heap, rattling and physics-ing against themselves. I tried to pick them all up, but removing the ones I could see didn’t help with the slowdown, looking at the pile of arrows did NOT significantly slow me down.[/li]
[li]The slowest point seems to be when looking at what looked like four glowing orbs (so, four dead casters) casting the spells. So this is further evidence that it’s the spells not cleaning up.[/li]
[li]That said, maybe in the new save-file code, only save up to N arrows per level, not many hundreds, just in case?[/li]
[/ul]

TL;DR: Some pretty conclusive evidence that spells are causing some kind of resource leakage, killing frame rate.


#2

I have been unable to reproduce this behavior with Patch 1.
Which is great - to me, this performance drop was the one big gamekiller, and I have not seen it in ~50hrs with this patch.
Doesn’t mean it’s fixed, but it used to be reliably reproducible, and now I can’t reproduce it.