Isometric depth sorting - need help to improve accuracy

Post your help queries and engine programming questions here

Isometric depth sorting - need help to improve accuracy

Postby robaldred » Mon May 19, 2014 2:07 pm

I'm looking to improve the depth sorting methods.
At the moment, it's flaky when entity bounds overlap.

Screen Shot 2014-05-19 at 13.27.29.png
Screen Shot 2014-05-19 at 13.27.29.png (48.02 KiB) Viewed 12124 times

Screen Shot 2014-05-19 at 14.18.41.png
Screen Shot 2014-05-19 at 14.18.41.png (82.87 KiB) Viewed 12122 times


At the moment my attempts give very odd results.
As you can see from the above, it sorts in correctly when my player entity is left of the centre of the fence.
The bottom face of the 3d aabb, that the player entity is clearly in front of the fence.

As I move the player over the centre of the fence, the sorting flips and everything is fine.

Screen Shot 2014-05-19 at 14.33.25.png
Screen Shot 2014-05-19 at 14.33.25.png (65.6 KiB) Viewed 12110 times

Screen Shot 2014-05-19 at 14.33.12.png
Screen Shot 2014-05-19 at 14.33.12.png (65.71 KiB) Viewed 12110 times


The same happens for my fences that face north south

Screen Shot 2014-05-19 at 14.42.17.png
Screen Shot 2014-05-19 at 14.42.17.png (45.72 KiB) Viewed 12107 times

Screen Shot 2014-05-19 at 14.41.57.png
Screen Shot 2014-05-19 at 14.41.57.png (60.72 KiB) Viewed 12107 times


I have a feeling I may need to make an adjustment to the isBehind method to refer to the 3d AABB rather than just translate alone, the _translate values don't take into account the origin offset, i've applied to the fence.

this.originTo(.5,.8,.5) on the fence
The player is default

I'd really like to be able to to sort by the bottom face of the 3d poly

bottompoly.png
bottompoly.png (54.84 KiB) Viewed 12107 times


Anyone else have anything to share?
I don't work for Irrelon. All comments are my own.
I would strongly encourage anyone building production projects with Isogenic to buy a premium licence, it costs very little and will help towards continued development of the engine. Irrelon have spent thousands of hours developing this wonderful platform with many features found in AAA game engine.
User avatar
robaldred
 
Posts: 243
Joined: Wed Oct 23, 2013 8:09 pm
Location: Manchester, England

Re: Isometric depth sorting - need help to improve accuracy

Postby rob » Mon May 19, 2014 10:02 pm

Hey ya!

So basically what happens is that when objects overlap their bounds the engine reverts to a simpler method for detecting depth because it has no logical way to determine which is "in front" of the other.

The simplest thing I can think of for you to do in this case based on your pic is to set the character's bounds to a very thin pole. That way bounds will not overlap unless the player is basically right on top of the fence etc.
CEO & Lead Developer
Irrelon Software Limited
http://www.isogenicengine.com
User avatar
rob
Site Admin
 
Posts: 316
Joined: Tue Oct 22, 2013 5:08 pm

Re: Isometric depth sorting - need help to improve accuracy

Postby rob » Mon May 19, 2014 10:05 pm

However, that said I see that you've used an origin for the fence... that may affect it, I'm just not sure, it has been a very long time since I played with the depth sorting (it was a nightmare to resolve and once it worked I never wanted to touch it again! lol).

If you adjust the isBehind to take into account origin does that fix the issue? If so I think a patch might be in order...
CEO & Lead Developer
Irrelon Software Limited
http://www.isogenicengine.com
User avatar
rob
Site Admin
 
Posts: 316
Joined: Tue Oct 22, 2013 5:08 pm

Re: Isometric depth sorting - need help to improve accuracy

Postby robaldred » Mon May 19, 2014 11:43 pm

Hey fella thanks for taking the time to reply, appreciate it.

Yeh I tried a few patches to isBehind earlier but it didnt seem to behave how I expected it to, i isolated the specifc entities and tweaked in the debugger, even forcing return false it didnt seem to move in front of the fence.

Will try adjusting the g3d points it uses in the morning to take into account origin. Hopefully that alone or in combination with smaller bounds, I'll get to where I need.

Thanks
I don't work for Irrelon. All comments are my own.
I would strongly encourage anyone building production projects with Isogenic to buy a premium licence, it costs very little and will help towards continued development of the engine. Irrelon have spent thousands of hours developing this wonderful platform with many features found in AAA game engine.
User avatar
robaldred
 
Posts: 243
Joined: Wed Oct 23, 2013 8:09 pm
Location: Manchester, England

Re: Isometric depth sorting - need help to improve accuracy

Postby robaldred » Tue May 20, 2014 10:41 am

Cloning the translation and adding the origin adjustment works!
Patch heading your way.
I don't work for Irrelon. All comments are my own.
I would strongly encourage anyone building production projects with Isogenic to buy a premium licence, it costs very little and will help towards continued development of the engine. Irrelon have spent thousands of hours developing this wonderful platform with many features found in AAA game engine.
User avatar
robaldred
 
Posts: 243
Joined: Wed Oct 23, 2013 8:09 pm
Location: Manchester, England

Re: Isometric depth sorting - need help to improve accuracy

Postby rob » Tue May 20, 2014 11:01 am

Wow cool. Thanks mate. :)
CEO & Lead Developer
Irrelon Software Limited
http://www.isogenicengine.com
User avatar
rob
Site Admin
 
Posts: 316
Joined: Tue Oct 22, 2013 5:08 pm


Return to Help & Questions

Who is online

Users browsing this forum: No registered users and 1 guest
cron