How do I => non symetric isometric collision object & Z

Here the copy/paste events:

Events

{“000kind”:“GDEVELOP_EventsAndInstructions_CLIPBOARD_KIND-jsBdHbLy912y8Rc”,“content”:{“eventsList”:[{“type”:“BuiltinCommonInstructions::Standard”,“conditions”:,“actions”:[{“type”:{“value”:“SetNumberVariable”},“parameters”:[“Isometric_Factor”,“=”,“0.5”]}],“events”:[{“type”:“BuiltinCommonInstructions::Comment”,“color”:{“b”:109,“g”:230,“r”:255,“textB”:0,“textG”:0,“textR”:0},“comment”:“Assign unique Z value”},{“type”:“BuiltinCommonInstructions::ForEach”,“object”:“Grp_Isometric_object”,“conditions”:,“actions”:[{“type”:{“value”:“SetNumberVariable”},“parameters”:[“ZIndex”,“+”,“1”]},{“type”:{“value”:“SetZOrder”},“parameters”:[“Grp_Isometric_object”,“=”,“ZIndex”]}],“variables”:[{“name”:“ZIndex”,“type”:“number”,“value”:0}],“orderBy”:“Grp_Isometric_object.Y()”,“order”:“desc”},{“type”:“BuiltinCommonInstructions::ForEach”,“object”:“Grp_Isometric_object”,“conditions”:,“actions”:[{“type”:{“value”:“SetNumberVariable”},“parameters”:[“ThisLowestX”,“=”,“Grp_Isometric_object.X()”]},{“type”:{“value”:“SetNumberVariable”},“parameters”:[“ThisLowestY”,“=”,“Grp_Isometric_object.Y()”]},{“type”:{“value”:“SetNumberVariable”},“parameters”:[“ThisZ”,“=”,“Grp_Isometric_object.ZOrder()”]}],“events”:[{“type”:“BuiltinCommonInstructions::Standard”,“conditions”:,“actions”:[{“type”:{“value”:“DebuggerTools::ConsoleLog”},“parameters”:[“Grp_Isometric_object.ObjectName()+" ("+ToString(Grp_Isometric_object.X())+","+ToString(Grp_Isometric_object.Y())+")"+" do check"”,“"info"”,“""”]}]},{“type”:“BuiltinCommonInstructions::Standard”,“conditions”:[{“type”:{“value”:“PickAllInstances”},“parameters”:[“”,“Grp_Isometric_object”]}],“actions”:,“events”:[{“type”:“BuiltinCommonInstructions::ForEach”,“object”:“Grp_Isometric_object”,“conditions”:,“actions”:[{“type”:{“value”:“SetNumberVariable”},“parameters”:[“OtherLeftestX”,“=”,“Grp_Isometric_object.BoundingBoxLeft()”]},{“type”:{“value”:“SetNumberVariable”},“parameters”:[“OtherLeftestY”,“=”,“Grp_Isometric_object.Y()+(Grp_Isometric_object.BoundingBoxLeft()-Grp_Isometric_object.X())*Isometric_Factor”]},{“type”:{“value”:“SetNumberVariable”},“parameters”:[“OtherRightestX”,“=”,“Grp_Isometric_object.BoundingBoxRight()”]},{“type”:{“value”:“SetNumberVariable”},“parameters”:[“OtherRightestY”,“=”,“Grp_Isometric_object.Y()-(Grp_Isometric_object.BoundingBoxRight()-Grp_Isometric_object.X())*Isometric_Factor”]},{“type”:{“value”:“SetNumberVariable”},“parameters”:[“OtherZ”,“=”,“Grp_Isometric_object.ZOrder()”]},{“type”:{“value”:“SetNumberVariable”},“parameters”:[“NormalizeLeftest”,“=”,“(ThisLowestY-OtherLeftestY)/(ThisLowestX-OtherLeftestX)”]},{“type”:{“value”:“SetNumberVariable”},“parameters”:[“NormalizeRightest”,“=”,“(ThisLowestY-OtherRightestY)/(ThisLowestX-OtherRightestX)”]}],“events”:[{“type”:“BuiltinCommonInstructions::Standard”,“conditions”:,“actions”:[{“type”:{“value”:“DebuggerTools::ConsoleLog”},“parameters”:[“Grp_Isometric_object.ObjectName()+" ("+ToString(Grp_Isometric_object.X())+","+ToString(Grp_Isometric_object.Y())+")"+" NL:"+NormalizeLeftest+" RL:"+NormalizeRightest+" Leftest:"+OtherLeftestX+","+OtherLeftestY+" Rightest"+OtherRightestX+","+OtherRightestY”,“"info"”,“""”]}]},{“type”:“BuiltinCommonInstructions::Standard”,“conditions”:[{“type”:{“value”:“NumberVariable”},“parameters”:[“ThisZ”,“<”,“OtherZ”]},{“type”:{“value”:“BuiltinCommonInstructions::Or”},“parameters”:,“subInstructions”:[{“type”:{“value”:“BuiltinCommonInstructions::And”},“parameters”:,“subInstructions”:[{“type”:{“value”:“BuiltinCommonInstructions::CompareNumbers”},“parameters”:[“ThisLowestX”,“>=”,“OtherLeftestX”]},{“type”:{“value”:“BuiltinCommonInstructions::CompareNumbers”},“parameters”:[“NormalizeLeftest”,“>=”,“Isometric_Factor”]}]},{“type”:{“value”:“BuiltinCommonInstructions::And”},“parameters”:,“subInstructions”:[{“type”:{“value”:“BuiltinCommonInstructions::CompareNumbers”},“parameters”:[“ThisLowestX”,“>=”,“OtherRightestX”]},{“type”:{“value”:“BuiltinCommonInstructions::CompareNumbers”},“parameters”:[“NormalizeRightest”,“>=”,“Isometric_Factor”]}]},{“type”:{“value”:“BuiltinCommonInstructions::And”},“parameters”:,“subInstructions”:[{“type”:{“value”:“BuiltinCommonInstructions::CompareNumbers”},“parameters”:[“ThisLowestX”,“<=”,“OtherLeftestX”]},{“type”:{“value”:“BuiltinCommonInstructions::CompareNumbers”},“parameters”:[“NormalizeLeftest”,“<=”,“-Isometric_Factor”]}]},{“type”:{“value”:“BuiltinCommonInstructions::And”},“parameters”:,“subInstructions”:[{“type”:{“value”:“BuiltinCommonInstructions::CompareNumbers”},“parameters”:[“ThisLowestX”,“<=”,“OtherRightestX”]},{“type”:{“value”:“BuiltinCommonInstructions::CompareNumbers”},“parameters”:[“NormalizeRightest”,“<=”,“-Isometric_Factor”]}]}]}],“actions”:[{“type”:{“value”:“SetZOrder”},“parameters”:[“Grp_Isometric_object”,“=”,“ThisZ”]},{“type”:{“value”:“SetNumberVariable”},“parameters”:[“ThisZ”,“=”,“OtherZ”]}],“events”:[{“type”:“BuiltinCommonInstructions::Standard”,“conditions”:,“actions”:[{“type”:{“value”:“DebuggerTools::ConsoleLog”},“parameters”:[“Grp_Isometric_object.ObjectName()+" ("+ToString(Grp_Isometric_object.X())+","+ToString(Grp_Isometric_object.Y())+")"+" changed Z from "+ThisZ+" to "+ToString(Grp_Isometric_object.ZOrder())”,“"info"”,“""”]}]}],“variables”:[{“name”:“ExchangeZ”,“persistentUuid”:“8ede6204-3dcd-49e1-8ba5-dd6cd2e65f4d”,“type”:“number”,“value”:0}]}],“variables”:[{“name”:“OtherLeftestX”,“persistentUuid”:“ae86a3f5-19f0-41d5-b8af-bb3dd6940aee”,“type”:“number”,“value”:0},{“name”:“OtherLeftestY”,“persistentUuid”:“5495aedc-2214-4589-b5da-ab49c93264b4”,“type”:“number”,“value”:0},{“name”:“OtherRightestX”,“persistentUuid”:“f7f953a2-9da7-46e1-a3b9-d3a73e9da83b”,“type”:“number”,“value”:0},{“name”:“OtherRightestY”,“persistentUuid”:“0217c560-02d3-4c25-b487-9de258215ed8”,“type”:“number”,“value”:0},{“name”:“OtherZ”,“persistentUuid”:“99db8a86-e878-453e-b113-56eb49123636”,“type”:“number”,“value”:0},{“name”:“NormalizeRightest”,“persistentUuid”:“90c0db4e-5351-4f10-a033-729e0016305f”,“type”:“number”,“value”:0},{“name”:“NormalizeLeftest”,“persistentUuid”:“6fd7a29d-7c93-46c0-978f-0b03ae2c7636”,“type”:“number”,“value”:0}]}]},{“type”:“BuiltinCommonInstructions::Standard”,“conditions”:,“actions”:[{“type”:{“value”:“DebuggerTools::ConsoleLog”},“parameters”:[“Grp_Isometric_object.ObjectName()+" ("+ToString(Grp_Isometric_object.X())+","+ToString(Grp_Isometric_object.Y())+")"+" changed Z from "+ToString(Grp_Isometric_object.ZOrder())+" to "+ThisZ”,“"info"”,“""”]}]},{“type”:“BuiltinCommonInstructions::Standard”,“conditions”:,“actions”:[{“type”:{“value”:“SetZOrder”},“parameters”:[“Grp_Isometric_object”,“=”,“ThisZ”]}]}],“variables”:[{“name”:“ThisLowestX”,“persistentUuid”:“f426b19a-607b-4dfd-9c2f-4045cd6782a8”,“type”:“number”,“value”:0},{“name”:“ThisLowestY”,“persistentUuid”:“f26a2890-0d98-4aa2-84e9-595e9b9a94c0”,“type”:“number”,“value”:0},{“name”:“ThisZ”,“persistentUuid”:“99db8a86-e878-453e-b113-56eb49123636”,“type”:“number”,“value”:0}]}],“variables”:[{“name”:“Isometric_Factor”,“type”:“number”,“value”:0}]}],“eventsCount”:1,“actionsList”:,“actionsCount”:0,“conditionsList”:,“conditionsCount”:0}}

Looks great - In your other thread you were talking about doing this every frame, but it really only needs to happen at the beginning of the scene and then use something similar with the player as the player moves to determine the the player z order in relation to the furniture and changing that player z rather than the furniture

I am now working on an extension to have this. I come to an existensial questions. If items overlap, what should be the result? Who shall be in front? I was thinking the smaller object, but I may be wrong. Otherwise, a user defined priority, but then it’s heavy.

What’s your mind on this?

So, it took me a while, but I have a draft version of the extension.

Basically the principle is that, the extension calculate and store in a table all relevant data of objects at the start of each cycle. Then once every object have stored the data, at the end of the cycle, the extension goes through the whole table, and check if some object are in the project shadow of the other, and sort them by priority. Later on, each object check the table and get in Z based on the position in the table.

Here for instance the red table project the light red shadow, and if any object have a part of its shape in the shaadow, it is considered behind. The complex case is that if both object are superposed, then the extension calculate the % of each part which is in the projected shadow of the other, and the one with the higher is considered behind. In case both have an equal part in shadow, then the highest is in front.

Configurable behavior:

The reference used for comparison is configurable as per the picture below:

grafik

It is also possible to set an altitude of the object, so that it “fly” over object, and set height so that object flying higher are always in front.

You also need also the second extension which assign unique ID to objects.