ID:94289
 
Not a bug
BYOND Version:464
Operating System:Windows 7 Home Premium
Web Browser:Firefox 3.6.3
Applies to:DM Language
Status: Not a bug

This is not a bug. It may be an incorrect use of syntax or a limitation in the software. For further discussion on the matter, please consult the BYOND forums.
Descriptive Problem Summary:
When objects with a layer equal to the turf they sit on have a pixel_x >= 0 and a pixel_y >= 0, they change between being over top of the adjacent turf to the east, and under it, depending on the x position of the viewer.

Numbered Steps to Reproduce Problem:

1. Make obj with layer = TURF_LAYER
2. Place obj on map, with pixel_x = 16
3. Go into game, watch half of it flicker into and out of existence as you change position.

Expected Results:
The object stays graphically above the turf east of its location, like it does with the northern, western and southern turfs.

Actual Results:
The object is either over or under the eastern turf, depending on the x coordinates of the observer.

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

When does the problem NOT occur?
The problem does not occur with negative or zero values of pixel_x, and does not occur with positive pixel_x, but negative pixel_y values.

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? I think it's been like this in all versions that have had pixel offsets.

Workarounds:
Place objects 1 layer above turfs, or use negative pixel_y values.
This is not a bug. Giving an obj the same layer as the turfs all around it is naturally going to produce some confusion. As a rule of thumb, icons on the same layer are subject to DS's best guess as to their proper order--which is pretty good considering all the things it has to take into account. While you're expecting turfs to always draw under objs in the event of layers being equal, that expectation is based on nothing but a guess as to how DS is building the map: first turfs, then objs and mobs. In actuality DS builds the map tile by tile before doing its layer sort. Because you took away the information DS needs to do a proper layering job, it's doing the best it can in a bad situation.
It shouldn't fluctuate based on distance from the player, it only happens when the object is to the east, and only the top half is cut off. It is a bug. Also, pixel x and y values below 0 work fine.
Again, this is not a bug. You are presenting the layering engine with a puzzle it cannot solve. Giving an obj the same layer as the turf it sits on is never advisable for reasons that are very obvious. When it straddles two turfs with the same layer, the engine is even more confused. This is simply a bad idea, but it is in no way a bug.