MantisBT - Zandronum
View Issue Details
0004482Zandronum[All Projects] Bugpublic2025-03-31 17:122025-10-31 16:27
IlyStr 
 
normalminoralways
confirmedbackport later 
ASRock B550, AMD Ryzen 5 56 x64Windows 10 LTSC Enterprise21H2 (19044.357)
4.0-beta 
 
0004482: Flicker dyn.light's radius chance is inverted (Relatively to GZDoom and UDB)
In GZDoom and UDB:
1 — Almost always radius №2
359 — Almost always radius №1

Zandronum:
1 — Almost always radius №1
359 — Almost always radius №2

Why? It's supposed to be easily solved here
'https://github.com/TorrSamaho/zandronum/blob/2ec1c262355a59762353dc9594d6f3c3b79fb508/src/gl/dynlights/a_dynlight.cpp#L267 [^]'
```
        m_currentIntensity = float(m_intensity[rnd >= (1.f-pct) * 255]);
```

or more accurately here
'https://github.com/TorrSamaho/zandronum/blob/2ec1c262355a59762353dc9594d6f3c3b79fb508/src/gl/dynlights/a_dynlight.cpp#L265 [^]'
```
        float pct = ANGLE_TO_FLOAT(360-angle)/360.f;
```
I have 16+ dyn. flicker lights on map with second radius 0 and angle 350

Max lights on in GZDoom:'https://imgur.com/emuYEjQ [^]'
Max lights on in Zandronum:'https://imgur.com/zWiYzT7 [^]'
No tags attached.
Issue History
2025-03-31 17:12IlyStrNew Issue
2025-03-31 17:14IlyStrNote Added: 0024372
2025-03-31 17:17IlyStrNote Edited: 0024372bug_revision_view_page.php?bugnote_id=24372#r14520
2025-03-31 19:06IlyStrNote Added: 0024374
2025-10-31 16:27Ru5tK1ngNote Added: 0024609
2025-10-31 16:27Ru5tK1ngStatusnew => confirmed
2025-10-31 16:27Ru5tK1ngResolutionopen => backport later

Notes
(0024372)
IlyStr   
2025-03-31 17:14   
(edited on: 2025-03-31 17:17)
And yes, I know that git thread is just a duplicate of heptapod's stable thread

(0024374)
IlyStr   
2025-03-31 19:06   
In general, it's best to backport from GZDoom.

'https://github.com/ZDoom/gzdoom/blob/master/src/playsim/a_dynlight.cpp [^]'
```
    case FlickerLight:
    {
// float rnd = randLight(360); if FRandom in Za can process arguments
//or if Za's FRandom cannot do this
        float rnd = randLight % 360.f;
        m_currentRadius = float((rnd < ANGLE_TO_FLOAT(angle))? pArgs[LIGHT_INTENSITY] : pArgs[LIGHT_SECONDARY_INTENSITY]);
        break;
    }
```
(0024609)
Ru5tK1ng   
2025-10-31 16:27   
The way the flicker lights are handled was changed by GZDoom 2.2. So the issue will be resolved when Zandro's codebase upgrades to this version of GZ. Zan 4.0 will be GZ 2.2 and that version is dropping next after 3.3.