Hi, i’m now using tileset which contains about 200 different images with different resolution.
Then I placed all the image tile object on my map.So far it runs perfectly until I test the performance.
DC(Draw Call) is 500+… It is not acceptable. Maybe I’ve made some mistake…
My game engine is cocos. It seems that cocos would not pack the image by default.
Thus I think maybe the handy method is packing all the images first with TexturePacker, then import it to the Tileset.
But it failed. I cannot find a support format from TexturePacker to Tiled Editor.
Maybe it would have another way that I could mix-using the tsx file and plist file in cocos.
But it failed either. I don’t know how to replace the image reference in cocos engine…
So, what can I do now to lower my Draw Call ?
Thanks a lot.
Tiled should not need to know about your texture packing. You would use your packed image and metadata in your engine, not in Tiled. The idea behind texture packing is that in your source files (e.g. Tiled maps, sprite animation metadata, etc), you deal with the files as if they were all separate files, but in-engine, you translate those references into atlas references, ideally at load-time. I don’t know if Cocos supports this, that’s something you’d be better off asking in the Cocos community.
If Cocos does not support proper texture atlasing, you may be able to use your atlas image as the source for a “Based on Image” tileset in Tiled, and build your maps with that. My mass replace tiles script can help convert existing maps from the old tilesets to the new one(s). However, this is only really practical if your tiles are all the same size and align to a grid in the atlas image. If they don’t, you’re unfortunately out of luck.
The good news is that Tiled is gradually gaining support for atlases. The Tiled 1.9 Release Candidate supports subsetting for Image Collections, so you might be able to change the image of every tile to your atlas image and then set the subrect to the tile’s location in the atlas. Eventually, a “Tile Atlas” tileset type should be added, which will let you define tiles at arbitrary locations in an atlas image. However, you’d still have to wait for Cocos to support these new Tiled feature before you can use them with Cocos.
I will convert tmx file manually to solve it.