# Trouble with pseudo Z axis

### » Wed Oct 29, 2008 9:37 am

They were having trouble with draw order for their isometric engine. The solution they came up with was something like this:

Set the draw order for each object to (Y increment*100)+(Z increment). Then draw each object according to it's draw order.

So if there's a block at Row 2, Z 1 then it's draw order would be 201. And if there were a block at Row 2, Z 2 then it's draw order would be 202, and since it's higher it gets drawn on top.

So if I'm understanding this right (and I might not be ), all you'd need at that point is:

[code:3hzea7lc]
+Family.Z
-Set value('draworder') to (Y*100)+Z

+For each Family Z ordered by value('draworder') Ascending
-Bring to front
[/code:3hzea7lc]

Just one little loop

This will apparently only work with single-unit blocks, so the large block you have will have to be chopped up into smaller blocks that are treated as individuals (but you could easily disguise that with clever tiling).
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

### » Wed Oct 29, 2008 9:57 am

First of all, thanks heaps for still trying to help
It's a great idea too, actually kinda similar to what i had but alas, it's still not working
Most likely because i'm not using a cell type system, i'm using Y coordinates and my Z height is another set of pixels, although i suppose the principle is the same.
In any case, i really think that ordering by multiple criteria, similar to the way databases work, would be the answer
Unless there's something i'm doing wrong
wah
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

### » Wed Oct 29, 2008 5:12 pm

Oh well

I got excited there for a second though.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

### » Thu Oct 30, 2008 8:04 am

Yeah same

Or at least try it out and see if it works before adding it, i really think it would be a good idea, i'm sure there's plenty of situations where this would be really handy, especially since people will want to use construct for making isometric games, and i believe this fixes one of the main problems for iso Z sorting in ONE event
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

### » Thu Oct 30, 2008 11:22 pm

Ok, after a bit of thinking about that cell type system, i realised my current sorting was only half the equation

i was doing this:
For each Layers ordered by Layers.Y + Layers.Value('ZHeightBottom')

Which, in a cell based setup, does the first half of the equation, finding where the object is on the row. BUT if you only have this, it treats everything as though there's only ONE row. So i expanded on it and did this:
For each Layers ordered by (Layers.Y + Layers.Value('ZHeightBottom')) + Layers.Value('ZHeightBottom')

EDIT: Although come to think of it, that's essentially the same as the solution that David gave me earlier At least I understand the logic behind it now, but it's still not working 100%

This now tells the game where on the 'row' it is, but then also which row it is on!
Now it's working a lot better!! But i still have a few bugs, i'll upload a cap.

[url:2af3z93y]http://www.mediafire.com/?zivnhzkykgm[/url:2af3z93y]
Try standing at the base of the tower and jumping, also try standing behind a big box and jumping
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

Previous