MantisBT - Zandronum
View Issue Details
0004482Zandronum[All Projects] Bugpublic2025-03-31 17:122025-03-31 19:06
IlyStr 
 
normalminoralways
newopen 
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

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;
    }
```