×

Discussion Board

Results 1 to 6 of 6

Thread: FPS

  1. #1
    Registered User
    Join Date
    May 2007
    Posts
    91

    FPS

    Hi,

    Can anyone explain me about FPS and also how it can be calculated for any particular device ?
    I have also surfed this forum along with google it but I can't able to understand clearly

    Please explain me about from scratch and if it is possible then please illustrate it

    Thanks in Advance!

    Amit Yadav

  2. #2
    Super Contributor
    Join Date
    Sep 2008
    Location
    Noida, U.P.
    Posts
    1,330

    Thumbs up Re: FPS

    Hi,
    What is FPS and what are its usages. Why do u require FPS. Please specify that.
    thanks,
    jitu_goldie..

    KEEP TRYING..

  3. #3
    Super Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,556

    Re: FPS

    FPS generally refers to frames per second. Somewhat different considerations whether you're talking about video recording quality vs. video file playback vs. the framerate of, say, a game.

  4. #4
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: FPS

    FPS for a game:

    Most games work by cycling around a loop. Each time around, they update their state and repaint the screen to show the new state. Each repaint is one frame (because it corresponds to a frame of animation). The number of times around that loop each second is the frames per second (FPS).

    The loop looks something like:

    Code:
    while (!endOfGame) {
        updateGameState();
        repaint();
    }
    The time required to execute one iteration of the loop is the frame duration. FPS can be calculated as ( 1 / frameDuration ), where frameDuration is in seconds.

    In practice, you'd measure the frame duration in milliseconds, so FPS becomes ( 1000 / frameDurationMillis ).

    The FPS of a game is affected by:

    1. The performance of the device. Slower device = lower FPS.

    2. What the game is doing. More work = lower FPS.

    FPS can vary during the game, if the amount of work varies. For example, it may drop when more enemies are on the screen.

    Measuring is like this:

    PHP Code:
    public class MyGame extends Canvas implements Runnable {
        private 
    boolean endOfGame false;

        public 
    void run() {
            
    long lastTime System.currentTimeMillis();
            while (!
    endOfGame) {
                
    // do any work to advance the game (process input, etc.)
                
    updateGameState();
                
    // post repaint event to the event queue
                
    repaint();
                
    // make sure the paint event is processed
                
    serviceRepaints();

                
    // compute frame duration
                
    long thisTime System.currentTimeMillis();
                
    int frameDurationMillis = (int) (thisTime lastTime);
                
    // compute FPS
                
    int fps 1000 frameDurationMillis;
                
    // record time for next loop
                
    lastTime thisTime;
            }
        }

        protected 
    void paint(Graphics g) {
            
    // paint game
        
    }

        private 
    void updateGameState() {
            
    // perform game logic
        
    }

    The FPS for a device would be the value when updateGameState() and paint() are empty. This is then the fastest FPS that can be achieved by any game running on that device.

    Hope that helps.

    Cheers,
    Graham.

  5. #5
    Registered User
    Join Date
    May 2007
    Posts
    91

    Thumbs up Re: FPS

    Hello Graham,

    Frankly speaking you gave a very sound answer! Really I am grateful to you. Can you send me your email id then I'll also get further assistance from you. Please don't take it person I am just requesting bcz throughout my career noone explain me like this. G8!!!

    Warm Regards,

    Amit Yadav

  6. #6
    (Retired) Nokia Developer Admin.
    Join Date
    Jan 2006
    Location
    Michigan
    Posts
    4,664

    Re: FPS

    Quote Originally Posted by amit_yadav View Post
    Hello Graham,

    Can you send me your email id then I'll also get further assistance from you.
    Amit Yadav
    Just click on the users name and a pop down menu appears and there is and option to send a private message. The private message is what you want and anonymous. The Discussion board software retains the message online but notifies the user (if he selects) by e-mail of the message. Include your e-mail and leave it to the other person whether to respond that way or remain anonymous.

    Ron
    Last edited by Nokia Ron; 2009-03-26 at 16:18.

Similar Threads

  1. 30 FPS on S40 DP 1.0 device?
    By jonnyw in forum Mobile Java General
    Replies: 11
    Last Post: 2009-01-18, 16:47
  2. How to increase FPS while using DSA?
    By mayur_24 in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2005-10-19, 16:11
  3. fps - n-gage vs. 6600
    By metebalci in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2005-06-03, 07:29
  4. FPS in Nokia 7200
    By wknight_jz in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2004-04-16, 07:07

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×