What's your FPS?

Discussion in 'Public Game Developers Forum' started by jlauener, Oct 10, 2012.

  1. jlauener

    jlauener Well-Known Member

    Jul 7, 2011
    48
    0
    0
    What frame per sec do you aim at for your games?

    I do believe it's better to stay at 60fps most of the time. But maybe I'm too optimistic and newb in iPhone dev.

    If I put down my game to 30-40fps by loading the GPU I really see and feel the difference. The game is not fluid anymore. Funny thing is I always though the human eye cannot see more than 24 image per sec. So why is it so noticable even at 40 fps?
     
  2. MarkFromBitmenStudios

    MarkFromBitmenStudios Well-Known Member

    Apr 4, 2011
    133
    0
    16
    IT Architecture, Development Project Manager
    Austria, Europe
    It's hard to troubleshoot this without any details.

    This may be due to temporal aliasing depending on your physics/simulation implementation. Did you fix your timestep in your game simulation? Do you interpolate your rendering between fixed timesteps?

    Or do you even work with a fixed delta time for your simulation? If so, do you understand the implications?

    In some recent Animation WWDC conference, Apple said that everything below 60fps is noticeable but generally, you shouldn't have any issues as long as you stay above 25fps. However, the underlying implementation can make a difference. CPU spikes (you do a complex calculation in one frame) or a overly simple simulation strategy can also have an impact even if you consistently maintain a high (average) fps.

    It's also worth checking out in how far it feels non-fluid. Is it simulation slowing down with the frame rate? Is the movement getting jerky? This helps track down the reason.

    I'm not sure how much experience you bring to the table but since you said you are a newb, maybe it's worthwhile to check out some basics, like Glen Fiedler's article on timesteps. It pretty much explains everything you need to know.

    Following that advice, you may be able to sort out your problems.

    On a different note, make sure you get familiar with Instruments as it can help track down reasons for fps drops and generally identify bottlenecks in your game. There's many instruments in its library for both CPU and GPU profiling.

    There's also another tool in Xcode in some subfolder that helps you analyze whether you are GPU or CPU bound (forgot the name of the tool).

    Good luck!
     
  3. jlauener

    jlauener Well-Known Member

    Jul 7, 2011
    48
    0
    0
    Mark, thanks for this very informative answer!

    Actually I'm trying to implement a glow shader for a 2D game I'm working on. I was using full size texture for the blurring (iPhone4, using 320x480) and this put down the FPS down to like 30. Scaling the texture down 4 times and using 1 pass of blurring is giving good result in terms of performance (steady 60fps) however visually speaking it is not that good (but ok though). Now I'm wondering about retina display and old devices. This is going a bit out of subject but maybe somebody can give me some pointers here. Is glow shader a good idea on mobile or is it wiser to use pre-rendered sprites?

    To go back on the subject I'm using a delta everywhere (graphics+physics). Thanks for pointing me the article I didn't know about the concept of semi fixed timesteps.

    Putting back the full size shader I run my game to look carefully what's not fluid and actually the physics seems fine, objects move correctly and are fluid. The only thing that looks jerky is the moving background (a simple repeated texture) which for the moment is a simple grid (hello placeholder graphics). I think such pattern makes lags/low fps more apparent than with other free moving objects.
     
  4. bluescrn

    bluescrn Well-Known Member

    Dec 1, 2011
    51
    0
    0
    Indie Game Developer
    #4 bluescrn, Oct 11, 2012
    Last edited: Oct 11, 2012
    I always aim for 60fps, it makes an immense difference to the feel of a game.

    But how achieveable it is depends massively on the device...

    The iPad 1 and iPhone 4 are by far the hardest to keep the framerate up on - lots of pixels and a comparitively weak GPU.

    For our first game, Little Acorns, we managed to get it running at 60fps on everything 3GS and above (a bit of slowdown on iPad 1 though). 60fps is essential to make a 2D scrolling platformer feel good. While the game did support older devices, it was a fair bit slower, and didn't feel nearly as good.

    For my new project, Skyriders, performance has been much more of a challenge. It's locked to 30fps on 3GS/iPad1, but manages 60fps most of the time on an iPhone 4, and on newer devices, it does a solid 60 with antialiasing too.

    Basically, on iPhone4/iPad1, you can't use pixel shaders if you want to run at 60fps. They just cost too much. And you've got to be very careful with how much alpha blending you use. Vertex shaders are fairly OK, though.

    Both games use variable timesteps, so they can handle more varied framerates if needed (e.g. on PC or Android), and if the timestep gets much bigger than 1/60th of a second, I start to do two or more updates per render, to avoid an update with a large timestep, which could potentially start to cause collision/physics bugs.

    We're getting closer to the point where iPhone4/iPad1 can be considered 'old, low-spec devices', though - and if we're targetting primarily iPhone4S/iPad2 and above, there's a lot more potential for shadery fun whilst maintaining a good framerate!

    Once nice little trick I used - I wanted to render the game, blurred, underneath the pause menu. Blurring it every frame would be very expensive, so I just rendered a single blurred frame to a texture, once, when the pause button is pressed - then can just draw that as the background behind my menus.
     
  5. antireality

    antireality Member

    Mar 11, 2011
    19
    0
    0
    graphics driver monkey
    Kingston Upon Thames, UK
    #5 antireality, Oct 11, 2012
    Last edited: Oct 11, 2012
    Generally a constant framerate is more important than a higher one - a solid 30fps will look smoother than hitting 60 most of the time and stuttering occasionally.

    Do 30 if you think more detail and a busier world is worth the payoff, but try to keep it locked if possible.

    I'd have thought that shaders would be fine on an iphone 4 if written carefully and following IMGs guidelines - after all, fixed-function is pretty much just a pre-rolled shader anyway these days...
     
  6. seventh

    seventh Active Member

    May 26, 2009
    35
    0
    0
    Game developer
    Tampere, Finland
    I have to agree. For our first game (Shardlands), we capped the framerate to 30 for all devices. Games where framerate varies between 30 and 60 don't feel right to me. We plan on making our next game solid 60fps on newer devices (iPhone 4S, iPad 2 and up), which requires some changes to our visual style.

    About using fragment shaders on the low performance-per-pixel devices (iPhone 4, iPod touch 4G and iPad 1), I'd definitely write my own instead of using the fixed pipeline. Your own implementation can't be slower than the generic fixed pipeline approach, if you know what you're doing. Plus you have more room to play with and even add effects that are not possible with the fixed pipeline. Of course, if your shader just passes a single texture color to output, it shouldn't matter if you're using a shader or not.
     
  7. jlauener

    jlauener Well-Known Member

    Jul 7, 2011
    48
    0
    0
    That's the semi-fixed timestamp approach described in the article linked by Mark right?

    Fixing the FPS to 30 is a neat idea, will try that just to see if I feel a difference.

    In fact with OpenGL ES 2.0 you always use vertex and fragment shader as there is no 'default function'. So full screen fragment shader is completly feasible but if kept very simple though.

    http://developer.apple.com/library/ios/#documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/BestPracticesforShaders/BestPracticesforShaders.html#//apple_ref/doc/uid/TP40008793-CH7-SW3

    In Apple's guideline they say to avoid dynamic texture lookups which might be the main reason why a blur shader performs so poorly. Indeed each pixel requires 18 dynamic lookups (9 vertical, 9 horizontal)!
     
  8. seventh

    seventh Active Member

    May 26, 2009
    35
    0
    0
    Game developer
    Tampere, Finland
    I'd think 18 texture lookups per pixel is pretty overkill for any current iOS device :) If you are willing to give up some visual quality or make the blur filter smaller, you can calculate up to 8 texture coordinates in the vertex shader, pass them as separate varying parameters and this way avoid the dependent texture reads.
     
  9. Why does everyone mention 60 fps as an upper limit? Can you go higher than this framerate?
     
  10. seventh

    seventh Active Member

    May 26, 2009
    35
    0
    0
    Game developer
    Tampere, Finland
    Nope, Apple has fixed the screen refresh rate to 60Hz for all devices.
     
  11. Zenout

    Zenout Well-Known Member

    On slower devices (iPhone 3GS / iPad 1), locking fps to 30 is essential. While on faster devices (iPad 2, iPhone 4S) then 60 is relatively easy to achieve and no restrictions are needed there.
     
  12. Hercule

    Hercule Well-Known Member

    Dec 16, 2010
    240
    0
    0
    #12 Hercule, Oct 12, 2012
    Last edited: Oct 12, 2012
    Yes 60 fps is better than 30fps. But don't target blindly 60fps.
    In 30fps you have twice the power than 30fps. Twice FX, twice sprite..
    Is it better for the player to have a 30fps which is smooth, and a lot more nicer arts?

    There is also a question on the type of game.
    A chess game at 60fps, what the point of this ??
    If your game don't have fast moving object, don't bother with the 60fps.

    You have a CPU and a GPU power budget, don't spend them on something that will just enchanced "a little" the player experience.

    Focus yourself on the player experience!
    60fps or top notch Fx and graph ?
     
  13. Zenout

    Zenout Well-Known Member

    That is another way of looking at it. But for my new game I wanted to retain the same final image rather than drop effects! So fps took the hit on old devices rather than have different LODs for each device. A locked-30 is perfect for most games but 60 is always nicer in a fast game.
     
  14. Zenout

    Zenout Well-Known Member

    Reading that back we have the same sounding point! To design around the faster devices while not losing out on the slower ones.

    The old LCD response times are not necessarily smooth anyway.
     

Share This Page