Hello Guest

Author Topic: Tile maps loading.  (Read 3164 times)

Panek

  • Newbie
  • *
  • Posts: 1
    • View Profile
Tile maps loading.
« on: March 20, 2014, 09:04:49 am »
Is there a quick way to create levels?

Let's say I have a level consisting of 6k tiles, wants the same stage to create different levels of the same amount of tiles.

I'm using. SetTiles (x, y, 0) and after that. Build (), but it takes an awfully long time for mobile (~ 15SM, the Galaxy S3).

Is there a way to shorten it? I do not need colliders.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tile maps loading.
« Reply #1 on: March 20, 2014, 11:33:34 am »
Turn off colliders in the layer.
6k tiles in one axis will be slow to generate, so you probably will want to split it up into multiple smaller tile maps, and only generate the visible ones at a time. Similarly, you can do the same with the tile map, by SetTile(x,y) one partition at a time and call Build incrementally over a few frames.

If that is too slow for you, you can still do some additional stuff with a static sprite batcher, but I think it'll be possible to amortise the cost over a few frames.