BYOND Version:507
Operating System:Windows 7 Ultimate 64-bit
Web Browser:Chrome 43.0.2357.81
Applies to:Dream Seeker
Status: Open

Issue hasn't been assigned a status value.

Test project:

Descriptive Problem Summary:
The test project is very small, 1 page of code, it will explain everything!
I know this has been reported before but never fixed because nobody has yet provided a test game to show the bug, but I am. The bug is that in TOPDOWN_MAP with pixel movement there is a layering problem where for example if there are two players who's mobs have bound_y=0 and bound_height=23 with world.icon_size=32, and one player approaches vertically til they bump the other, they will be layered incorrectly about 50% of the time. See the picture.

Numbered Steps to Reproduce Problem:
Run the test project then approach the other mobs in it from the north til you bump into them and you will quickly see incorrect layering after bumping enough mobs.

Does the problem occur:
Every time? Or how often? 50% of the time roughly depending on step_y and step_x values
In other games? Yes
In other user accounts? Yes
On other computers? Yes

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 to download old versions for testing.)
All versions I believe has this problem

None that I know of being that my custom layering system based on y and step_y value didn't correct the problem as expected
This is the entire code to the test project
for(var/v in 1 to 100)


icon='Alien 9.dmi'


Thanks for all your work on BYOND, I hate to slow down the process with another potentially useless bug report. But I think this is a real bug this time. Of course I always think it's a real bug til someone posts something refuting it.
I don't think this actually is a bug--not in topdown mode. Topdown mode does little tricks to try to present a consistent layering order when two objects share the same layer, but it can only go so far. You're overlapping your mobs, which requires the engine to get creative.

SIDE_MAP is actually intended for cases just like this. (Its layering isn't perfect either, owing to not using a topographic sort, but I'm hoping to fix that in the future. For what you're using it for, I'd say you're unlikely to see any of SIDE_MAP's issues and you're probably better off switching to it.)

I intend to look into this regardless, so if there is a bug in play I should find out. But I suspect that's not the case.
I did try SIDE_MAP and for some reason it has a bug where overlays of other players will flicker on and off while moving around. But that is an entirely different report.

But running this every Move() seems to give me the behavior I want in TOPDOWN_MAP
if(!y) return
var/offset=y + (step_y / world.icon_size)


So it's all good
Probably the issue you're seeing is a subtle variation in the microlayer that objects are given. Your fix is basically very similar to the microlayer code.