Hello Guest

Author Topic: 2d toolkit and random map  (Read 4486 times)

DJVDJV

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 30
    • View Profile
2d toolkit and random map
« on: May 10, 2015, 11:43:39 am »
Hello,

I have pretty neat random map algorithm to generate random maps that i want use with 2D Toolkit.

I have few question for 2D Toolkit integration for my own code.

1) Can I build maps in code (without drawing in Unity editor by hand). If so. How? Or is there any tutorial about it?
2) My maps can have about 10000 tiles. Is 2d Toolkit optimezed so I can use even so many tiles in a) compute b) mobile devices
What might be max limit for tiles?

Thanks,
DJV

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2d toolkit and random map
« Reply #1 on: May 11, 2015, 12:34:50 am »
Hi,

1. Yes. There isn't any tutorial but the API is pretty straightforward (http://2dtoolkit.com/docs/latest/html/classtk2d_tile_map.html). One thing to note before starting is you should probably start with an empty tilemap in the scene set up the way you want (with the correct sprite collections, etc). Then call the SetTile functions you need, and finish off with Build().

2. Yes, easily. The limit out of the box in the current version is 1024 x 1024. Thats 1048576 tiles. tk2d splits up the tilemap into chunks for rendering efficiency. Max limit depends on what you're doing with them - eg if you have a lot of layers, the limit will be lower vs one layer, and how many are visible at a time. 1k x 1k tiles where each tile is 16x16 is perfectly fine.