How can I load a large tile map with cocos2d?

| | August 5, 2015

I am try to design a cocos2d game with a big world. The world’s tile map is very big, maybe 20 iPad screen sizes worth of tiles.

I want to know how to load this using a CCTMXTiledMap? If I directly add it to screen, will it use too much memory? If so, is there a solution to solve this problem?

One Response to “How can I load a large tile map with cocos2d?”

  1. Although the comments suggest that CCTMXTiledMap will perform poorly under large tile maps, it’s hard to say in general if that is going to be “slow enough” to be a problem for your game.

    So I would advise you to simply try it first, and see if it works for you. If it does, you have a simple solution.

    If it doesn’t, you can usually solve this kind of issue by breaking up a large map into segments and loading those independently, keeping only the segment the player is currently on (and potentially the immediately-adjacent segments) in memory and unloading old ones (and loading up new ones) as the player traverses the map. This is the basic technique used to present large, apparently seamless worlds.

Leave a Reply