I’m trying to render a tilemap with 3 different layers.
- terrain (grass, dirt etc)
- objects (bottom part of trees, chest, houses, items etc)
- top (top part of trees, top part of houses)
Rendering is done in this order :
- draw terrain layer
- draw objects layer
- draw character sprites
- draw top layer
Everything works well only if my character sprites are 1 tile in height.
Problem is some characters are bigger and the render becomes messy, especially
with trees.
Here is what I mean (the red rectangle is the character) :
http://image.noelshack.com/fichiers/2016/24/1466340217-tm.png
It’s a custom tilemap system I made to suit my own needs. Each cell is represented in an array of int (tile id).
It’s quite large (10,000x10,000) and some cells are frequently replaced (animated tiles, dynamic tiles),
I don’t know how to fix this without using a derivated Sprite class for cells with z-sorting, but performances are awful.
What are my other options ?