On Mon, Aug 5, 2013 at 8:28 PM, Arturo Aquino <[email protected]> wrote:
> The tile dimensions are 32x32, the map size is 5056 pixels (not tiles), > this works great. So I have 158 rows and columns of tiles. When I try to > generate a tile map of, 50,560 pixels, the IDE that I use (PyCharm) gives a > memory error. I also tried running with IDLE and receive a memory error > again. The error occurs in cocos tiles.py, line 989, self.i = self.j = i, j > > 2.5 millions of cells. Not sure if a memory error should be expected, but is understandable the idea of divide in smaller chunks. > I do have zooming implemented, but in this case the error occurs right > after the game window opens and it just locks up. The window is white, it > does not get to the point of rendering the map itself. > > Because of this, I was thinking of using multiple tile maps, that are > themselves tiled, and are loaded offscreen dynamically as the player > approaches that layer. > I think that is not directly supported in current cocos: The way that MapLayer.set_view , MapLayer.get_visible_cells, ScrollingManager.set_focus use the tilemap view_x, view_y seems to assume only one tilemap per ScrollableLayer. > Since my tile map is generated procedurally, I can easily change its size > and make them very big. So in order to avoid the memory error, I am looking > for a way to have multiple tile maps in the same scene, side by side, but > only load the maps that are close to my player object. > > Another option is to create / delete the cells that are visible > I should also mention that I am using Pymunk physics, and my code > generates pymunk segments around "solid" tiles of my map. The only other > physics object is my player, which is a simple cube for now. But the memory > error comes from cocos not from pymunk. > > > > > > -- You received this message because you are subscribed to the Google Groups "cocos2d discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/cocos-discuss. For more options, visit https://groups.google.com/groups/opt_out.
