DaveInDev
Member
Hi there,
I know that in GMS2, now that instances layers are tied to the depth, the depth = -y method is not very good anymore because GMS2 creates a temporary layer for each new value of depth appearing in the game, which can be not efficient if your objects are changing their depth at every step...
So I saw @FriendlyCosmonaut basic method here : https://forum.yoyogames.com/index.php?threads/depth-sorting-for-gms2-alternative-to-depth-y.26079/
And I just wonder if there is any new method for depth sorting or is it the one commonly used (this one or any variant based on making a list of instances at every step, and sorting them by depth, then printing them in order).
As a first improvement, I was thinking that when you have a lot of instances, re-creating and fully sorting this list at every step is cost consuming. I Thought about creating this list as a global, and just updating it if instances are created or deleted, so that when sorting it, most of the time, if not too many instances are moving relatively to each other, it would be easier to sort, because it would be already almost sorted.
Do you know about any other method or improvement ?
I know that in GMS2, now that instances layers are tied to the depth, the depth = -y method is not very good anymore because GMS2 creates a temporary layer for each new value of depth appearing in the game, which can be not efficient if your objects are changing their depth at every step...
So I saw @FriendlyCosmonaut basic method here : https://forum.yoyogames.com/index.php?threads/depth-sorting-for-gms2-alternative-to-depth-y.26079/
And I just wonder if there is any new method for depth sorting or is it the one commonly used (this one or any variant based on making a list of instances at every step, and sorting them by depth, then printing them in order).
As a first improvement, I was thinking that when you have a lot of instances, re-creating and fully sorting this list at every step is cost consuming. I Thought about creating this list as a global, and just updating it if instances are created or deleted, so that when sorting it, most of the time, if not too many instances are moving relatively to each other, it would be easier to sort, because it would be already almost sorted.
Do you know about any other method or improvement ?