Minor deprecation warning: object key order

Hey everyone – I’d like to remove the guarantee that object keys are in draw-order for gather-game-client. Instead, draw order can be inferred from MapObject.zIndex. Objects are still set by overwriting the affected range, or using the built in add/delete actions. Adding objects still sets them to be on top by default (also not modifiable yet, but will be once we can drop support for ensuring key-order).

From what I’ve seen people are up to, this shouldn’t affect much, only if you’re reading the draw order from key order – everything else is unchanged. But let me know if you do depend on this and need more than ~a week to upgrade!

(This is part of an effort to finally make object keys stable & unique identifiers (right now key is unique, and id is stable, but neither are both), and stop changing unrelated objects when you delete one object at the bottom of the stack. It will also permanently fix the common races when deleting or modifying multiple objects at once)

@Bill_Uncork-It @Kevin-RtR @KiliZ – I’ll wait for you to ack before making the breaking change

I had noticed an issue with setMapObjects that showed up earlier this week. Would these changes have anything to do with that? If so, I may need to go back and adjust something, its not client critical.

Otherwise, I’ve avoided manipulating based on keys for a while, for the reasons you outlined.

Hi @npfoss,

Thanks for the heads up on this! I’ve also avoided basing our code on the key order, so we shouldn’t have any big issues with our infrastructure. I definitely like the idea of this fixing common race case issues. Looking forward to testing some more once the update is live.

Thanks again!
Kevin

1 Like

That might be related to the current refactor, I made the server-side swap earlier this week (which should have been unnoticeable) – will DM for details.