Iphone 5 - 6 plus textureAtlas "bug"?

Hi, i’ve developed puzzle game but QA told me that on Iphone 5 - 6 plus (On chrome browser) weird bug(see image below). I have 3 modes on my game(24,54,98 pieces, and when it’s 24 pieces there is no bug, but when i try to draw 54 and 98 pieces there is this bug) Also i use multitexture batching to optimise the game. I have no device to test it and i would really happy if you can help me with that.
UPD: I manually crop the image that i load from server(I have prerendered images of pieces form and use bitmapdata to draw they on dynamically generated textureAtlas) As i can see on this bug there is only 2 pieces form get rendered correctry (instead of 16). On other devices it’s work good. If you don’t know what’s the problem but you have iphone 5-6 plus and you want to help please send me pm. Thank you

@rich May be you know or saw already similar issues, i know that you really busy, but i’m in despair.

This looks suspiciously like it running out of memory, which is easy to do on a low-spec device like an iPhone 5. How many pieces can you push it to until it starts breaking? (you said 24, but could you get 34 out?) - could you create less textures in memory perhaps? Or small sizes?

2 Likes

Thanks for your reply. When it’s only 24 pieces all is fine. I can’t test 34 pieces cause puzzle aspect ratio 3:2. I scale pieces size when i create new texture atlas(so it’s probably the same size i guess). If this is memory problem i’ll try to reduce image sizes(but lot of them on server side). But my game has 640x960 resolution, and obviously i can’t scale pieces down.
Also i’m afraid, that GC can’t get rid of previous images fast if the problem in out of memory (I remove all links to textureatlases and loaded image, but it takes like 10-30 seconds to clear it up).
But that’s my problem now, thank you again. I’ll check this out and tell the result)

I wonder why new bitmapdata “eat” so many memory(like 16 mb of memory oO)? May be this is the problem on Iphone?
There’s my code:

this._bmpAtlas = this._game.make.bitmapData(2048, 2048);’
for(let i:number = 0; i<this.piecesCount; i++)
{
this._bmpAtlas.draw(pm.pieceImage, x, y);
}

That’d be those 4.1 million pixels (2048x2048) taking up 3 bytes each, plus the overhead of the array buffers and the object itself.

1 Like

Is there a way to dynamically create textureAtlas without bitmapdata canvas? Or i just shouldn’t create textureAtlas and let the drawcall increse happend? Thanks again for your response, i know that is some “noob” questions)

Depends on the situation. If you’re running out of memory, then I would do whatever you can to reduce the amount of dynamic textures in memory, even if that means increasing the draw calls.

1 Like