Page 1 of 1

Dynamic light radius issue

Posted: Fri Dec 23, 2016 3:12
by Talon1024
Something is causing GZDoom to crash, and it appears to be an assertion failure related to dynamic lights.

To reproduce the crash, load up a recent build of WolfenDoom: Blade of Agony, and watch the titlemap sequence until shortly after the "Realm667 Presents" screen.

Code: Select all

gzdoomd: /home/kevinc/Games/code/gzdoom/src/gl/dynlights/a_dynlight.cpp:421: void ADynamicLight::UpdateLocation(): Assertion `radius >= m_currentRadius * 2' failed.
My specs are:
Ubuntu 16.04 LTS (Unity desktop)
16 GB of RAM
Quad-core Intel Core i5-4690k CPU @ 3.50GHz
NVidia GeForce GTX 970
NVidia driver 367.57

I don't know if this bug affects only Linux or not.

BTW, the 'd' at the end of gzdoomd means it's a debug build of GZDoom.

Re: Dynamic light radius issue

Posted: Fri Dec 23, 2016 9:43
by _mental_
The same assertion failure was already reported here. But unlike with those steps to reproduce BoA intro indeed triggers the problem for me using Win32 Debug configuration. Tried with WolfenDoom: Blade of Agony version 1.0 and with GZDoom at this commit.

EDIT: Graf, is this assertion correct? I think it should be

Code: Select all

assert(radius >= m_currentRadius);

Re: Dynamic light radius issue

Posted: Fri Dec 23, 2016 10:31
by Graf Zahl
The *2 is needed. Just look one line above the assert.

Re: Dynamic light radius issue

Posted: Fri Dec 23, 2016 11:41
by _mental_
Yeah, I've got that code wrong.

It seems a pulse light's cycler contains old values. Shouldn't it be updated too in FLightDefaults::ApplyProperties() function like other light variables?

Re: Dynamic light radius issue

Posted: Fri Dec 23, 2016 14:14
by _mental_
Graf, could you please review this PR?

Re: Dynamic light radius issue

Posted: Fri Dec 23, 2016 16:03
by Graf Zahl
I already had been working on a fix myself. There's one thing your PR is missing: It shouldn't completely reset the cycler if it switches from one pulse light to another one - in that case the size needs to be updated but the cycle shouldn't be reset.

Re: Dynamic light radius issue

Posted: Sun Jan 01, 2017 17:30
by _mental_
This assertion failure still can happen. I just encountered it again occasionally by testing unrelated things.

Download Hades Elemental WAD and start with this command line

Code: Select all

-iwad doom2 -file Helemental.zip +map map01 +god +summon Helemental
Move away from the monster to activate its ranged attacks and wait a bit. After a few its shots assert() will trigger.