Jump to content

Panda ios memory problem


mrkarate
 Share

Recommended Posts

hi!, I just have a weird problem, and just on ios (I think android gave more memory to browser resources).

 

I have a dinamic game, with a dinamic map, so I generate a tileset of 26x25 tiles (100x100 each tile), and then  I tried two things:

that container, I convert to cache as bitmap, and when the player got to the final of that tileset, I cacheasbitmap = false the container, remove all sprites, and then add a new tileset (but from same tileset family, only change order, and all tileset are added on start), and make cacheasbitmap again, the other method I use, is instead of cacheasbitmap that tileset container, I add tileset too, but use the generateTexture() method, and to delete it, I use texture.destroy() method.

 

The two methods works, I have 1 draw call per tileset instead of 400, so thats very nice. THE PROBLEM!!, is, no matter what I do, on ios, (on iphone 6 plus!! so it's not a limited ios device), when I generate, the 6 or the 7 tileset, the browser crash and restart,

and I already check and have sure is this method that crash, because I try to only generate 5 of this segments of tileset, and then no generate more, only move on the last one, and the game don't crash, so I think, whatever I do, removing this sprites, or destroy the texture, I think the engine doesn't really remove from memory, have someone this problem before??

 

really thanks!

 

Link to comment
Share on other sites

well... finally can't find a solution, every time I make a generateTexture or cacheAsBitmap, it's like memory never release, so finally the game will crash (on mobile, obiosly), no matter what what thing I do to delete cache, texture, memory etc... so finally I create a method to culling my tiles, yes, this will generate more draw calls than use only one big sprite, but, incredibble, my performance it's not worst, I think maybe a little, but no more 1-3 fps less, and this way, my game never crash, always use same memory,

 

Still don't know why the hell the are generateTexture and cacheAsBitmap methods, if you can't use them n times??, maybe you need to unload all cache memory? (but this means reset all your game),

really don't understand it, hope someone can explain it.

 

thanks!

Link to comment
Share on other sites

yes, I already do that, as I commented it (sorry if I wrote like shit haha, my english it's not good), but I try to delete the baseTexture and the texture, with destroy, using generateTexure, and using cacheasBitmap too, with generateTexture, I see how the sprite using that texture, becoming a black square, so I see how the baseTexture is deleting, then asign null to that texture, with cacheAsBitmap, I, try to set to null, all sprites become again, (no longer a bitmap), and remove every one, but after 6 or 8 times of generate this textures the browser crash (it's same effect If I generate this textures at same time, it's for this I can be sure this bitmaps don't remove from memory, no mather what destroy or other method I use.

 

I can check too, it's not a ios problem, on android too, but android has a lot memory assigned to the browser ( on android I can generate about 15-20 of this textures), so really can't do more,

 

You can check my game right?, I generate a long tile base divided maps before, now I use every tile as a single draw call, but with a smart culling control, so the performance I gained using a single bitmap, is equally to now, instead of the extra draw calls.

 

 

thanks!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...