Problems with fps_max and frame rate

Posted By: painkiller

Problems with fps_max and frame rate - 01/02/11 15:23

I have a problem with my game. When the frame rate is under fps_max some entities start to "vibrate". For example if I have fps_max=60 and a frame rate of 60 all runs perfect and smooth, but when the frame rate fall for example to 40 then some moving entities start to "vibrate", but if now I set fps_max=30 I get a frame rate of 30 and all runs smooth again. Anyone knows how i can fix this?
Posted By: Rei_Ayanami

Re: Problems with fps_max and frame rate - 01/02/11 15:26

Sounds like bad coding..

Do you use time_step to move your entities?
Posted By: painkiller

Re: Problems with fps_max and frame rate - 01/02/11 17:21

yes, the problem happens with the camera_chase from A8's camera.h and not with the other camera types. It also happens in the default AI car from car templates and in my traffic cars which I move along a path:

Code:
////////////////// MOVE DUMMY ALONG THE PATH
		checker=path_getnode(dummies[my.skill65],current_node+1,c_target, NULL);
		if(vec_dist(dummies[my.skill65].x,c_target)>min_dist)
		{
			vec_diff(c_vec, c_target, dummies[my.skill65].x);//turn the car so it facing to the target.x
			vec_to_angle(dummies[my.skill65].pan, c_vec);
			vec_set(move_vec, vector(my.car_speed*time_step*(50./80), 0, 0));
			vec_rotate(move_vec, dummies[my.skill65].pan);
			vec_add(dummies[my.skill65].x, move_vec);
			
		}else
		{
		   current_node+=1;
		}


Posted By: Psygnal

Re: Problems with fps_max and frame rate - 01/07/11 10:49

If it makes you feel any better, Painkiller - I've had exactly the same problem, and used exactly the same solution.

I'm quite prepared to believe that I'm coding something badly, but I can't for the life of me work out what.

Rob
Posted By: 3run

Re: Problems with fps_max and frame rate - 01/07/11 12:38

That is not a bad coding!
All you need is to limit FPS_MIN! Make it for example 50 or 55, everything will work properly.
Or you can use FPS_LOCK.

TRACER
Posted By: Widi

Re: Problems with fps_max and frame rate - 01/07/11 13:18

If you want that your game runs on different systems with the same speed (same in one system with changing fps) then don`t use FPS_MIN or FPS_LOCK.

Try to play with the time_smooth var...
Posted By: 3run

Re: Problems with fps_max and frame rate - 01/07/11 14:54

There will be no problem with speed on different PC if he'll use FPS_MIN!
Posted By: fogman

Re: Problems with fps_max and frame rate - 01/07/11 15:10

Quote:
This variable limits the valid range of the time_step variable to a minimum frame rate. Below that frame rate, time_step stays constant, limiting the maximum per-frame distance of movements.


Consequence: The game will run at different speed on slow pc´s.
If time_step stays constant, the speed of moving objects will be determined by the framerate.
The framerate is different on every pc.
This will occur only on slow pc´s as said. When the framerate goes under fps_min (in you example 55 fps), time_step will be constant.
Posted By: 3run

Re: Problems with fps_max and frame rate - 01/07/11 17:13

As I tested on different PC most of my project, I can say that even if there will be any differences in FPS, you are not gonna notice them. May be if you'll use very old and very slow PC, then I guess frame rate will go really slow... And even so, there are different System Requirements for each game, so not all games gonna work properly on slow PC!

Posted By: Rei_Ayanami

Re: Problems with fps_max and frame rate - 01/07/11 17:54

First of all, even the manual says that stuttering with different fps comes from bad coding!

Using fps lock/min is just stupid for a good game!
Posted By: 3run

Re: Problems with fps_max and frame rate - 01/08/11 08:27

When you press F11 for debug mode, even there stuttering will appearer. Is that bad coding of GS developers?! I think NO!
Posted By: Superku

Re: Problems with fps_max and frame rate - 01/08/11 13:07

There appears NO stuttering. It's simply the beep-command that plays a sound and pauses the game for 0,1secs that is called when you press F11.
Posted By: Widi

Re: Problems with fps_max and frame rate - 01/08/11 13:45

@painkiller: sorry for offtopic...
@3run:
Quote:

When you press F11 for debug mode, even there stuttering will appearer. Is that bad coding of GS developers?! I think NO!

This has notting to do with the topic, make a new one if you have some problems with the debug mode
Posted By: 3run

Re: Problems with fps_max and frame rate - 01/08/11 18:44

I have no problems with debug mode, by the "stuttering" I meant that FPS is going down a bit each time when you press F11 (and movement is a little bit jerking each time when that happens), but Superku opened my eyes. Now I know that is simple beep();


Edit: painkiller, bro sorry for off-topic, I just wanted to help.
© 2024 lite-C Forums