Background affecting frame rate
QuinnZoneStudios
Member Posts: 452
Hey once again Saladeers,
Glad to see all the success being had on the iPad front. You are all brave pioneers
Anyway I was wondering what people had discovered regarding backgrounds. I have a wide scene that's 320 x 8000. With the just the score HUD and character in I get around 50fps testing on the GS viewer for 3G iPhone.
With a 480 x 320 png-8 web optimized non moving background it drops to just under 30 fps. That's around a 20 frames per second difference. With all my playable elements in there it drops to around 27 fps with the background (44 FPS without), enough to notice the difference when playing on the actual 3G iPhone.
I'm assuming there's not much else can be done, other than having a simple, smaller background? Halving in size to 240 x 160 an double sizing it back up in game could look pretty bad though I guess but I'll take a look for giggles.
I was just amazed that an optimized screen size background would chew up 20 FPS. I wonder if anyone else has encountered or solved this issue?
Thanks and happy Wednesday!
Glad to see all the success being had on the iPad front. You are all brave pioneers
Anyway I was wondering what people had discovered regarding backgrounds. I have a wide scene that's 320 x 8000. With the just the score HUD and character in I get around 50fps testing on the GS viewer for 3G iPhone.
With a 480 x 320 png-8 web optimized non moving background it drops to just under 30 fps. That's around a 20 frames per second difference. With all my playable elements in there it drops to around 27 fps with the background (44 FPS without), enough to notice the difference when playing on the actual 3G iPhone.
I'm assuming there's not much else can be done, other than having a simple, smaller background? Halving in size to 240 x 160 an double sizing it back up in game could look pretty bad though I guess but I'll take a look for giggles.
I was just amazed that an optimized screen size background would chew up 20 FPS. I wonder if anyone else has encountered or solved this issue?
Thanks and happy Wednesday!
Comments
Guess I'll have to not have much background. I hope this isn't the case on the iPad. Won't be easy to know just yet as the simulator is running slow it seems.
_______________
Tickle Stones http://itunes.apple.com/us/app/tickle-stones/id363484260?mt=8
Food Fight! (free) http://itunes.apple.com/us/app/food-fight/id352646643?mt=8
Unless you define a rule that does such a thing, this is simply not true :O
Mine is 480x320 also. I don't think it has anything to do with your scene size, as my scene is set to the exact size of the background. Would be nice to know if there is something we have missed. As we seem to be the only ones having this issue lol.
I even tried a smaller background and scaled it up but I still had similar results (except that it looked like hell) so it must be the fact that it still has to fill and render the space pixel for pixel.
So either I have to live with it or redo all my backgrounds as little minimalist actors. Be a shame to give up the iPhone iPod market just because of this.
I've got a project based on CodeMonkeys joystick thingy.
If you look at that demo, you can see that in the 'two sticks, large area' part, the background is made up of 1 tile of 31x31 that's repeated over and over somehow. It *appears* to use just this one tile and runs pretty well.
If you had a 'ground' background using the above method, you could possibly add 'landmarks' to your level as separate actors.
Make sense?
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
On a related to your issue:
I just removed the faded galaxies background from StarKeep gameplay scenes and only got a frame or two per second boost. It was 512x512 and I would randomly rotate it per scene to vary up the galaxy positions.
@Adado that's strange that such a large image only made your game drop a few frames a second mmm. I will have to do a few more tests when exporting the image from Gimp. I am sure I have not enabled transparency also but I will have a look,
thanks.
It is an 8-bit .png, with no transparency, compressed down as good as I could make it.
When I initially made the game, it didn't have a background - or any artwork. But when I added them, I certainly didn't notice a horrendous frame drop...
The biggest issue I'm noticing when playing back on my 3G is more to do with how many actors/rules are being juggled. Watching the viewer it seems a frame rate close-ish to 25-30 FPS isn't that noticeable but when I have too many props with physics it stutters quite badly, even though the frame rate is still showing close to 25 FPS.
I think my answer is to make shorter levels and find a balance between game play and processing. Tests and more tests is the way to go.
Should be a happy medium somewhere.... or at least a miserable extra large - lol!
This follows the "power of 2" rule that images use. Each image is allotted a space in memory to hold it. It is always a power of 2. So your 480x320 image actually requires a 512x512 chunk of memory to hold it.
If you want to send me your image, I can check if it is compressed as much as possible. joe at firemaplegames dot com
I just sent the image back to you...
Your image was a 24-bit .png and it was 143Kb
I saved it out as 8-bit, since it doesn't need transparency.
It is now 49Kb
Thanks for the help its appreciated.