Page 1 of 1

[4.8.2] Insane lagging, sprite count and think times through the roof

Posted: Mon Sep 05, 2022 7:45 am
by MFG38
While playing Eviternity with the gameplay mod Angelic Aviary on stream the other day, I ran into this problem in MAP04 where the framerate started tanking horrendously after only a couple minutes. Checking the renderstats seemed to reveal part of the problem, as the engine was rendering up to 40k+ sprites at once. I ran some benchmarks off-stream later that evening and just now, and I took some screenshots of my results from three different setups. See below.

Eviternity + Angelic Aviary on GZDoom 4.7.1
evi_modded_471.png
Eviternity (no gameplay mod) on GZDoom 4.8.2
evi_nomod_482.png
Eviternity + Angelic Aviary on GZDoom 4.8.2
evi_modded_482.png
(That sprite count isn't even at its highest here.)

Some obvious inconsistencies in the results stem from the fact that I roamed around the map while stuff was happening and tried my best to take screenshots of the worst spikes, but you should get the general idea. GZDoom 4.7.1 doesn't spike nearly as hard as GZDoom 4.8.2 with the exact same files (of which there are only 2, granted) in the exact same load order, which leads me to believe that this is an issue introduced in 4.8.2.

In case it's of any relevance, I copied my config file from my GZDoom 4.7.1 installation over to GZDoom 4.8.2 and used that as my config file for 4.8.2 as well.

Re: [4.8.2] Insane lagging, sprite count and think times through the roof

Posted: Mon Sep 05, 2022 8:05 am
by Marisa the Magician
What would be nicer to have here is a printout from profilethinkers, because it looks to me that something was spawning more often than it was meant to.

Re: [4.8.2] Insane lagging, sprite count and think times through the roof

Posted: Mon Sep 05, 2022 8:27 am
by MFG38
I wasn't able to get a screenshot of the readout when I did profilethinkers at the top of a lag spike, but the engine did seem to do about 16k calls to the TorchTree1 actor of all things. Benchmarked it against 4.7.1 with the same files and load order and it only made 30-something calls to the same actor.

Re: [4.8.2] Insane lagging, sprite count and think times through the roof

Posted: Mon Sep 05, 2022 10:25 am
by Marisa the Magician
It took me a while to figure this out, but it appears that the forgotten maiden enemies have improperly terminated states (no "Stop" at the end of the "NoextraForgottenMaiden" state sequence) where they'll infinitely spawn more and more copies of torchtree1 if the enemy is disabled in the menu (one of those "NSFW" ones).

This might be worth reporting to the mod author.

Technical details: The reason this infinite loop happens is because the end of that state sequence will jump directly to the spawn state of the next class, which in most cases is a variant of the same enemy, with the same conditional jump to the same state label... And so on and so forth.

Re: [4.8.2] Insane lagging, sprite count and think times through the roof

Posted: Mon Sep 05, 2022 1:43 pm
by Graf Zahl
MFG38 wrote: Mon Sep 05, 2022 8:27 am I wasn't able to get a screenshot of the readout when I did profilethinkers at the top of a lag spike, but the engine did seem to do about 16k calls to the TorchTree1 actor of all things. Benchmarked it against 4.7.1 with the same files and load order and it only made 30-something calls to the same actor.
The text gets printed to the console where it can be accessed more easily.

Re: [4.8.2] Insane lagging, sprite count and think times through the roof

Posted: Sun Sep 11, 2022 8:11 pm
by CherubCorps
Yeah, it was TorchTree1 (The actor that replaces the Forgotten maiden statues). Fixed it by adding "STOP" to the end of the file.