Surfaces showing the wrong light level in game

Need help running G/Q/ZDoom/ECWolf/Zandronum/3DGE? Did your computer break? Ask here.

Moderator: GZDoom Developers

Surfaces showing the wrong light level in game

Postby Enjay » Sat Oct 23, 2021 4:02 pm

I'm not posting this as a bug because I'm not sure that it is (it could just be my settings) and I'm also struggling to get a good example setup.

I've noticed that sometimes I'm seeing surfaces (always floors/ceilings as far as I have noticed) showing the wrong lighting level. I *think* it might be something to do with updating of lighting information.

Examples:

Sector 1 has light level 112. Sector 2 is set at 120 and the adjacent sectors are progressively brighter. The walls look correct, but the ceiling doesn't. The only weird thing here is that the sectors are "flickered" by a script. The brightness of all sectors in the shot apart from 1 is lowered by a random value (never more than 8 - so it never goes darker than sector 2) and then set back to what it was originally.


This one is simpler. By the time this shot was taken, the slightly darker rectangle (sector 1) should look exactly the same as the surrounding sector 2. Both sectors are set up identically, except that sector 2 is secret and sector 1 has a tag.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Surfaces showing the wrong light level in game

Postby Graf Zahl » Sat Oct 23, 2021 4:04 pm

I can't say from screenshots alone.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Surfaces showing the wrong light level in game

Postby Enjay » Sat Oct 23, 2021 4:08 pm

OK, a little progress. What I said about the second example got me thinking - sector tags are somehow behind the issue.

If I remove the sector tag from sector 1 in image 2, it matches sector 1. I know what you're thinking - I accidentally tagged a transfer light special to the sector. I've checked and double checked. I have not made that mistake. What's more, giving the sector a tag - any tag will cause the effect to happen. I tried with sector tag 9999 which I know I have definitely not used anywhere.

[edit]
Update - yes, tags seem to be behind this... somehow. I gave the wrong-looking sector 1 from the first example a tag. All the other sectors in the image have tags because, as I mentioned, a script is making the light levels flicker. If I give sector 1 a tag too (I gave it 9999 again - which is not called from any script or line special) then the ceiling in that sector looks as it it intended to.



I will try to get an example that shows the issue.
[/edit]
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Surfaces showing the wrong light level in game

Postby Enjay » Sat Oct 23, 2021 5:32 pm

OK, mark this one down to "Enjay is an idiot". Image

After pruning away the map to try to make a testable version, I noticed that whenever I deleted a particular area of the map that was nowhere near the problem area, the problem went away. I searched and searched and eventually found a tiny little transfer ceiling lights line (only 2 units long) that somehow must have got left over when I deleted something else. The reason it was causing a problem? Its tag field was not set, so it was effectively tagged to any sector without a tag/tag 0. Image

The map is reasonably uniformly lit (with lighting coming from dynamic lights) so in most of the map the problem wasn't noticeable - but it explains why the problem went away when I gave problem sectors a tag: they no longer had tag 0, so the transfer light special didn't affect them.

Yup. That's a couple of hours of my life I'm not getting back.

Enjay wrote:I know what you're thinking - I accidentally tagged a transfer light special to the sector. I've checked and double checked. I have not made that mistake.

Yeah, so apparently I did make that mistake. Kind of.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Surfaces showing the wrong light level in game

Postby Rachael » Sat Oct 23, 2021 5:59 pm

If I could count the number of times I have made similarly self-deprecating mistakes and beat myself up for it ....

Glad you found the problem though :)
User avatar
Rachael
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Debian-like Linux (Debian, Ubuntu, Mint, etc) 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Surfaces showing the wrong light level in game

Postby Graf Zahl » Sun Oct 24, 2021 12:16 am

That's pretty much what I expected...
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Surfaces showing the wrong light level in game

Postby Enjay » Sun Oct 24, 2021 3:32 am

Yeah, it was pretty much my first assumption too but when my initial search didn't find the offending line, I went down a rabbit hole of looking for other possibilities, blind to the idea that was actually the problem because I thought I'd already investigated it and ruled it out. I'm going to blame lack of sleep. ;)

I'm still not sure how I managed to create the offending line, why it was set for sector tag 0 or why it had gone unnoticed for so long (again, lack of sleep is the prime suspect) but at least it's gone now and the map works as intended.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland


Return to Technical Issues

Who is online

Users browsing this forum: No registered users and 0 guests