Size limit while using UICollectionView as tiled map for iOS game?

Posted by Alexander Winn on Game Development See other posts from Game Development or by Alexander Winn
Published on 2014-08-19T21:38:10Z Indexed on 2014/08/19 22:34 UTC
Read the original article Hit count: 363

Filed under:
|
|

I'm working on a turn-based strategy game for iOS, (picture Civilization 2 as a template example), and I'm considering using a UICollectionView as my game map. Each cell would be a tile, and I could use the "didSelectCell" method to handle player interaction with each tile.

Here's my question: I know that UICollectionViewCells are dequeued and reused by the OS, so does that mean that the map could support an effectively infinitely-large map, so long as only a few cells are onscreen at a time? However many cells were onscreen would be held in memory, and obviously the data source would take up some memory, but would my offscreen map be limited to a certain size or could it be enormous so long as the number of cells visible at any one time wasn't too much for the device to handle? Basically, is there any memory weight to offscreen cells, or do only visible cells have any impact?

Also, does a UICollectionView seem like a bad idea for a game map, in a way I haven't thought of yet? It seems like it work well, but I haven't tried it yet so any thoughts are welcome.

© Game Development or respective owner

Related posts about ios

Related posts about tilemap