IanFrank
Member
Hi!
I am using FriendlyCosmonauts depth sorting system, which is descibed here:
and here : https://github.com/GameMakerDiscord/depth-system
Basically you add all objects included in the system to a list, then sort the list by the objects Y positions, and finally draw them in the list order.
The problem is, when the objects are positioned at the same y position and overlapping, they start trading places on the list as the player moves around the room, which result in flickering behind and in front of each other. Not sure why, i guess it's a gamemaker instance handling thing.
I've made a fix that seems to work, by adding a third column where i add the ID and the object y to a binary, like this:
..and then sort by the 3rd column.
Honestly, i don't really understand my fix and i am sure it is not stable.. So my question is - does anyone have a proper solution for this issue?
I know there are other depth sorting systems, but this one seems fine for my small rpg.
Thanks in advance.
I am using FriendlyCosmonauts depth sorting system, which is descibed here:
and here : https://github.com/GameMakerDiscord/depth-system
Basically you add all objects included in the system to a list, then sort the list by the objects Y positions, and finally draw them in the list order.
The problem is, when the objects are positioned at the same y position and overlapping, they start trading places on the list as the player moves around the room, which result in flickering behind and in front of each other. Not sure why, i guess it's a gamemaker instance handling thing.
I've made a fix that seems to work, by adding a third column where i add the ID and the object y to a binary, like this:
GML:
dgrid[# 0, yy] = id;
dgrid[# 1, yy] = y+z;
dgrid[# 2, yy] = (id | id.y << 32);
Honestly, i don't really understand my fix and i am sure it is not stable.. So my question is - does anyone have a proper solution for this issue?
I know there are other depth sorting systems, but this one seems fine for my small rpg.
Thanks in advance.