fps

Building an FPS in OpenGL: My gun is being clipped agains the frustum

Hi, I'm building a first person shooter using OpenGL, and I'm trying to get a gun model to float in front of the camera. I've ripped a model from Fallout 3 using a resource decompiler (converted to .obj and loaded in). However, this is what it looks like on the screen: Half the gun's triangles are clipped to what appears to be the ...

I can't figure out why this fps counter is inaccurate.

I'm trying to track frames per second in my game. I don't want the fps to show as an average. I want to see how the frame rate is affected when I push keys and add models etc. So I am using a variable to store the current time and previous time, and when they differ by 1 second, then I update the fps. My problem is that it is showing ...

Calculating number of messages per second in a rolling window?

I have messages coming into my program with millisecond resolution (anywhere from zero to a couple hundred messages a millisecond). I'd like to do some analysis. Specifically, I want to maintain multiple rolling windows of the message counts, updated as messages come in. For example, # of messages in last second # of messages in last ...

Android game with constant FPS?

Hi, I'm implementing a game loop with constant FPS. I'm thinking about 25-30 FPS should be enough. Any ideas from your own experience? Should I even restrict FPS at all? Thanks in advance! ...

Timing a method and threads in .NET

I have two threads in my app - the main UI thread and another thread initiated by the wm_WiiMoteChanged event handler (a background thread). In the main thread I do some video processing. I have a function called processFrame shown below. I use that code to measure the time to process each frame and thus the frames per second rate. If I...

How to correctly calculate FPS in XNA?

I wrote a component to display current FPS. The most important part of it is: public override void Update(GameTime gameTime) { elapseTime += (float)gameTime.ElapsedRealTime.TotalSeconds; frameCounter++; if (elapseTime > 1) { FPS = frameCounter; frameCounter = 0; ...

Let system time determine animation speed, not program FPS

I'm writing a card game in ActionScript 3. Each card is represented by an instance of a class extending movieclip exported from Flash CS4 that contains the card graphics and a flip animation. When I want to flip a card I call gotoAndPlay on this movieclip. When the frame rate slows down all animations take longer to finish. It seems Fla...

Accuracy of OpenGL ES Instrument

I'm developing a game for the iPhone. I've decided that 30FPS is plenty so I've written some code that only allows the App to present the render buffer every 1/30 of a second. When I tried to verify this with Instruments I got varying information. On an iPod Touch (2009 edition, 32G) it reports 30 FPS for Core Animation Frames Per Sec...

How to render consistence and smooth moving animation on iphone / ipod / iphone simulator.

I am trying render a simple animation(object movement animations) on iphone. I used opengl for object rendering. Movements appears to be smooth on the simulator. But if I used same code in the ipod, object movement is slower. In the iphone it is still slower. I googled a bit and found 'frame rate independent rendering method', which tau...

Translate Java to Python -- signing strings with PEM certificate files

I'm trying to translate the follow Java into its Python equivalent. // certificate is contents of https://fps.sandbox.amazonaws.com/certs/090909/PKICert.pem // signature is a string that I need to verify. CertificateFactory factory = CertificateFactory.getInstance("X.509"); X509Certificate x509Certificate = (X509Certifi...

Calculate lookat vector from position and Euler angles

I've implemented an FPS style camera, with the camera consisting of a position vector, and Euler angles pitch and yaw (x and y rotations). After setting up the projection matrix, I then translate to camera coordinates by rotating, then translating to the inverse of the camera position: // Load projection matrix glMatrixMode(GL_PROJECTIO...

What are the general strategies for the server of an FPS multiplayer game to update its clients?

A friend and I were having a discussion about how a FPS server updates the clients connected to it. We watched a video of a guy cheating in Battlefield: Bad Company 2 and saw how it highlighted the position of enemies on the screen and it got us thinking. His contention was that the server only updates the client with information that i...

Fullscreen iPhone animation from PNG

Hi, I need in animation of sequence of more PNG files (300 png files and size is 320x480). I've try make it with 12 fps, but sometime iPhone 3g have lags... 3gs working fine. I think 2g working with lags always. I've use one UIImageView and loading images in NStimer callback by UIImage:imageWithContentOfFile. May be this is not best w...

How is frame duration calculated for repeating decimals?

If I have a video that plays at 30fps, then the duration of each frame is 1/30th of a second or 33.333333... milliseconds. Assume you were implementing a video player, how would you handle the fact that the duration of each frame is represented by a repeating decimal? For example, if you truncate the duration of the 1st 29 frames to 33...

frame rate on the iphone using mach_absolute_time

Hi, I have the following code, and wanted to get other set of eyes to make sure I have written the right code to calculate the frame rate of a scene. Could you please chime in? This is written for the iPad using SDK 3.2. thanks! - (void)drawView:(id)sender { mach_timebase_info_data_t timer; mach_timebase_info(&timer); uint64_t t1...

How to tell what's causing slow HTML5 Canvas performance?

How can I tell if the canvas's slow performance is caused by the drawing itself, or the underlying logic that calculates what should be drawn and where? The second part of my question is: how to calculate canvas fps? Here's how I did it, seems logical to me, but I can be absolutely wrong too. Is this the right way to do it? var fps = ...

It's possible to make a program that shows FPS (frame per second) in Python?

I was wondering... It's possible to do it? A simple console command based program that shows how are your FPS, for your currently running game/program? ...

Game Development: How to limit FPS?

Hi, I'm writing a game, and I saw the FPS algorithm doesn't work correctly (when he have to calculate more, he sleeps longer...) So, the question is very simple: how to calculate the sleeptime for having correct FPS? I know how long it took to update the game one frame in microseconds and of course the FPS I want to reach. I'm searchi...

Android 2d canvas game: FPS Jitter problem

I based my game off of the lunar lander demo, although heavily modified, and I can get around 40-50fps but the problem is it fluctuates between 40-50fps so much that it causes the moving graphics to jitter! Its very annoying and makes my game look really shitty when in fact its running at a good frame rate. I tried setting the thread pr...

Testing FPS using Android plugin for Eclipse?

Hi Ive no doubt this question may have been addressed before but how can I turn on a framerate monitor to use when I run my programs using the android emulator so I can see exactly what my android game is achieving at a given time? thanks ...