2D Toolkit Forum
2D Toolkit => Support => Topic started by: stacktrace on July 16, 2016, 05:56:37 am
-
Is there a recommended max number of layers in a tile map that can be used before performance starts taking a hit? Just a ballpark number, half a dozen, twenty, Fifty, more?
Assuming a tile map roughly 30 x 30.
What have others been able to get to work without problems?
Thanks
-
Hi there,
It depends on how many tiles actually overlap physically more than anything else. Eg. if you have 32 layers drawing on top of each other I would expect performance to be pretty dire. But if you had 32 layers but used them in different parts of the map, i.e. not having actual overlapping tiles all over the place then you'd get away with that no problem.
-
Thanks for the reply. I was thinking of using different layers for tile transitions. Though it is possible for there to be quite a few on a space. In practice there should only be a couple overlaps per tile so sounds like it will work out just fine.
Also because the map is static without colliders, even if it were slow, the cost would only have to be paid once per buildMap call, not every frame if I understand correctly what is going on under the hood
-
Yup, thats correct. Since you don't overlap massively you should be fine at runtime.