3
\$\begingroup\$

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?

\$\endgroup\$
  • \$\begingroup\$ AS far as I Know the CCTMXTiledMap is not designed for big maps, it 's very slow. \$\endgroup\$ – Raspu Jun 15 '12 at 20:10
  • \$\begingroup\$ Consider breaking your map up into smaller maps that connect with each other. \$\endgroup\$ – dqhendricks Dec 28 '12 at 0:32
1
\$\begingroup\$

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.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.