how many tiles are we allowed to add on a Tile map, using softwares like Tiled , to target mobile devices? Some devices cannot load a texture that exceeds 2048x2048, would you know how a tilemap works and if a limit of size exists?
Thanks
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It only takes a minute to sign up.
Sign up to join this communityhow many tiles are we allowed to add on a Tile map, using softwares like Tiled , to target mobile devices? Some devices cannot load a texture that exceeds 2048x2048, would you know how a tilemap works and if a limit of size exists?
Thanks
The limits are more likely to come from the details of how you render & process the tiles, rather than some universal cutoff number.
If you're "baking" your tilemap to a pre-assembled image, then you'll be limited by the size of that image. For example, if your tiles are 32x32 pixels across, and your device supports textures up to 4096x4096 (eg iPhone 5 or newer), then you're limited to 128x128 tiles in any one image. You can make larger maps by breaking them into 128x128 chunks to render separately, so here your limit is most likely to come from available memory and (if the baking is not done at runtime) download size.
If you're rendering each tile as a separate sprite/image/quad, then you might start to hit draw call limits or bandwidth bottlenecks as you try to draw thousands of them. Batching can help with this dramatically, and should let you draw tens to hundreds of thousands of tiles with good performance.
One of my favourite ways to render large tilemaps is to store a tileset texture and a tile index texture. Each pixel of the index texture points to a particular tile in the tileset, letting a custom shader look up the right tile using texture indirection. This lets us render a very large tilemap (4096 x 4096 tiles on modern phones, over 16 million) as a single quad, and we could again render multiple of these chunks to make a world even larger.
(Though given limited display resolution, you probably won't need to display more tiles than this at a time - once you're zoomed out so far that each tile is just a few pixels on the screen, you'd want to transition to a reduced level of detail version anyway to avoid aliasing)
As always with performance questions, the only way to know for sure on a given device is to actually test it and profile the performance on real hardware. Overall though, I'd suspect that performance won't be the limiting factor in the size of your tiled maps, as long as you're willing to put in the work on a solid chunking and/or batching system of some kind. You'll hit the limit of how many tiles legibly fit on screen first.