Isometric Z ordering?

Get help using Construct 2

Post » Sun Jul 03, 2016 8:12 am

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
B
4
S
1
Posts: 9
Reputation: 918

Post » Sun Jul 03, 2016 11:48 am

Did you try rexrainbow 's Z sorter ? (also takes X in acccount)
http://c2rexplugins.weebly.com/rex_zsorter.html
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Sun Jul 03, 2016 1:09 pm

Ah this looks really useful... thank you for pointing it out!
B
4
S
1
Posts: 9
Reputation: 918

Post » Sun Jul 03, 2016 1:19 pm

The editor just had an update that adds that ability.
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.

Image
Last edited by newt on Mon Jul 04, 2016 11:46 am, edited 1 time in total.
Image ImageImage
B
169
S
50
G
173
Posts: 8,313
Reputation: 110,270

Post » Sun Jul 03, 2016 2:42 pm

B
21
S
8
G
6
Posts: 177
Reputation: 8,134

Post » Mon Jul 04, 2016 9:30 am

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?

Image
B
4
S
1
Posts: 9
Reputation: 918

Post » Mon Jul 04, 2016 10:29 am

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

https://drive.google.com/open?id=0B1SSu ... GVwSTZub0E

Althaugt this is not the full solution, i think this is the direction.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Mon Jul 04, 2016 10:38 am

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.
Follow my progress on Twitter
or in this thread Archer Devlog
B
40
S
17
G
17
Posts: 977
Reputation: 12,626

Post » Mon Jul 04, 2016 1:52 pm

99Instances2Go wrote:Think you have to break the building up in differend sprites like this:

https://drive.google.com/open?id=0B1SSu ... GVwSTZub0E

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.
B
4
S
1
Posts: 9
Reputation: 918

Post » Mon Jul 04, 2016 1:53 pm

@tunepunk Is there somewhere I can see your game in action?
B
4
S
1
Posts: 9
Reputation: 918

Next

Return to How do I....?

Who is online

Users browsing this forum: adventurist and 34 guests