I am building a game where the users (players) can build their own town. There they can build houses, add furniture to the houses etc etc. Basically similar to The Sims.

I am using the Tiled Map Editor to create a basis for each town. There I define the following layers

  • ground
  • floor
  • walls and furniture (basically everything)

All these layers are initially empty. It is up to the user to fill them.

I am using cocos2d v2 and its CCTMXTiledMap to render this tile map in my project.

One thing that I realised is that the layers defined in the map, CCTMXLayers, only support images from one tileset (#).

This has led to the following questions that I need to have answered before digging in to some serious game development.

Question 1. This game would be no fun if all my houses had the same walls. I really need numerous different kind of walls in the "walls and furniture" - tileset. How big can a tileset be? Note that I need to store not only different wall-textures here but also textures representing the furniture due to (#).

Question 2. The way you change the tiles in a CCTMXTiledMap is (as far as I know..?) using the setGID method for that particular layer. Going back to the example with different walls. Lets say the player can choose among different walls from a scrolling HUD-Layer menu. When a player selects a certain wall - how do I know which GID that particular wall has (during runtime)?

P.S I am very new to both cocos2d and Tiled so if I have taken the wrong approach here, please tell me what approach I should take in a game like this. I've been looking into Kobold Touch as well - perhaps that better suits my needs?

  • \$\begingroup\$ I assume from your tags that you're developing for iOS therefore the maximum texture size I believe is 2048x2048. Therefore your tileset will be determined by how many tiles you can fit on a texture of this size. \$\endgroup\$ – Nexuz Oct 13 '14 at 15:17
  • \$\begingroup\$ correct iOS. if only one tileset per layer is allowed, how can anyone ever make a dynamic game with cctmxtiledmap? 2048x2048 is not nearly enough to hold all my sprites for the "walls-and-furnitur" layer \$\endgroup\$ – Eyeball Oct 13 '14 at 15:21

Your Answer

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

Browse other questions tagged or ask your own question.