Large Animations crash on iOS

Hello,

I am working on an app that holds many sprite animations, about 15 VERY large ones. The app works fine on various Android devices (Nexus 5, OnePluse and even Galaxy S3), but crashes on iOS.

this is how I have it setup:

* I’ve got a first animation running in a loop in. Its 24 large frames in one sprite sheet that covers the screen.

* I have an additional 15 animation that are very large. Each animation has  3 Sprite sheets images of 20 large images each for a total of 60 frames.

* The animations are located on an external module which returns the correct one.

As I mentioned, the app runs perfectly fine on Android devices, even as old as a GS3. But on my iPad2 and iPad Mini, it’ll stall for a few seconds and then crash with no error, just straight to the home screen.

Wondering which part of my code does that…

An animation on the model looks like this:

function \_M.missLeftBottomSoccerLeftTop (\_callbackFunction) local animationOne local SheetData = { width = 1280, height = 720, numFrames = 20, sheetContentWidth = 5120, sheetContentHeight= 3600 } local animIndex=1 local goalImageSheetOne = graphics.newImageSheet("games/penaltyGame/animations/missLeftBottom\_soccerLeftTop/1.jpg",SheetData) local goalImageSheetTwo = graphics.newImageSheet("games/penaltyGame/animations/missLeftBottom\_soccerLeftTop/2.jpg",SheetData) local goalImageSheetThree = graphics.newImageSheet("games/penaltyGame/animations/missLeftBottom\_soccerLeftTop/3.jpg",SheetData) local goalSequenceDataOne = { { sheet= goalImageSheetOne, name = "one", start = 1, count = 20, time = 800, loopCount = 1 }, { sheet= goalImageSheetTwo, name = "two", start = 1, count = 20, time = 800, loopCount = 1 }, { sheet= goalImageSheetThree, name = "three", start = 1, count = 20, time = 800, loopCount = 1 } } local function mangeAnimations(event) if(event.phase=="ended")then if(animIndex==1)then animIndex=2 animationOne:setSequence( "two" ) animationOne:play() elseif(animIndex==2)then animIndex=3 animationOne:setSequence( "three" ) animationOne:play() elseif(animIndex==3)then animIndex=1 animationOne:pause() \_callbackFunction(true) animationOne:removeSelf() animationOne=nil end end end animationOne = display.newSprite(goalImageSheetOne, goalSequenceDataOne) animationOne:rotate(90) animationOne.x=\_CX animationOne.y=\_CY animationOne:addEventListener( "sprite", mangeAnimations) animationGroup:insert(animationOne) local function startFirstAnim() animationOne:setSequence( "one" ) animationOne:play() end timer.performWithDelay( 400, startFirstAnim ) end

Please help understand this issue…

Thank you

Hi @Mars Interactive,

Well, it might not be the cause, but a sheet width of 5120 seems abnormally large and it might be exceeding the GPU’s texture size limit. Can you try using a sheet size that’s <= 4096 in both width and height and see if the crash still occurs?

Brent

No, that’s not it.

I tested a much smaller animation and no go. I’m thinking it’s not a memory issue since the animations load VERY quickly and smoothly on Galaxy S3.

I also didn’t mentioned, the animations work on the Mac emulator as well.

Just can’t find the specific issue…

Hmmm… can you show me some kind of crash log or similar from the device?

Hi @Mars Interactive,

Well, it might not be the cause, but a sheet width of 5120 seems abnormally large and it might be exceeding the GPU’s texture size limit. Can you try using a sheet size that’s <= 4096 in both width and height and see if the crash still occurs?

Brent

No, that’s not it.

I tested a much smaller animation and no go. I’m thinking it’s not a memory issue since the animations load VERY quickly and smoothly on Galaxy S3.

I also didn’t mentioned, the animations work on the Mac emulator as well.

Just can’t find the specific issue…

Hmmm… can you show me some kind of crash log or similar from the device?