frame rate

Posted By: westray

frame rate - 05/10/06 06:33

Why is it that if I run windows media player and run my game I get an fps of 230,and without media player running I get an fps of 60 fps.
Posted By: ulillillia

Re: frame rate - 05/10/06 06:40

Just a few questions to see if you have the exact same symptoms I have:

1. If you set fps_max to 60, what is your frame rate? I get 32.
2. If you set fps_max to 200, what is your frame rate? I get 63.
3. If you set fps_max to 360, what is your frame rate? I get 270.
4. Finally, in a level containing a small block and a single entity, is your frame rate static or does it fluctuate wildly? Also, is the motion very jerky? In my case, it fluctuates wildly and all motion is very jerky.

If all of these are true for you, then you're experiencing the exact same symptoms I am. When I freshly installed Windows XP, I never had this. Until I double-clicked an AVI, which opened up Windows Media Player (of which I wasn't expecting), the frame rate was behaving normally. Upon doing so, it always has done this and no matter what I do, I cannot prevent it. It makes running experiments much less reliable.
Posted By: Grafton

Re: frame rate - 05/11/06 15:41

When you run media player, are you running the game in window mode? That would explain it.
Posted By: ulillillia

Re: frame rate - 05/12/06 05:12

In my case, I'm also running in windowed mode, except I don't have Windows Media Player running (nor do I know where it is to run it with). Normally, with fps_max at 200 and with nothing in the view at all, I should expect to come very close to 200 fps, but I only manage 63. I have other experiments I wanted to do, but with this behavior, the results are very unreliable due to a very large margin of error (about 30%, likely more).
Posted By: westray

Re: frame rate - 05/12/06 08:47

Josiah:- The game is being run in fullscreen mode.
Posted By: Grafton

Re: frame rate - 05/16/06 11:01

Ok, I was asking because in full screen mode, the fps should max out at your
monitors refresh rate, usually 60, or 70. In window mode, the engine dosent
V-sync so you can get much higher FPS like the 230 you stated. I thought that
might be the case.
Posted By: ulillillia

Re: frame rate - 05/16/06 13:14

I always use windowed mode when testing. In my case, even with fps_max at 200, I'm only getting 63 fps....
Posted By: Grafton

Re: frame rate - 05/21/06 08:35

Ulillillia, me too.

I get ~64 fps in window mode. I didnt notice it till your post, and tried it
myself.

I create a large hollow cube in wed and, save it as "test.wmb", and use this as
the only script;

Code:

var video_mode = 6;
function main(){ level_load("test.wmb");}



The crazy thing is, that in this most simple level, the fps cycles from 75 to
63 about every second.

I use f11 to see the fps. It flashes 75 and spins down to 64 within the space
of ~1/2 second, remains at 64 for ~ 1/2 second then drops to 63 for a frame or
two before repeating. Using triple buffer makes no difference at all.

This happens with 6.31 and the latest build. I remember getting much higher fps
than this in the past in window mode, so I am wondering if maybe it is an
graphics driver issue?

My machine is a 3.0 ghz pentium with 2gb sdram and a geforce fx 5600 256 ram.
So I believe I should be getting much higher fps in window mode in an empty
block with the most minimum script!
Posted By: ulillillia

Re: frame rate - 05/21/06 19:10

So I guess I'm not the only one having it. Josiah, if you set fps_max in your script (in the main function) to 200, 60, and 1000 in your empty level, what is your frame rate? In my case, I get 64, 32, and ~270 for these. My experimental level, at it's simplest, is nothing more than a single 64x16x16 block (or something like that, but not hollowed out) with the default texture assigned to it.

When I first installed XP Pro, everything was normal and I was using 6.31.4. As soon as I installed the 6.40.4 (or 6.40.2?) update, the frame rate seemed to always snap at some power of 2 which makes it very difficult to fix and get back to normal. I once reported this as a bug, but as it seems, others are getting it as well. I tried the d3d_triplebuffer thing and it didn't work. I tried going into the display settings to turn on vsync and that didn't work no matter how I did it.

I'm trying to get it so that my 2D game run exactly on 60 frames per second in both windowed and fullscreen modes. At the 64 fps I'm getting, it plays back faster than it should and it causes both of the logos (the Gamestudio logo and my own logo) come up and disappear in under a second at 270 fps. Also, because the frame rate is not in sync with the monitor, the motion is somewhat jerky (as if watching a video and 1 frame was being skipped after 19 normal frames (like having the frame displayed go something like 17, 18, 19, 21, 22, 23, ..., 38, 39, 40, 42, 43, 44, and so on where frame 20, 41, 62, etc. are not displayed at all).

I only use windowed mode for testing, except if the test involves going to fullscreen to test if the function works (and to fix the bugs if there are any).
Posted By: Grafton

Re: frame rate - 05/21/06 23:54

Hi ulillillia, Ive read a couple of threads where you have described this
phenomenon, so I am somewhat familar.

I have v-sync turned off in my adapters settings, and I have the newest drivers.
Here are my results using the f11 Statistics Panel;

fps_max = 60; //32 fps (under 63
fps_max = 64; //63 fps
fps_max = 200; //63 fps
fps_max = 300; //63 - 152 fps? very erratic
fps_max = 400; //142 - 242 fps? very erratic
fps_max = 500; //507 fps
fps_max = 600; //~352 fps? erratic
fps_max = 700; // and higher give ~576 fps? erratic

Strange!

The manual says the range is 10 - 400 default 240.
at the default 240, I get the cycling I described above
and ~63 fps. If I set the max to 64 however, I still get
63 fps but the cycling disappears. As a matter of fact,
around 64 is the only place I can set it that gives a steady
fps.

I get a different result though when I use my own fps calculator
that averages frames. The fps stays at 64 when fps_max is 64 or 400!
Posted By: ulillillia

Re: frame rate - 05/22/06 00:23

Yes, the manual has lots of mistakes in it. This is just one of them. fps_max works fine at 1200 and I recall someone else having a screenshot of it at 1300 fps (or something extremely high). In my test, I used 1200 and got only 273 fps (with a range from 250-something to 290-something. Whether I used v-sync as on or off it made no difference. The d3d_triplebuffer setting made absolutely no difference. My 2D game is an excellent frame rate tester when in frame advance or paused mode.

In my case, however, I doubt I have newest the drivers (from 8/12/2004, supposedly mid-August, the ones off the CD) and Radeon 9600 XT on Windows XP Pro. ATI's website is not only hard to read (I always have to press control+A to select everything just to read it which is annoying - I gave the webmaster an E-mail a while ago and even called ATI's support about this (and known issues about the X800 and X850 thinking of upgrading) I haven't been there in a while so I don't know if this has been fixed or not), there isn't a download for Radeon 9600 XT.

This is something very weird. I posted this in the bug hunt forum I was told by JCL not to spam the bug hunt. It seems like others are getting this as well so there is something going on. Another question: did this only happen when you installed one of the public betas (6.40.4 I think) or did you get it without having installed the public beta? When I had 6.40.2, I never had this issue. With 6.40.4, I did and even with installing 6.31.4 (on top of 6.40.4), I get it as well. The only other option is to try the 6.22 update from the old downloads. This behavior is also causing the motion to be jerky when moving the camera around where it suddenly speeds up then suddenly slows down, and going erratic. Even with my speed display, it's going all over the place from 30 mph to clear up to 60 mph.

Does anyone else get this same thing?
Posted By: Why_Do_I_Die

Re: frame rate - 05/22/06 04:48

I get it as well , i just set the fps_max at 64 and left it there , seems to be working fine on that setting , fps shows to be 63 , but the game plays steady , which is all i really care about , though i dont recall having this behavior untill recently , unless i just hadnt payed attention to the fps , and untill recently i kept running the old 6.22 , till i decided it was time to upgrade to 6.31 , i'll do a reinstall one of this days on another drive and see if it's the 6.31 update that caused it , though i can live with having the fps_max at 64 rather than 60.
Posted By: Grafton

Re: frame rate - 05/22/06 08:00

Quote:


Whether I used v-sync as on or off it made no difference. The d3d_triplebuffer setting made absolutely no difference





Same here on my Nvidia card.

I agree Why_Do_I_Die that 64 fps is enough, but large changes in code seem to
have no effect on the fps unless it lowers it below this number. This makes it
difficult to optimize code for slower machines since I cant tell if the game
has the potential to run above 64 fps with any certainty.
Posted By: Doug

Re: frame rate - 05/22/06 20:35

Quote:

fps_max works fine at 1200




I just have to point out, from the scripting side, that having such a high frame rate can cause nasty bugs in C-Script if you use time_step. If the frame rate goes too high, time_step will reduce down to zero. You can probably guess what happens next...

my.x += force_x * time_step; // nothing moves when time_step = 0

foo = bar/time_step; // divide by zero error!
Posted By: ulillillia

Re: frame rate - 05/22/06 21:51

It would take fps_max being above 16,384 and actually having the frame rate like this in order to run into these problems. But yes, higher frame rates mean less precision. At 1024 fps, the time variable is only at 0.015625 which still has considerable precision.
Posted By: Doug

Re: frame rate - 05/23/06 22:42

Quote:

It would take fps_max being above 16,384 and actually having the frame rate like this in order to run into these problems.




You're right, my example is too simple to give a divide by zero error at anything less than a fps > 16000.

But take acceleration which is length/time^2:
Code:
a = dist * (time_step*time_step);



At 1024fps, time_step = 0.015625, time_step^2 = 0.000244140625!
At 640fps, time_step^2 = 0.000625


Posted By: ulillillia

Re: frame rate - 05/24/06 00:33

Above 512 fps is when acceleration will malfunction in that method. However, if you used some mathematical trick, you can work around this issue to some extent thus the limit really isn't 512 fps, but still 16384.
Posted By: Doug

Re: frame rate - 05/25/06 20:39

Quote:

Above 512 fps is when acceleration will malfunction in that method.



Correct, and you will lose precision at a much lower number.

You can create scripts that would work correctly at even higher speeds, but there really isn't a point. Better to keep the limit reasonable (180-240), and write code that is easier to read.
Posted By: ulillillia

Re: frame rate - 05/26/06 01:17

I agree. Much above 60 fps isn't really all that reasonable as it's already very smooth and near the limit of the human eye (and brain). 30 fps is the lowest recommended frame rate where it's still somewhat smooth and playable, but 60 should be the most recommended low end.

The actual range is otherwise seemingly unlimited (from 0 to nearly 2.1 million), but the recommended high end is more around 240.
Posted By: Matt_Aufderheide

Re: frame rate - 06/07/06 19:15

But since monitors cant refresh much above 100hrz or so there is little point to these high frame rates.
Posted By: xXxGuitar511

Re: frame rate - 06/07/06 19:51

Matt is correct. If you have a Max FPS higher then the monitors refresh rate, then you are just wasting processing power. The engine would be drawing frames that are never drawn by the monitor.
Posted By: mpdeveloper_B

Re: frame rate - 07/05/06 16:10

hmmm what if you were to try:
fps_max = 60;
fps_min = 30;
fps_lock = on;
Posted By: mpdeveloper_B

Re: frame rate - 07/05/06 16:12

ok with this set i get a framerate of ~32 fps...hmm i will try other combinations and see which i can get to work better
although i am not in a blank box and there is more that one piece of code, this is helpful though, as you can test how well the game will play with all this working together
Posted By: Why_Do_I_Die

Re: frame rate - 08/31/06 06:53

Well , since for my game I just finished I needed to use DX8 , I installed gamestudio on another folder , and only updated it to 6.22 , and remembered this topic , so I checked the fps while running the game and it stays solid at 59 on fps_max 60 , using fps_max 61 it stays at like 61 i think , this is how I remember gamestudio acting before the weird fps problems , so its definately something from 6.31 and up , as if i run the game on my 6.31 installation I have the messed up fps , where i have to set it to 64 so itll stay at aroudn 60 , but even then theres always that 3 to 4 frame drop every now and then I constantly get , and when I run it on the 6.22 installation it stays solid at 59 , no fluctuation at all , and this is the exact same game with the exact same code running , so definately something with the 6.31 update and above.
Posted By: ulillillia

Re: frame rate - 08/31/06 08:34

I confirm this too myself. In 6.22, it was very constant. In 6.31 and 6.4, this is happening a lot. In my 2D game, I watch the F11 debug panel slowly dropping toward 63 then suddenly changing to 66 within one frame then dropping back down to 63. From using a panel to display the value of this:

game_fps = pow(time, -1)*16;

then displaying the game fps value, I can see this value change from around the 64 area then, for one frame, changes to 128, then returns to normal and this change occurs 2 to 4 times a second and would explain the behavior I see in the F11 debug panel. Do you get this in the 6.22 update and does it start occurring since the 6.31 update?
© 2024 lite-C Forums