[Plugin] Isometric Z ordering based on Y

0 favourites
From the Asset Store
Hand-animated Sprite Base for isometric game/animation development
  • 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

  • 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.

  • 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.

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

    Thanks!

  • 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.

  • 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).

  • 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.

  • This plugin works great for me. I have several objects often swapping positions, this works seamlessly. Thanks for sharing.

  • Update:

    rex_zSorter.7z

    • add version to 1.0
    • add custom sorting (sample)
  • Great solutions, I would like know if someday it become official, to be used on Arcade.

    Thanks you for sharing your ideas, folks.

  • For some reason when i add the object and run the layout nothing shows up. Just a grey screen.

    edit:

    For whatever reason my text object still shows up, but dissapears when i move it down the screen.

    Edit:

    I got it working. I moved the zsorter object out of the layout.

  • Just to be clear here... C2 has it now build in right?

    I mean the For each(ordered) is pretty much the same?

  • Schoening yes, that is my understanding. I have not played around with the For each(ordered) condition, but it should do the job.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thx for the Reply ^^

    Btw.. Is only javascript needed for socket.io ?

  • Schoening thank you very much for the hint with "for each (ordered)" !!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)