Nowadays I’m developing a game tilemap based and I have encountered a problem with big maps ‘.tmx’ (I am creating the maps with Tiled).
I discovered that if the map is very big cannot be displayed, but it is loaded (I am detecting collisions, etc).
What is the number of tiles that can be displayed (if helps, the tile is 32x32px)?
What do you suggest me to avoid this problem? Maybe smaller tilemaps? Or I can load the same tilemap and display it by steps?
The tile size doesn’t matter, it’s the number of actual tiles drawn. You could probably have something like a map with dimensions 1024x16 and that would render fine. It’s something like a 65k vertex attribute limit I think and it’s only for visible or drawn tiles.
If the TMX layer were to render all tiles as individual Sprites and not as SpriteBatch this limit probably wouldn’t exist, but having them all in a single render command is of course more performant. The experimental TMX layer tries to render rows of tiles and culls any outside the camera view which should allow larger maps as long as the portion inside the camera view is limited to the max verts.
Hello,
I have the same issue with cocos creator. I have made one big map and only a part of tiles are rendered.
Why Cocos Creator doesn’t culling tiles offscreen?