I find TilemapKit very promising. (I think an annual subscription would be a good model, btw.)
I haven't dabbled with neither Cocos2D nor SpriteKit. Both seem to be wrappers around 3D-accelerated drawing. It seems this entails that each TMX map layer is independent from the others. Conversely, there's no layer info per tile (like: what's on Layer Z on this tile?), but tile info per layer (on Layer Z, is there a tile at X/Y?).
That's fine until you want to do something resembling the complexity of some Super Nintendo games instead of Flash games.
What I mean when I say "Faux 3D"
Say I got an orthogonal map. The tile dimensions aren't important; let's say each tile has a dimension of 1x1 (meaning 100%) as reference. Say I got a player sprite which is 1x2, so it's higher.
If I draw sprites above the background layer, everything will look quite okay.
Say I add a foreground layer for things like rooftops of buildings. The player character should be drawn behind them; rooftops visually overlap character sprites. Works quite well, too.
But what if I have an object like a 1x2 throne or large chair: it has a base with which the player collides. It's safe to put this on the background layer so the player overlaps the base when he stands in front of it (one tile down on the Y axis). The upper part, the backrest, should partially hide the player once he moves "behind the throne". So we put it on the foreground layer. This is to create a 3D effect of course.
Now if the player sprite is allowed to come close enough from below, his head will extend above the base on the Y axis. Now the faux 3D effect will work to our disadvantage: it hides the player's top.
→ See mockup image illustrating the problem.
With isometric maps, the problem is even worse. Think Ultima Online.
My intended solution
In a self-made engine, I would do it this way: have Z layers per tile. Draw all tiles from top-left to bottom-right; for each tile, draw each layer. Make is so the player sprites's reference point is at the bottom of his sprite. If he stands "in front of" a chair, he's on a tile below the chair's base and will always be drawn on top, no matter the other layers of the other tiles.
How should this be done with modern frameworks and TilemapKit?
Only thing I came up with:
- never let the player move close enough Y-wise
- create bigger objects so there's more room
What do you suggest we do to solve issues like this?