[0.17.69] Lamps and Ultra Wide resolutions

Things that has been reported already before.
Post Reply
roze
Inserter
Inserter
Posts: 24
Joined: Thu Sep 15, 2016 10:31 am
Contact:

[0.17.69] Lamps and Ultra Wide resolutions

Post by roze »

Hi,
This is a minor bug, but yet a bug. When moving away from a light source with large radius, the light stops rendering on Ultra Wide resolutions (not tested on non-UW). See screenshots. There is nothing turning on or off the lights, they are just normal day-night-cycling lamps.
Factorio-lamp-bug-1.jpg
Factorio-lamp-bug-1.jpg (125.44 KiB) Viewed 2920 times
Following image I moved away Slightly from the light source, and its light stopped rendering.
Factorio-lamp-bug-2.jpg
Factorio-lamp-bug-2.jpg (113.89 KiB) Viewed 2920 times
The issue seems to only be apparent when using mods which add lamps with larger light emitting radius. Ex. the large lamps for IR ( viewtopic.php?t=68765 )

Suggested fix, give a property for how long to keep entities off-screen. Happens in Y-direction too, so perhaps not really a UW fault after all.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [0.17.69] Lamps and Ultra Wide resolutions

Post by eradicator »

Sounds a bit like this? viewtopic.php?p=438678#p438678
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

User avatar
invisus
Filter Inserter
Filter Inserter
Posts: 284
Joined: Fri Sep 21, 2018 5:33 pm
Contact:

Re: [0.17.69] Lamps and Ultra Wide resolutions

Post by invisus »

eradicator wrote:
Wed Oct 02, 2019 10:17 pm
Sounds a bit like this? viewtopic.php?p=438678#p438678
Or perhaps viewtopic.php?f=11&t=71729

roze
Inserter
Inserter
Posts: 24
Joined: Thu Sep 15, 2016 10:31 am
Contact:

Re: [0.17.69] Lamps and Ultra Wide resolutions

Post by roze »

invisus wrote:
Thu Oct 03, 2019 4:31 am
eradicator wrote:
Wed Oct 02, 2019 10:17 pm
Sounds a bit like this? viewtopic.php?p=438678#p438678
Or perhaps viewtopic.php?f=11&t=71729
Perhaps a duplicate, but linked post is stated as resolved. Feel free to merge if needed.

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: [0.17.69] Lamps and Ultra Wide resolutions

Post by Deadlock989 »

roze wrote:
Thu Oct 03, 2019 8:07 am
invisus wrote:
Thu Oct 03, 2019 4:31 am
Or perhaps viewtopic.php?f=11&t=71729
Perhaps a duplicate, but linked post is stated as resolved. Feel free to merge if needed.
There were two large-radius lamp issues raised by that mod - the one quoted above and this one: viewtopic.php?f=11&t=73451

I can't see from the screenshot whether it is the burner lamp or the electric lamp producing the effect. If it is the burner lamp, then the fix was applied in the post quoted by invisus. Those "lamps" are not actually lamps but a modded furnace with a large working_visualisation light effect. The problem was not so much a pop-in effect of the lamp brightness but a strange "double glow" when the lamp was on the boundary of the maximum render distance, and also momentary glows at that precise distance even when the "lamp" was actually off. It is possible that the fix applied by Rseding tweaked the render distance so that it works for normal ratio resolutions but that widescreen ratio still breaks it on the horizontal axis.

If it is the electric lamp, those are actual proper lamps and the bug fix was a little different. Ditto the difference with widescreen ratios, but in this case the light is created by the lamp's normal light effect and not by a working_visualisation, and there was never any issue with the glow appearing at the max render distance when the lamp was off.

So this is not a duplicate thread at all, imo.
Image

posila
Factorio Staff
Factorio Staff
Posts: 5201
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [0.17.69] Lamps and Ultra Wide resolutions

Post by posila »

For next release I've added light_renderer_search_distance_limit to utility constants, so mods can change it (it can be set to anything from range 0 to 255, but larger values will be clamped to 160). Default value is 15 (tiles). Setting it to larger values can have performance impact (growing geometrically)

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: [0.17.69] Lamps and Ultra Wide resolutions

Post by Deadlock989 »

posila wrote:
Thu Oct 03, 2019 11:14 am
For next release I've added light_renderer_search_distance_limit to utility constants, so mods can change it (it can be set to anything from range 0 to 255, but larger values will be clamped to 160). Default value is 15 (tiles). Setting it to larger values can have performance impact (growing geometrically)
Thanks for this.

Is the default value also 15 right now (i.e. in <=0.17.69, without the utility constant exposure)?

What is the relationship between the search constant and the light source radius? It's not clear to me what units the size property of lights has - the large lamps in that mod are currently size 80, but they're certainly not 80 tiles wide.

To be honest I'm reluctant to change the mod's settings to cope fully with Ultrawide monitors if it's going to negatively affect game performance for everyone else.
Image

posila
Factorio Staff
Factorio Staff
Posts: 5201
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [0.17.69] Lamps and Ultra Wide resolutions

Post by posila »

Deadlock989 wrote:
Thu Oct 03, 2019 11:18 am
Is the default value also 15 right now (without the utility constant exposure)?
That's correct.
Deadlock989 wrote:
Thu Oct 03, 2019 11:18 am
What is the relationship between the search constant and the light source radius? It's not clear to me what units the size property of lights has - the large lamps in that mod are currently size 80, but they're certainly not 80 tiles wide.

To be honest I'm reluctant to change the mod's settings to cope fully with Ultrawide monitors if it's going to negatively affect game performance for everyone else.
The size in light definition should be diameter of the light. So for your light of size 80, the light would have radius 40; you can reduce it by 3 to 37, because entity renderer draws at least 3 tiles outside of any edge of the screen, and the light renderer search distance is actually relative to the entity renderer search box. In addition, if you look at the actual light sprite (light-medium.png), you can see 80% of distance from center to edge, the light intensity fell to under 10%, and you might say it's not that big of a deal if weak light pops-in to the view - so that would be 40*0.8 - 3 = 29, so setting it to 30 for good measure should sufficiently fix the issue while not incur that much of extra load.

As far as I know, the issue is not limited to ultrawide screens, it's just what OP has experienced it on.

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: [0.17.69] Lamps and Ultra Wide resolutions

Post by Deadlock989 »

posila wrote:
Thu Oct 03, 2019 12:44 pm
The size in light definition should be diameter of the light. So for your light of size 80, the light would have radius 40; you can reduce it by 3 to 37, because entity renderer draws at least 3 tiles outside of any edge of the screen, and the light renderer search distance is actually relative to the entity renderer search box. In addition, if you look at the actual light sprite (light-medium.png), you can see 80% of distance from center to edge, the light intensity fell to under 10%, and you might say it's not that big of a deal if weak light pops-in to the view - so that would be 40*0.8 - 3 = 29, so setting it to 30 for good measure should sufficiently fix the issue while not incur that much of extra load.

As far as I know, the issue is not limited to ultrawide screens, it's just what OP has experienced it on.
Thanks for this, cleared up something that was bothering me for a while. Didn't occur to me that it might be diameter and not radius.

After Rseding fixed the other two glitches, I did test the big lamps again and don't remember seeing any pop-in effects, in both 1080p and 4K resolutions. But didn't test widescreen, find them an odd proposition in the first place (would love an enormous square 1:1 ratio monitor personally).

I'll wait for the next update to drop with the utility constant exposure, and then maybe look at giving them their own custom light sprite that has a sharper falloff or something, so that I can cut the radius down even further but maintain roughly the same effect. Or I might just spend that time sipping cocktails out of a pineapple with a little umbrella in it, who knows.
Image

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: [0.17.69] Lamps and Ultra Wide resolutions

Post by Deadlock989 »

So I did some testing on both kinds of light source. These were all on a 4K resolution monitor at zoom level 1.

Burner "lamp", size 80 light, intensity 0.75, colour orange, in a working visualisation:

Top edge: no visible pop-in
Bottom edge: no visible pop-in
Left edge: barely visible pop-in that you'd only notice if you were looking for it
Right edge: much more obvious pop-in

Large lamp, size 80 light, intensity 0.75, colour not-quite-white, in lamp light definition:

Top edge: barely visible pop-in that you'd only notice if you were looking for it
Bottom edge: much more obvious pop-in
Left edge: barely visible pop-in that you'd only notice if you were looking for it
Right edge: much more obvious pop-in and also a return of this bug

The difference between top/bottom and left/right is easy to understand given that the screen is not square but there is a single constant for the renderer search distance. The differences in behaviour between left and right, and top and bottom for real lamps, are beyond me though.

None of these things are exactly game-breaking, despite playing maybe 100 hours with this mod installed after the previous bug reports, I had never really noticed it happening.
Image

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: [0.17.69] Lamps and Ultra Wide resolutions

Post by Deadlock989 »

posila wrote:
Thu Oct 03, 2019 12:44 pm
The size in light definition should be diameter of the light. So for your light of size 80, the light would have radius 40; you can reduce it by 3 to 37, because entity renderer draws at least 3 tiles outside of any edge of the screen, and the light renderer search distance is actually relative to the entity renderer search box. In addition, if you look at the actual light sprite (light-medium.png), you can see 80% of distance from center to edge, the light intensity fell to under 10%, and you might say it's not that big of a deal if weak light pops-in to the view - so that would be 40*0.8 - 3 = 29, so setting it to 30 for good measure should sufficiently fix the issue while not incur that much of extra load.

As far as I know, the issue is not limited to ultrawide screens, it's just what OP has experienced it on.
Thanks for this in 0.17.70. Works perfectly.

I got the distance down to 25 by tweaking the sprite so that the visible glow goes right up to the edge of the bitmap, which let me get the light size down to 60 without any major difference in coverage.
Image

Post Reply

Return to “Duplicates”