Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have tried using both ways...

  1. adding the .png file on the cache with SpriteFrameCache..
  2. adding .plist with spritebatchnode adding the correspoding .png file, I didnt see any performance difference.

In my test I keep adding and adding objects with the same image.. in this case a bullet... eventually the app crashed because it ran out of memory. Same thing happened to both situations with SpriteFrameCache and SpriteBatchNode they both dropped FPS to 30(when its supposed to be 60) and then just crashes...I understand the scenario is not real.And obviously its destiny its to crash if I just keep adding images without destroying objects that are no longer in use...but the question remains.

I saw the same performance issue, however I read that SpriteBatchNode makes only one draw call making it best performance practice. Has anyone tried and can confirm the performance difference and exactly how can you prove this performance difference in code and in the app?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Check this blog post of "Master" Steffen :).

It seems to be all about OpenGL draw calls and OpenGL state changes of the images and how large the images are and if they have transparency or not.

Try to use several "big" background images in parallax and compare the fps rate with or without batchnode.

Following I report some extracts from Steffen's post as the content of this answer should belong to him :):

On number of draw calls:

it matters a whole lot how much one sprite differs from the previous one and which OpenGL states it changes (cit. Steffen Itterheim, blog post 8th September 2011)

Using 10 large sprites (with lots of transparency, pixel size: 480×320) and not sprite batching the fps rate went down to 15fps (see details of the article) but

Once I enabled sprite batching the framerate went up to 60 fps (cit. Steffen Itterheim, blog post 8th September 2011)

(...) for anyone who is composing their background images of multiple images (eg for parallax scrolling), sprite batching can make a huge difference even if you only have 3 or 4 different background images.(cit. Steffen Itterheim, blog post 8th September 2011)

(...) In fact, it’s the larger images that you will want to draw all from the same texture atlas to improve sprite batching performance. (cit. Steffen Itterheim, blog post 8th September 2011)

Hope it helps

share|improve this answer
1  
Answers need more content than a link. It's impossible to gage its quality, and it might break in the future. Please flesh out your answer, or convert it to a comment. –  Seth Battin Jul 8 '13 at 2:51
    
@SethBattin cool, done. –  mm24 Jul 8 '13 at 9:22
1  
Thanks it helped me out a lot to clear out my mind. So they both have to be used in order to have the FPS running efficiently. Thanks really for the answer. –  Steven Hernandez Jul 11 '13 at 4:56
    
Wellcome, Steffen's post helped me understanding these things few months ago :) –  mm24 Jul 11 '13 at 5:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.