A_RemoveLight causes severe lag on high detail maps
Moderator: GZDoom Developers
Forum rules
Please construct and post a simple demo whenever possible for all bug reports. Please provide links to everything.
If you can include a wad demonstrating the problem, please do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.
Please make a new topic for every bug. Don't combine multiple bugs into a single topic. Thanks!
Please construct and post a simple demo whenever possible for all bug reports. Please provide links to everything.
If you can include a wad demonstrating the problem, please do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.
Please make a new topic for every bug. Don't combine multiple bugs into a single topic. Thanks!
-
- Posts: 3886
- Joined: Fri Feb 08, 2008 9:15 am
- Preferred Pronouns: She/Her
- Operating System Version (Optional): (btw I use) Arch
- Graphics Processor: nVidia with Vulkan support
- Location: Vigo, Galicia
A_RemoveLight causes severe lag on high detail maps
Discovered this accidentally while playing my mod recently. I have a certain projectile that manually attaches a light to itself, then removes it on death (mainly because it uses the same sprite and frame on both spawn and death, so I can't simply use gldefs to assign it).
The following file is a stripped down version of that projectile. Typing "summon loveheart" in any map with lots of complex geometry (this even includes Frozen Time, so there's that for a test), and waiting for the projectile to hit something, you'll notice gzdoom will freeze for a while, every time. It appears that the slowdown happens somewhere in FDynamicLight::CollectWithinRadius (a_dynlight.cpp line 356).
The following file is a stripped down version of that projectile. Typing "summon loveheart" in any map with lots of complex geometry (this even includes Frozen Time, so there's that for a test), and waiting for the projectile to hit something, you'll notice gzdoom will freeze for a while, every time. It appears that the slowdown happens somewhere in FDynamicLight::CollectWithinRadius (a_dynlight.cpp line 356).
-
- Posts: 8197
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: A_RemoveLight causes severe lag on high detail maps
Curious. Does it lag more if you just deactivate the light in particular?
-
- Posts: 3886
- Joined: Fri Feb 08, 2008 9:15 am
- Preferred Pronouns: She/Her
- Operating System Version (Optional): (btw I use) Arch
- Graphics Processor: nVidia with Vulkan support
- Location: Vigo, Galicia
Re: A_RemoveLight causes severe lag on high detail maps
The lag is ONLY caused by removing that specific light the projectile attaches to itself.
-
- Posts: 13851
- Joined: Tue Jan 13, 2004 1:31 pm
- Preferred Pronouns: She/Her
Re: A_RemoveLight causes severe lag on high detail maps
What happens if you deactivate, and then remove the light? (Just going on a haunch here)
-
- Posts: 3886
- Joined: Fri Feb 08, 2008 9:15 am
- Preferred Pronouns: She/Her
- Operating System Version (Optional): (btw I use) Arch
- Graphics Processor: nVidia with Vulkan support
- Location: Vigo, Galicia
Re: A_RemoveLight causes severe lag on high detail maps
It's not possible to deactivate the light if it's handled through AttachLight.
There's no function for that.
There's no function for that.
-
- Lead GZDoom+Raze Developer
- Posts: 49192
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: A_RemoveLight causes severe lag on high detail maps
I cannot reproduce any slowdown, not even in a debug build.
-
- Posts: 3886
- Joined: Fri Feb 08, 2008 9:15 am
- Preferred Pronouns: She/Her
- Operating System Version (Optional): (btw I use) Arch
- Graphics Processor: nVidia with Vulkan support
- Location: Vigo, Galicia
Re: A_RemoveLight causes severe lag on high detail maps
Guess it fixed itself, can't reproduce it either.
Edit: Nevermind, it happened again, seems to be entirely random. In most cases it only happens on specific launches.
Edit: Nevermind, it happened again, seems to be entirely random. In most cases it only happens on specific launches.
-
- Lead GZDoom+Raze Developer
- Posts: 49192
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: A_RemoveLight causes severe lag on high detail maps
Are you even sure it's really the light and not a random coincidence?
This looks more like a garbage collection related problem. From the looks of it that projectile is spawning quite a bit of effects actors.
This looks more like a garbage collection related problem. From the looks of it that projectile is spawning quite a bit of effects actors.
-
- Posts: 3886
- Joined: Fri Feb 08, 2008 9:15 am
- Preferred Pronouns: She/Her
- Operating System Version (Optional): (btw I use) Arch
- Graphics Processor: nVidia with Vulkan support
- Location: Vigo, Galicia
Re: A_RemoveLight causes severe lag on high detail maps
Considering that I don't see the issue ever happen if I get rid of the light attach/remove, I doubt it's the effect actors. I spawn boatloads of those in the mod proper and there are no issues with that.
-
- Lead GZDoom+Raze Developer
- Posts: 49192
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: A_RemoveLight causes severe lag on high detail maps
Does this still happen after today's change to the light management?
-
- Posts: 3886
- Joined: Fri Feb 08, 2008 9:15 am
- Preferred Pronouns: She/Her
- Operating System Version (Optional): (btw I use) Arch
- Graphics Processor: nVidia with Vulkan support
- Location: Vigo, Galicia
Re: A_RemoveLight causes severe lag on high detail maps
It's not happening anymore, it seems. But it appears that even in 4.6.1 it's already fixed. (nvm it actually still happens in 4.6.1)
No matter how many times I relaunch my mod and frozen time and fire the projectile that causes the issue, there are no freezes whatsoever with a fresh build. It's definitely fixed.
No matter how many times I relaunch my mod and frozen time and fire the projectile that causes the issue, there are no freezes whatsoever with a fresh build. It's definitely fixed.
-
- Lead GZDoom+Raze Developer
- Posts: 49192
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: A_RemoveLight causes severe lag on high detail maps
4.6.1 was before the fix. I only addressed a potential problem there yesterday.