MantisBT - Zandronum
View Issue Details
0002724Zandronum[All Projects] Bugpublic2016-05-03 20:512018-09-30 21:57
Zalewa 
Edward-san 
normalminoralways
closedfixed 
MicrosoftWindowsXP/Vista/7
3.0-beta 
3.03.0 
0002724: Blinking sectors with 256 brightness blink to darkness online.
When sector brightness is set to 256 some of the standard Doom lighting effects (flicker and blink, but not glow) will cause the sector to blink between complete darkness and brightness of the adjacent sector. This happens only online. Tested with build 3.0-alpha-r160131-2023. Correct behavior can be achieved by a workaround of lowering the sector brightness level to 255.
1. Download attached sector_lights.wad
2. Run this WAD on server in cooperative mode (MAP01).
3. Join the server and observe.
4. Then run this WAD in offline mode and observe again - problem should go away.
I have checked with Zandronum 2.1.2, Chocolate Doom and vanilla Doom. All of them work correctly with brightness 256.
No tags attached.
? sector_lights.wad (5,303) 2016-05-03 20:51
/tracker/file_download.php?file_id=1802&type=bug
Issue History
2016-05-03 20:51ZalewaNew Issue
2016-05-03 20:51ZalewaFile Added: sector_lights.wad
2016-05-04 17:21Edward-sanNote Added: 0014819
2016-05-04 17:25Edward-sanNote Edited: 0014819bug_revision_view_page.php?bugnote_id=14819#r8973
2016-05-04 18:14Edward-sanNote Added: 0014820
2016-05-04 18:14Edward-sanAssigned To => Edward-san
2016-05-04 18:14Edward-sanStatusnew => assigned
2016-05-04 18:15Edward-sanNote Edited: 0014820bug_revision_view_page.php?bugnote_id=14820#r8975
2016-05-04 19:10Edward-sanNote Added: 0014821
2016-05-04 19:10Edward-sanStatusassigned => needs review
2016-05-04 20:20ZalewaNote Added: 0014822
2016-05-04 21:55Edward-sanNote Added: 0014823
2016-05-04 21:56Edward-sanNote Edited: 0014823bug_revision_view_page.php?bugnote_id=14823#r8977
2016-05-04 22:00Edward-sanNote Edited: 0014823bug_revision_view_page.php?bugnote_id=14823#r8978
2016-05-04 22:00Edward-sanNote Edited: 0014823bug_revision_view_page.php?bugnote_id=14823#r8979
2016-05-08 19:09Torr SamahoNote Added: 0014833
2016-05-08 19:10Torr SamahoStatusneeds review => feedback
2016-05-08 20:57Edward-sanNote Added: 0014841
2016-05-08 20:57Edward-sanStatusfeedback => needs testing
2016-05-11 22:29Ru5tK1ngNote Added: 0014871
2016-05-11 22:29Ru5tK1ngStatusneeds testing => resolved
2016-05-11 22:29Ru5tK1ngResolutionopen => fixed
2016-05-11 22:29Ru5tK1ngFixed in Version => 3.0
2016-05-11 22:29Ru5tK1ngTarget Version => 3.0
2016-11-20 21:35Edward-sanProduct Version3.0 => 3.0-beta
2018-09-30 21:57Blzut3Statusresolved => closed

Notes
(0014819)
Edward-san   
2016-05-04 17:21   
(edited on: 2016-05-04 17:25)
The network code assumes that the light value is in the range [0-255], so of course setting the brightness to 256 won't work. In 2.1, the minlight and the maxlight values were clamped between 0 and 255, so this is why the issue didn't show up before.

BTW: the involved zdoom change is r3223.

(0014820)
Edward-san   
2016-05-04 18:14   
(edited on: 2016-05-04 18:15)
I reread the discussion which brought that fix:'http://forum.zdoom.org/viewtopic.php?f=7&t=29993 [^]' , it seems that it's possible to have the brightness values even greater than 256 (technically in the 'short int' range) since vanilla doom (see esselfortium's post in the next page) so it's necessary to raise the bandwidth consumption as needed.

(0014821)
Edward-san   
2016-05-04 19:10   
Fixed with this pull request.

Incidentally, I noticed a bug in zdoom's code which didn't clamp the light values for the light flicker code and made a bug report here.
(0014822)
Zalewa   
2016-05-04 20:20   
Won't sending a short instead of a byte increase the bandwidth consumption needed during the entire game? Perhaps, while technically incorrect, it would've been more practical to clamp the value to 255 and keep sending it as a byte? I don't know if there's any case where brightness above 256 is used
(0014823)
Edward-san   
2016-05-04 21:55   
(edited on: 2016-05-04 22:00)
The only action which could give problems in term of bandwidth is the glowing light one (commit history doesn't tell me why each tic the server must send an update for the DGlow2 action...). Nevermind that. The additional bandwidth usage is either 1 or 2 bytes per action start/stop, so it's not a big deal.

(0014833)
Torr Samaho   
2016-05-08 19:09   
Do you know of any map where spending the additional byte makes a visible lighting difference?
(0014841)
Edward-san   
2016-05-08 20:57   
Clarified via IRC. Added the fix with changeset:'https://bitbucket.org/Torr_Samaho/zandronum/commits/422433728c1fd2c7d0c435c02f3589a2a4c8f6c7 [^]' . Added the zdoom fix with changeset:'https://bitbucket.org/Torr_Samaho/zandronum/commits/c7646bd1657d11f6f8a6d68ec7498085501b791e [^]' .
(0014871)
Ru5tK1ng   
2016-05-11 22:29   
Tested this online with r160510-1827 and the light effects appeared to be the same as offline effects.