ID:2426438
 
Resolved
In SIDE_MAP and ISOMETRIC_MAP formats, plane masters were sorted incorrectly.
BYOND Version:512
Operating System:Windows 10 Pro 64-bit
Web Browser:Firefox 60.0
Applies to:Dream Seeker
Status: Resolved (512.1464)

This issue has been resolved.
Descriptive Problem Summary:
Look in to this post
http://www.byond.com/forum/?post=2425862#comment24602080

Code Snippet (if applicable) to Reproduce Problem:
mob/player
Login()
..()
DrawPlanes()
proc
DrawPlanes()
client.screen.Add(screenColor)
client.screen += new/obj/lighting_plane
SetLum(3, "#FFF")

atom/movable
var/image/spotlight
proc/SetLum(Range, Color, list/Params)
if(!spotlight) spotlight = new /image/spotlight
if(Params) for(var/v in Params)
spotlight.vars[v] = Params[v]
spotlight.color = Color
spotlight.transform = matrix()*Range
overlays += spotlight


obj/lighting_plane
screen_loc = "SOUTH,WEST to NORTH,EAST"
plane = 2
blend_mode = BLEND_MULTIPLY
appearance_flags= PLANE_MASTER | NO_CLIENT_COLOR
// mouse_opacity = 0


image/spotlight
plane = 2
blend_mode = BLEND_ADD
icon = 'lighting.dmi'
icon_state = "0"
layer = 1+EFFECTS_LAYER
appearance_flags = RESET_COLOR

mob/player
var/tmp/obj/hud/screenColor/screenColor = new

obj/hud
screenColor
icon_state = "rect"
color ="black"
screen_loc = "SOUTHWEST to NORTHEAST"
plane = 2
// mouse_opacity = 0
alpha = 255


Expected Results / Actual Results:



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

When does the problem NOT occur?
In others map_format except SIDE_MAP and ISOMETRIC_MAP.

Workarounds:
I have no idea how to fix it. I know how to get simular effect with default map_format, but this require extra proc for calculate micro layering. - it's not a good solution.

Marekssj3 wrote:
When does the problem NOT occur?
In others map_format except SIDE_MAP

Nope; my testing shows that ISOMETRIC_MAP format also has this problem, which makes sense because the layering is similar.
In response to Multiverse7
Multiverse7 wrote:
Marekssj3 wrote:
When does the problem NOT occur?
In others map_format except SIDE_MAP

Nope; my testing shows that ISOMETRIC_MAP format also has this problem, which makes sense because the layering is similar.

Stupido Marek, sure you are right. How can i missed it...
Please edit your post to describe the bug in full. "Look in to this post" gives me context but not description, and I still don't fully understand your issue.

A couple things I can tell you right off the bat is that your lighting code is incorrect. First of all, you do not want to use "SOUTH,WEST to NORTH,EAST" because that generates an icon (and therefore a plane master object) for every single tile; if your plane master is in the HUD, give it a screen_loc that's just a single tile (the position won't matter). Second, obj/hud/screenColor should not use a tiled screen_loc either; for performance, you should put it at CENTER and give it a transform big enough to cover the screen, because otherwise you have several hundred black icons instead of one for no reason.

Not ruling out a bug of course, but I do need a better description in the post. If you upload that test project or send it to me, I'm happy to take a look.
In response to Lummox JR
Lummox JR wrote:
Please edit your post to describe the bug in full. "Look in to this post" gives me context but not description, and I still don't fully understand your issue.

A couple things I can tell you right off the bat is that your lighting code is incorrect. First of all, you do not want to use "SOUTH,WEST to NORTH,EAST" because that generates an icon (and therefore a plane master object) for every single tile; if your plane master is in the HUD, give it a screen_loc that's just a single tile (the position won't matter). Second, obj/hud/screenColor should not use a tiled screen_loc either; for performance, you should put it at CENTER and give it a transform big enough to cover the screen, because otherwise you have several hundred black icons instead of one for no reason.

Not ruling out a bug of course, but I do need a better description in the post. If you upload that test project or send it to me, I'm happy to take a look.

Im so sorry Lummox JR but i don't knew how to explain it better, i thought gif show everything clearly. Maybe this demos will show what i mean.

Demo:
https://puu.sh/CHLr7.zip
Lummox JR resolved issue with message:
In SIDE_MAP and ISOMETRIC_MAP formats, plane masters were sorted incorrectly.
Okay, found a few things. The demo you sent had the lines for the plane master and background actually commented out, which took me a while to find and fix so I could see the problem in action.

Also another problem I didn't notice until now: the bug report was incorrectly filed under Dream Maker. This is a Dream Seeker bug since it's strictly client behavior.

Anyway it turns out the problem was the new partially-topographical sort being done for isometric and side-view modes. The logic in there was accidentally putting plane masters after other objects on the plane instead of before, which confused the renderer.