As for the “base” tilemap.
Yeah, you’ll want the base map to have your maximum size so that it parses in and you can set any tile’s GID without worrying about how to change a given map/layer’s size.
And anything smaller than, I believe, 75x75 per layer should be fine. It’s an OpenGL limit we’ve discussed somewhere around here before based on some combo of tile rows+columns+layers and 128x128 rings a bell as too large for the cocos2d-x’s parser. There’s two issues. The OpenGL vertex limit per draw call so now that I think about that it’s likely a given layer can’t have more than 128x128 (or some combo of R x C that matches total number of quads). The second issue would occur if the tile GID unique number overflowed being a 32-bit integer … and the top 3 bits are the flip flags, so it’s more like 2^29 limit.
Anyway, there are limits, but for smaller map sizes you should be totally fine. And you can always stitch them together if that makes sense.
For collisions and other meta-data I tend to prefer parsing that into my own custom array(s) such that the TMXTiledMap is only used for the rendering.
Note: The rest of this may be of no interest or use.
(figure maybe someone find use, otherwise my personal reference to come back to)
I experimented with chunking and using multiple map instances to make larger maps, but really if you need to render larger than say 50x50x5layers or 100x100x2layers at any given moment you should probably write your own tile map renderer.
If you need larger maps you could also checkout Kobold’s TilemapKit … maybe find Steffen and ask for a copy of the source now that it’s been abandoned. He was supporting ‘infinite’ tilemaps and lighting, among other things.
http://tilemapkit.com/discontinued-projects/ (tile map stuff not in sources, afaict)
Here’s the source I paid him early bird price for, to support as I never really planned to use it until it was finished.
I don’t believe the source is accessible, but I think I may have backed up a copy if you were interested we could ask him to grant license to use.
I’ve also done chunking in Unity where I also created the mesh+vertices manually … I think I threw that up on github.
Sorry for the lengthy post, but I’ve been researching/studying/hacking on tile maps for most of game dev career. I should’ve probably made an awesome renderer and editor by now, but meh I’m too lazy for that, heh.
Unity chunked tilemap sample testing prototype.
As always, probably better solutions, code, etc out there.
Speaking of … apparently I’ve had ambition to improve cocos2d-x’s tilemap, but never got around
(nothing in this repo, sadly)