Hello Guest

Author Topic: Custom renderer for tiles  (Read 4145 times)

limegreen

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 6
    • View Profile
Custom renderer for tiles
« on: September 21, 2017, 04:22:31 pm »
Hi,

Let me first describe what I am trying to do, in case I'm just barking up the wrong tree.  I am working on an isometric game, and have thus far created a tilemap with two layers - one containing ground tiles (so far just the same grass tile) and one containing things like trees and bushes.  It occurs to me that this may already be wrong - perhaps I should be placing that landscape "furniture" as independent sprites instead of as tilemap elements?

Anyway, I now have the problem that any isometric game has - how to handle occlusion of animated characters as they move around things like trees.  I googled around looking for solutions, but the most common one - splitting sprites into a top half and a bottom half, and then making sure that animated characters can't walk paths that would spoil this illusion - seems unsatisfactory, and it would require me to start messing about with paint programs, and that would just end in tears...   :)   Eventually, I found a Unity package that implements a shader-based sprite renderer that supports per-pixel draw order, amongst some other nice stuff like 3D-style lighting.  This is the product: https://forum.unity.com/threads/shiva-2-5d-isometric-engine.486274/

So, I *think* all I need to do is change my tk2d sprites to use this renderer instead of the standard SpriteRenderer, but I can't find a place to do that in SpriteCollection.  Do you think I will be able to integrate this thing with tk2d?

Thanks!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Custom renderer for tiles
« Reply #1 on: October 04, 2017, 11:40:36 pm »
Hi

Apologies for the late reply. A per pixel draw order should work, but I can't really advise about the other asset as I've not used it.

What are your precise requirements? Do you need a char to always draw on top of bg elements, but sort in some fashion with other objects? Are your sprites alpha cutout (no blend?) While i may not be able to advise about other assets, I might be able to give you some ideas on how to implement this.