ID:100277
 
Resolved
Luminous tiles that were also opaque did not always spread their illumination correctly.
BYOND Version:473
Operating System:Windows 7 Home Basic
Web Browser:Firefox 3.6.8
Applies to:Dream Seeker
Status: Resolved (475)

This issue has been resolved.
Descriptive Problem Summary:

If you set area luminosity to 0, then place a bunch of luminous objects around to light the environment, walking around the environment produces very sketchy luminosity, with turfs flicking in and out of being visible arbitrarily.

Numbered Steps to Reproduce Problem:

1. Set default area luminosity = 0
2. Create objects with luminosity = 2 or greater
3. Place objects around a map on turfs within the area
4. Walk around on these turfs.

You'll notice turfs are sometimes illuminated and sometimes not for no particular reason. Updates each time you move, consistently correctly or incorrectly lighting turfs depending on where the player mob is standing.

Code Snippet (if applicable) to Reproduce Problem:
area

luminosity = 0 // Set to 0 for dark world

obj/device/sensor
var/const/LUMINOSITY_CAST_BY_SENSOR = 4
var/const/MAXIMUM_SENSOR_ENERGY = 10
var/const/ENERGY_DRAINED_PER_10_MS = 1
// For optimal efficiency, set at MAXIMUM_SENSOR_ENERGY * (ENERGY_DRAINED_PER_10_MS*10)
var/const/FREQUENCY_OF_SENSOR_POWER_CHECK_IN_MS = 100

name = "Sensor"
desc = "Sensors operate like lights, illuminating the area, for a relatively low energy cost."
icon_state = "sensor_inactive"

luminosity = 0

density = 0

New(var/location, var/initialEnergy)
maxEnergy = MAXIMUM_SENSOR_ENERGY
..(location, initialEnergy)

UpdateAppearance()
if (IsActivated())
if (icon_state == "sensor_inactive")
overlays.Add(GLOBAL_SENSOR_LIT_OVERLAY)
icon_state = "sensor_active"
flick("sensor_activating",src)
luminosity = LUMINOSITY_CAST_BY_SENSOR
else
if (icon_state == "sensor_active")
overlays.Remove(GLOBAL_SENSOR_LIT_OVERLAY)
icon_state = "sensor_inactive"
flick("sensor_deactivating",src)
luminosity = 0


Expected Results:

I expect to see turfs illuminated whenever something capable of casting luminosity is showing on them, whenever that turf is in view, regardless of whether or not the luminous object illuminating that turf is visible to the player.

Actual Results:

Turfs are not consistently lighted by luminous objects.

Does the problem occur:
Every time? Or how often?: Vast majority of cases, sometimes you'll have a lit hall that will look fine, larger open places seem more frequently.
In other games?: Any game I've been developing, anyway.
In other user accounts?: N/A.
On other computers?: N/A.

When does the problem NOT occur?
I would say when all luminosity-casting objects are visible in view(), but actually, even this is sketchy.

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked?
I'm going to assume, at some point, luminosity worked.

Workarounds:
Don't set area luminosity = 0, soft-code your own luminosity model to get around BYOND's sketchy one.
I'd bet the issue you're describing has been around for quite a while, but a video would probably help. However I can't see your screenshots because you uploaded them as hidden instead of visible.
Whoops, I was thinking "hide" just meant it wasn't being advertised. Untoggled the "hide" checkmark for those files.
Thou art awesome, Lummox Jr JR.
JR
My bad. Lummox JR.
Now I have to wonder if the JR stands for something.