Hello Guest

Author Topic: Max number of tile map layers  (Read 3931 times)

stacktrace

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 10
    • View Profile
Max number of tile map layers
« 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

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Max number of tile map layers
« Reply #1 on: July 27, 2016, 11:19:24 pm »
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.

stacktrace

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Max number of tile map layers
« Reply #2 on: August 04, 2016, 02:30:10 am »
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

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Max number of tile map layers
« Reply #3 on: August 05, 2016, 09:23:27 am »
Yup, thats correct. Since you don't overlap massively you should be fine at runtime.