ID:2091418
 
BYOND Version:510
Operating System:Windows 7 Ultimate 64-bit
Web Browser:Chrome 50.0.2661.102
Applies to:Dream Daemon
Status: Unverified

Thus far we've been unable to verify or reproduce this bug. Or, it has been observed but it cannot be triggered with a reliable test case. You can help us out by editing your report or adding a comment with more information.
Descriptive Problem Summary:
In 510.1345 I am trying to create a 'Fog of War' effect using /image datums attached to turfs. However, these images are only showing up in my view if I can normally see the turf, even though my mob has the SEE_TURFS flag set.

It turns out that if I set SEE_OBJS (without removing SEE_TURFS) on my mob, that I can see the turfs (as well as objects, which is slightly less desirable at this point) properly.

Here are the turf visibilities with SEE_TURFS:




Here are the turf visibilities with SEE_OBJS:




And here are the turf visibilities with SEE_TURFS | SEE_OBJS




Code Snippet (if applicable) to Reproduce Problem:
/turf
var
FogValue = FALSE
FogDone = FALSE
image/FoWImage = null

proc
PreviouslySeen(var/mob/Player)
// TODO replace this with party handling down the road
return FogValue

ShowTo(var/mob/Player)
Player << FoWImage
FogValue = TRUE // TODO change this

MakeFoWStandin()
var/obj/Runtime/TurfStandIn/TSI = new()
TSI.icon = icon
TSI.icon_state = icon_state
TSI.layer = layer
TSI.Move(src)

FogOfWar()
if (FogDone)
return
FogDone = TRUE
alpha = 0
//MakeFoWStandin() <-- Removed this for ease of identifying issue
FoWImage = image(icon, src, icon_state, layer)
FoWImage.color = rgb(128, 128, 128)
FoWImage.appearance_flags = RESET_ALPHA | RESET_COLOR
FoWImage.override = TRUE


/mob
Move()
. = ..()
if (.)
for(var/turf/T in view(src))
if (!T.PreviouslySeen(src))
T.ShowTo(src)


Expected Results:
Turfs and images attached to turfs are always visible when SEE_TURFS flag is set on client.mob.sight

Actual Results:
Turfs and images attached to turfs are only always visible when SEE_TURFS | SEE_OBJS flags are set on client.mob.sight

Does the problem occur:
Every time? Or how often? Every time
In other games? Not tested
In other user accounts? Not tested
On other computers? Not tested

When does the problem NOT occur?

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)

Workarounds:
None I know of
Send me a zip with a test case, and I'll look into it Tuesday.
http://greenfirework.com/IsoTestCase.zip

The basics of the Fog of War system is that the turfs are rendered with alpha=0, and an /image in place of them (you'll see this when the bake finishes in-game and the turfs all disappear; they'll start to reappear as you move). Also, there are 3 verbs that will be useful for changing your mob's sight variable on the fly.

If you walk into the building at the start you'll see the turfs outside the building disappear from your view. If you enable SEE_OBJS, you'll see all the walls, SEE_TURFS (which is also the default when you spawn) will do almost nothing (the turfs are all invisible), and SEE_OBJS | SEE_TURFS will show you the /image objects for the turfs you've seen previously.. along with all the walls you shouldn't be able to see right now.

What I would expect is that the /image objects are visible by default once they've been output to you.. so you'd see all the turfs you've previously seen.

Also, /turf/MakeFoWStandin() is not called. If the call to it is uncommented, then 'stand-in' objects are created that allow you to see all of the turfs at full brightness, IF they are currently in your active view. It kind of breaks the fog-of-war though, if SEE_OBJS is set.
I'm not certain there's a bug in play here, after trying out your code.

One of the red flags is that you're using SEE_PIXELS with isometric mode, but isometric doesn't support SEE_PIXELS at all. There's no logic to outright deactivate the attempt to use it, so the mode makes some assumptions based on the idea that it will try to display unlit turfs and then cover them with blackness.

Images are subject to the same rules as their parent atom, with the exception that they override invisibility. So if the atom is blocked by opacity, all images attached to it are blocked as well. SEE_TURFS and SEE_OBJS will override that, but that also means opacity will be meaningless for that class of atoms.
Lummox JR changed status to 'Unverified'