Isometric Z ordering?

0 favourites
• 15 posts
From the Asset Store
Build your map with these isometric objects and terrains
• Hey Guys,

I'm making quite an ambitious isometric game and It's going great, but I can't seem to get the Z order to work right.

I order the objects based on a Y axis that can differ from their actual Y position in the layout due to the addition of a Z axis. This means objects that should be in front or behind a land-form end up in the wrong place sometimes. Originally I had objects and terrain split across layers but that was a lot of effort.

I've tried R0j0Hound's isometric plugin but it only works in 2:1 and only with diagonal facing blocks.

Does anyone know how I could get this sort of thing to work? I've tried so many things but I'm not that good with the more technical side of construct 2 :/ I've already got a good system for wall and floor collisions in the actual game, it's just the Z order that's the problem.

This is the capx where I was trying to workshop a good system for sorting out the objects' Z order:

https://www.dropbox.com/s/iced7fypx1mw9gl/Top%20down%20Z%20ordering.capx?dl=0

• Did you try rexrainbow 's Z sorter ? (also takes X in acccount)

http://c2rexplugins.weebly.com/rex_zsorter.html

• Ah this looks really useful... thank you for pointing it out!

Just stick all objects that need to be z ordered into a family, then create a family variable, and make an every tick event that puts the family y into that variable.

Then add another action in the same event to set the z. Its under System> Sort Z order.

• I'm still having issues. The image below is a diagram of the problem I'm facing.

Objects in the game are sorted based on their Y axis so that the lowest objects appear in front. The end of each white arrow shows the objects' location on the Y axis. The character on top of the block is placed furthest back on the Y axis which means he should be at the back but I want him to appear on top of the block, like he does in the image below.

This means that some kind of sorting will have to be applied to objects on the Z axis but I can't think of anyway to do this without screwing up the order of everything else... is this is even possible?

• Think you have to break the building up in differend sprites like this:

Althaugt this is not the full solution, i think this is the direction.

• You add a variable (elevation) to any objects that are supposed to be elevetad above something. Just sort like in newt example but set the ytoz value to Y+elevation. The height should be the distance to the ground, (as if the sprite was at ground level) then the sorting will be correct. I'm using something similar in my project.

• Think you have to break the building up in differend sprites like this:

Althaugt this is not the full solution, i think this is the direction.

Thanks, I think I'll have to do this sort of thing even though it will mean a lot more work.

• Try Construct 3

Develop games in your browser. Powerful, performant & highly capable.

Construct 3 users don't see these ads
• tunepunk Is there somewhere I can see your game in action?

• tunepunk Is there somewhere I can see your game in action?

It's based on touch so you need to try on a mobile phone or tablet.

The arrows are using the "elevation" variable, so that they will sort correctly when they stick on walls etc, and can fly over certain things correctly.

• I absolutely love those pure & clean graphics and animations.

• I absolutely love those pure & clean graphics and animations.

It works like this.

everything is sorted by Y right? So anything with lower y will be behind and higher y will be in front. For the character on top to appear in front of the sprite you cant sort by only y. His y is lower so will look like he is behind and not on top. but if you sort by y + elevation. his new sorting point will actually have a higher value than the tower so he will appear infront (on top) instead.

• Did you try rexrainbow 's Z sorter ? (also takes X in acccount)

http://c2rexplugins.weebly.com/rex_zsorter.html

Clearly, I need to use this. I have been manually sorting, lol.

• tunepunk, dude, i am still impressed with your game. And i still can't figure out how to make that character jump&hide based on elevation. That will basecaly be a 2.5D platform. This thing hangs as a pittbull on my ass now. But i will get there. To avoid confusion: i am not the topic starter.

• 15 posts