Seem like a poor iPad frame rate to me

Previous topic - Next topic

spicypixel

I have decided to create an iPad game and presently I have a texture atlas of 2048x2048 with a fixed sprite size of 128x128 drawn using poly vectors. The resolution is 1024x768 for the game. I am using XCode 3.2.5 with iOS SDK 4.2 and have deployment for iPhone/iPad.

The game draws 8 tile rows and 6 tile columns (48 tiles). With additional tiles being drawn offscreen for edge update when scrolling totalling 76 tiles. My draw loop also checks the collision of the drawn tile within the loop against the player animation frame and this is done in a solid 40fps. However I consider 76 polyvectors very poor to drop below 60fps. I haven't commented out the collision yet but even so I feel 40fps is low.

I have two StartPoly and EndPoly commands with the whole draw loop to allow ALPHAMODE 1 (explosions) and ALPHAMODE -1 (game stuff) although I am using the same texture atlas and not swapping for another.

I am presuming the 2048x2048 texture atlas is the bottleneck but once in memory I would have thought would be ok. Can anyone shed any light on what their results are on the iPad or post code that they have working well in 60fps with a decent amount of PolyVectors.  <-- This would be ideal as I can confirm my iPad FPS against what they have.

Thanks in advance guys if you can help :)
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

Kitty Hello

I found that large textures make the iOS slower, yes. I have no idea why.

bigsofty

What is the colour resolution? try 16bit colour textures.
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

Crivens

What version of GLB are you using? I found my game slowed right down on a retina 4G ipod (30fps instead of 60fps). I went on a rampage of enhancing algorithms and got it smoother (5-10fps smoother), but after I cleaned the project (dustbin on GLB ide) it gave the iOS the latest GLB library and almost magically it is back at 60fps.

One thing I noticed before the project clean was my main object was pretty big and textured with a 512x512 image. Changing the size of the image didn't help, but making the object a lot smaller in dimensions got the fps back to 60. If I zoomed in on the object it still looked as good as when the dimensions were large (is only a textured cuboid), but the FPS stayed at 60fps. I would have changed the whole project to use the new scale (a large pain though) but with the "magic" project clean getting me 60fps again (and on all other devices inc. lower res ios devices and WebOS) I couldn't be bothered mucking around when I could just kick it out the door :)

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

spacefractal

I use 2048x2048 on iPad fine. But I do have 25fps as target (which is nice for this type of game).

I have noticed iPad don't like colored polygons, which have crawed fps to under 20. I have around 500 tiles drawn on some cases, but the tiny font killid it (which I did not use that much anyway, so its tiny issue here).


So don't use the 5 argument with polyvector on iPad, so here I just dedicate the font only been white here.

Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

spicypixel

Well I'm only using RGB(255,255,255) for the PV's. I'm using the latest GLB but have never cleaned the project. The tiles in 8 bit (being old skool pixeller at heart) with 256 colours is no different. I'm gonna do a straight blit loop to post with assets after to compare fps with others. Thanks for the feedback so far ;)
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

bigsofty

Also batching triangle strips may help. The ipad does not have a great pixel fill rate or a very wide data bus I am afraid.
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

spacefractal

Here at me, its was tiny font feature alone that lost wopping 10 fps. I only drawn around 10-20 letters on screen, while I have much much larger tiles drawed (drawed using polyvector from own 512x512 texture).

So I dedicated to remove the 5th argument, and also removed alpha (not on graphics images itself) to make sure its don't slow down (a white here is nowhere a big miss, so dont worry), when I found up what it was happens on iPad here. After that I got my FPS back to normal againm and also could set the graphics detail to full (my game have 3 graphics details for Android users).

I also seen texture swaep between big texture can been costly too, but its could still been the font.

Also collosion check could do that (here I dont use any of them, due its not needed for that game).
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

Qube

Are you talking about the iPad 1?

In my latest game I have texture resolutions of 2048x2048 skybox, space stations are 1024x1024, ships and planets are 512x512 and the overlay 2D images in the HUD and other 2D elements are called from a 2048x2048 image.

On the iPad 2 I get a rock solid 60fps and approx half that on iPad 1. I also noticed that XCode 4 gave a speed boost over the 3 iteration.

spicypixel

Quote from: Qube on 2011-Oct-25
Are you talking about the iPad 1?

In my latest game I have texture resolutions of 2048x2048 skybox, space stations are 1024x1024, ships and planets are 512x512 and the overlay 2D images in the HUD and other 2D elements are called from a 2048x2048 image.

On the iPad 2 I get a rock solid 60fps and approx half that on iPad 1. I also noticed that XCode 4 gave a speed boost over the 3 iteration.

Yep iPad 1, will try out XCode 4 though cheers ;)
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

Falstaff

Are you scaling your display using CREATESCREEN/USESCREEN? I was using an implementation provided by ampos in another thread, which would replace ShowScreen with his sc() function. Although I liked the simplicity of the approach, I found it seemed to cut my frame rate in half.

I'm now just using straight up PolyVector, with the co-ordinates and scaling being done within the individual PolyVector calls themselves. When I did that I found my framerate came back up to a solid 60 fps, on both my iphone 4 *and* my artist's iPad 1. We're currently rendering up to 8x9 (72) animated puzzle pieces in our game board, with additional animated transparent sprites for special fx peppered on top.. and yeah no hit to the framerate on either device other than the occasional 10-20 fps dip which I'm assuming is from multi-tasking.

We also started limiting ourselves to using 1024x1024 instead of 2028x2028 images for our atlas sheets, not sure if that's improving performance.. I've read the iPad can support up to 2028x2028, but we're trying to be accessible to older hardware such as iphone 3g or older android devices.

spicypixel

I was using my own CREATESCREEN/USESCREEN but in the end ripped it out also for speed reasons. Presently I'm blitting 8x6 tiles (128pix X 128pix) with extra edges for scrolling and edge update totalling 76 polyvectors. I was originally using a 2048x2048 texture atlas but have now changed to 1024x1024 so I'm gonna try a new speed test soon.

One thing I will ask is although I was hoping to do all my blocktiles, font (bitmap) and sprites in one texture atlas I will probably have to switch to another atlas for the sprites and font simply due to room. I'm hoping this won't impact too greatly but I won't be doing that until I get the 1024x1024 test done.

Can I ask what XCode you're running as there's mention of a significant speed increase with 4?

Thanks for all the replies.
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

spacefractal

I also split font, hero and tiles atlas too, and its works still nice for iPad with the 2048x2048 tile aslas (I do have 1024x1024 as well 4096x4096 support when needed for highend resoulutions). Howover font did killed FPS here, so it must been in one color when that happens (no big issue really). But just dont swap textures from tiles and font constactly, then you would see a great FPS drop....

You could do support both 1024x1024 and 2048x2048 tile aslas if needed, so iPad and iPhone 4 got nice detailed graphics if you do support for older iPhones.....
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

spicypixel

#13
Quote from: spacefractal on 2011-Oct-25
I also split font, hero and tiles atlas too, and its works still nice for iPad with the 2048x2048 tile aslas (I do have 1024x1024 as well 4096x4096 support when needed for highend resoulutions). Howover font did killed FPS here, so it must been in one color when that happens (no big issue really). But just dont swap textures from tiles and font constactly, then you would see a great FPS drop....

You could do support both 1024x1024 and 2048x2048 tile aslas if needed, so iPad and iPhone 4 got nice detailed graphics if you do support for older iPhones.....

I'm using the font for score and such so would need to swap continually however some numerals and icons to depict time etc would be fine on the first texture atlas alleviating a need to swap so often. Stuff like Level Up or Game Over I'll do as and when needed when speed won't be the issue. ;)
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

Falstaff

Quote from: spicypixel on 2011-Oct-25
Can I ask what XCode you're running as there's mention of a significant speed increase with 4?

I've been using XCode 4.2. I just got my mac mini a week ago so this version is all I've known :)

When I was having framerate issues, I ended up putting code to time every significant part of my code.. that's how I was able to find that SHOWSCREEN was the single slowest part of my program, and I was able to cut down the time it took from 30-40 MS per frame to 6-10