[Plugin] Isometric Z ordering based on Y

Post your completed addons to share with the community

Post » Thu Nov 17, 2011 7:21 pm

Update: The plugin is ready. You can download the ZSorter.zip file containing the plugin and the sample project test_iso.zip from:

http://sites.google.com/site/jptarqu/downloads

The plugin has one action ("Sort All Objects in Layer By Y") that you can call every tick. The action will sort all the objects of any kind in the layer that the ZSorter object is in. The objects are "Z sorted" by their Y position; if the Y positions is the same, they are sorted by their X position.

The sample project contains a layout with multiple objects being sorted in a layer. There is also a FPS count to determine how much impact the sorting has as the objects grow in number. I did not notice any impact in my system, but your mileage may vary. The sample also illustrates the technique of detecting collision with shadows instead of of the arpites themselves to allow sprites go "behind" a wall.The sample's walls are too small to notice the difference, but with if you are good at drawing you can make better walls and better shadows.

Please keep in mind that there is more to isometric games than sorting Z positions by Y. You need to take into account shadows (for collision detection), origin points (to allow players to walk behind walls, in the sample the Duck's origin is at the bottom and the wall's is at center) and more. Have fun!!


Thanks
juantar2011-11-18 23:38:05
B
26
S
7
G
3
Posts: 118
Reputation: 4,264

Post » Thu Nov 17, 2011 7:31 pm

Nice idea.
Was hoping this would be doable in C2 if it ever got "for each ordered", like we have in CC.
One thing, even in CC each tick could get bogged down if you had a lot of instances, not sure it would be viable to use it that often in C2.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Thu Nov 17, 2011 11:43 pm

Nice idea + 1

It seems to affect to all instances in a kind of sprite. Maybe it could be a "plugin" better than "behavior", I thought.
In this plugin, at start of layout, setup which kind of sprite will be sorted every tick. It could add some filters to select which instances to be sorted.
rexrainbow2011-11-17 23:45:44
B
97
S
22
G
178
Posts: 4,119
Reputation: 104,045

Post » Fri Nov 18, 2011 11:36 pm

OK, I released the plugin and sample and put the link in the original post.

Thanks!
B
26
S
7
G
3
Posts: 118
Reputation: 4,264

Post » Sat Nov 19, 2011 12:07 am

I'm not an expert, but I think you should change the 'type' to 'object' instead of 'world' in the edittime.js

That way it won't show up in the layout as if it were a visible item.plauk2011-11-19 00:08:12
B
28
S
7
G
7
Posts: 102
Reputation: 6,483

Post » Sun Dec 25, 2011 2:44 am

I check this plugin, and finally understand why ZSort is "world" type, not a "object" type.

It's because that ZSort need to get the layer parameter. If the plugin is "world" type, it must be put in a layer. So ZSort can sort this layer. On the other word, ZSort can not sort other layers.

If you like the ZSort with "object" type. You can try this. It need to indicate the layer number/name.
I change the icon and plugin id, too. The author is still juantar(Juan Pablo Tarquino).rexrainbow2011-12-25 06:28:20
B
97
S
22
G
178
Posts: 4,119
Reputation: 104,045

Post » Sat Jan 21, 2012 11:23 pm

Good job rexrainbow with the "object type" mod!

I have not have too much time to work on Construct, but I am glad the community is improving the plugin.

Like rexrainbow said, the world object allows you to ZSort only the layer that the ZSort object belongs too. All the other layers will not be touched.
B
26
S
7
G
3
Posts: 118
Reputation: 4,264

Post » Sun Feb 12, 2012 4:33 am

This plugin works great for me. I have several objects often swapping positions, this works seamlessly. Thanks for sharing.
B
28
S
9
G
6
Posts: 30
Reputation: 6,609

Post » Mon Mar 26, 2012 12:29 am

Update:

rex_zSorter.7z

- add version to 1.0
- add custom sorting (sample)rexrainbow2012-03-26 00:34:17
B
97
S
22
G
178
Posts: 4,119
Reputation: 104,045

Post » Fri Apr 20, 2012 6:29 pm

Great solutions, I would like know if someday it become official, to be used on Arcade.

Thanks you for sharing your ideas, folks.
ImageImageImageImageImageImage
B
93
S
20
G
12
Posts: 1,211
Reputation: 18,473

Next

Return to Completed Addons

Who is online

Users browsing this forum: jkleffel and 0 guests