Who has the fastest framerate?
by Bryan Duke · in iTorque 2D · 01/22/2009 (10:35 pm) · 19 replies
I'm really curious. What's the fastest consistent fps anyone is seeing with an iTGB game on their iPhone?
I need my game to run this smoothly:
http://www.youtube.com/watch?v=JQqh8Jns-Pg (not iTGB & yes, it looks just like that on the iPhone - not my game)
Thanks!
I need my game to run this smoothly:
http://www.youtube.com/watch?v=JQqh8Jns-Pg (not iTGB & yes, it looks just like that on the iPhone - not my game)
Thanks!
About the author
#2
01/24/2009 (6:01 am)
I've abandoned my shoot-em-up game as I couldn't get it to run at a playable framerate. I've started on a new game, designed for iPhone (it has very few moving objects and no collisions) and I'm getting a pretty consistant 30fps now. It drops down to 25fps when I turn on a lot of particles. All script, no C components.
#3
Anyone else have any speed comments?
01/24/2009 (7:45 am)
Thanks for the comments. Blue Attack was built using a custom-rolled engine (I talked to the dev about it yesterday). Those will always be faster, but I really need a steady 30fps minimum in my shooter or I won't release it. Users will throw up all kinds of "too slow" reviews if the framerate dips below 30.Anyone else have any speed comments?
#4
If you want decent FPS you really do need to get into the source. I also recommend that you remove as many engine features as you can (provided you're not using them), especially GUI elements.
01/24/2009 (1:49 pm)
I have started working on an iPhone port of the PSK. I managed to get a consistend 20+ FPS with a reasonably complex scene, but I noticed that creating objects on the fly was one of the biggest performance killers (it was sucking up 10-15 FPS for a few seconds).If you want decent FPS you really do need to get into the source. I also recommend that you remove as many engine features as you can (provided you're not using them), especially GUI elements.
#5
01/24/2009 (7:41 pm)
Yes, not using components and working in the sources is no option unless you are writting a small puzzler / memory game or iBrainFart 2D ;)
#6
My game isnt complicated by any means but since starting from scratch in iTGB I havent had any frame rate issues.
01/25/2009 (2:48 am)
Im getting a pretty consistent 40fps in my game, it occasionally drops to the high 20's but not often, according to instruments anyway :)My game isnt complicated by any means but since starting from scratch in iTGB I havent had any frame rate issues.
#7
I have a mimimap on my mainScreen.gui which sucks up about 4-5fps.
The minimap evaluates only once or twice a minute so it's not the calculation. it's just 12 little arrows(12*12pixels) . I have no idea why it's sucking up so much performance.
When I moved the minimap to the scenegraph it didn't have any effect on fps and I gained 4-5fps.
However, mounting the minimap to the camera which constantly move, resulted in jerky motion and I had to get it back to the mainScreen.gui . do you guys have any workaround?
01/25/2009 (9:03 am)
Phillip , I think you are absolutely right about the gui.I have a mimimap on my mainScreen.gui which sucks up about 4-5fps.
The minimap evaluates only once or twice a minute so it's not the calculation. it's just 12 little arrows(12*12pixels) . I have no idea why it's sucking up so much performance.
When I moved the minimap to the scenegraph it didn't have any effect on fps and I gained 4-5fps.
However, mounting the minimap to the camera which constantly move, resulted in jerky motion and I had to get it back to the mainScreen.gui . do you guys have any workaround?
#8
as the iphone performance dies to 15FPS and lower once you pass 30 - 32 distinct objects, it would be a serious overkill.
Have not checked that in iTGB but in the earlier TGB days there was the batched quad system, which would be your primary, first and at best only choice on the iTGB
the rest is nice but guarantees a dead end performance, as the iphone can handle 10'000 polygons pretty well but not 50+ vertex arrays
01/25/2009 (11:24 pm)
Reduce the amount of distinct objects that are created in the scene. I am not 100% sure how iTGB handles that but at worst 12 little arrows = 12 distinct objects.as the iphone performance dies to 15FPS and lower once you pass 30 - 32 distinct objects, it would be a serious overkill.
Have not checked that in iTGB but in the earlier TGB days there was the batched quad system, which would be your primary, first and at best only choice on the iTGB
the rest is nice but guarantees a dead end performance, as the iphone can handle 10'000 polygons pretty well but not 50+ vertex arrays
#9
When I move the minimap from the gui to the scenegraph (and mount it to camera) I gain 4-5 fps. they are just t2dStaticSprites instead of guiBimapCtrl. everything else is the same.
01/26/2009 (8:57 am)
Marc, when you say 12 distinct object, you mean on the GUI? Is the gui so limited?When I move the minimap from the gui to the scenegraph (and mount it to camera) I gain 4-5 fps. they are just t2dStaticSprites instead of guiBimapCtrl. everything else is the same.
#10
01/26/2009 (1:01 pm)
Eyral, I suggest that you create your own GUI class which renders the arrows through GL rendering rather than have X number of seperate objects.
#11
I'm just starting to get familiar with the source code and it's only because of the iPhone frame rate.
I'm gonna look for a game design solution that will eliminate the GUI minimap and use a scenegraph minimap instead. Actually now that both you and Marc confirmed my GUI nightmare, I'm going to avoid using gui elements altogether.
01/26/2009 (3:39 pm)
It's sounds like a great idea, but a bit over the scope of my knowledge :)I'm just starting to get familiar with the source code and it's only because of the iPhone frame rate.
I'm gonna look for a game design solution that will eliminate the GUI minimap and use a scenegraph minimap instead. Actually now that both you and Marc confirmed my GUI nightmare, I'm going to avoid using gui elements altogether.
#12
also those offer much more flexibility like animation and parenting for dynamic GUIs.
I've not yet looked into the GUI related code on the iphone, as I've not really used it.
the only thing I need gui for are options, highscore and matchmaking .. nothing which I would do through iTGB gui at all, thats what cocoa is for.
01/26/2009 (7:31 pm)
That did not mean that I was sure that it creates distinct objects for it (or for each different texture used on it), but the GUI generally isn't the fastest part. It never has been in TGE nor in TGB, which is why there exist those Sprite based button behaviors etc on the wiki :)also those offer much more flexibility like animation and parenting for dynamic GUIs.
I've not yet looked into the GUI related code on the iphone, as I've not really used it.
the only thing I need gui for are options, highscore and matchmaking .. nothing which I would do through iTGB gui at all, thats what cocoa is for.
#13
First startup: 4.5 FPS
Changed loop from incrementing for to decrementing do-while: 7 FPS
Moved all inner components of loop to C++: 10 FPS
Moved entire loop to C++: 18 FPS
Optimized all sync functions: 25 FPS
I've got some more revisions coming. But clearly migrating to C++ yields significant results.
03/17/2009 (11:14 am)
This is an interesting thread, so I thought I'd revive it with my experience pushing the FPS. I'm porting my "mode 7" kart code which requires an additional object rendered in its own fake 3D sceneGraph for every object. It needs a loop to sync the objects -- alternatives didn't work.First startup: 4.5 FPS
Changed loop from incrementing for to decrementing do-while: 7 FPS
Moved all inner components of loop to C++: 10 FPS
Moved entire loop to C++: 18 FPS
Optimized all sync functions: 25 FPS
I've got some more revisions coming. But clearly migrating to C++ yields significant results.
#14
I'm a little lost on how to add text into the sceneGraph to render, or is there a way to hook into the frame rendering to draw on top of the scene using Quartz 2d?
03/18/2009 (8:16 am)
How do you guys do your on screen text without using the GUI? I'm a little lost on how to add text into the sceneGraph to render, or is there a way to hook into the frame rendering to draw on top of the scene using Quartz 2d?
#15
03/18/2009 (10:00 am)
Try using a t2dTextObject, or just making your text into an image(if it's static text).
#16
Where do I go from here? Is there something slow in the engine I could strip out?
03/20/2009 (12:32 pm)
Ok, I'm floating around 22-26 FPS depending on the moment. I know my game is capped by an update loop at 28 FPS. I've pulled stuff out of my (now highly optimized) sync loop and have seen no speedup. I've shrunk art and removed objects -- no speedup. I've taken out every element of the HUD. I am seemingly stuck under 26 FPS, despite the higher cap, with common dips down to 24 and lower.Where do I go from here? Is there something slow in the engine I could strip out?
#17
So no neither you nor the engine does something wrong commonly. (the graphics end has a few flaws that would benefit from optimization but even those won't get you on steady 30 FPS. they will just prevent that tile / particle heavy situations are killing the game totally)
In fact you either are at 10, 15, 20, 30 or 60 FPS due to the VSync bind on the iphone
28 and 25 etc are a result of FPS average calculations.
But that will explain why you will near granted never see anything at 31 or higher
03/20/2009 (5:39 pm)
you won't get any higher than 20-25 FPS on the iphone unless you just do nothing. 30 are possible with a highly specific engine that does exactly what it needs to do and not a single thing more, so in short will not work with iTGB in general as iTGB is a general purpose technology.So no neither you nor the engine does something wrong commonly. (the graphics end has a few flaws that would benefit from optimization but even those won't get you on steady 30 FPS. they will just prevent that tile / particle heavy situations are killing the game totally)
In fact you either are at 10, 15, 20, 30 or 60 FPS due to the VSync bind on the iphone
28 and 25 etc are a result of FPS average calculations.
But that will explain why you will near granted never see anything at 31 or higher
#18
03/20/2009 (8:19 pm)
That's good info mark. You should add the VSync information to the sticky thread.
#19
03/20/2009 (9:22 pm)
Marc, thanks for the info. I'll just move onto the next stage of development then, since I've hit the best performance I'm going to get. :)
Torque 3D Owner Marc Dreamora Schaerer
Gayasoft
the best I got was 21 with behavior shooter ... for some reason the advertised performance gain for 1.1 does not kick in on mine and until that has happened I won't bother porting anything any further