0 registered members (),
853
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
time_smooth, fps_xxx, experience exchange!
#180924
01/30/08 15:22
01/30/08 15:22
|
Joined: Aug 2005
Posts: 1,012 germany, dresden
ulf
OP
Serious User
|
OP
Serious User
Joined: Aug 2005
Posts: 1,012
germany, dresden
|
hey there, in the past i just set fps_max and fps_min and was fine with that. but once i downloaded and tested a lot of software/games i now have a pretty jumpy time_step value that jumps from 0.250 up to 0.500 pretty frequently. this is due to running background processes and harddrive activity, think of fragmented harddrive, open winamp and so on. i was surprised that this really messes up every command wich uses time_step like c_move, vec_accelerate... you get the idea. the result is stuttering, ugly looking movement and the game getting out of sync wich is especially bad for any skill based game. i do not have this behavior with any other game or engine. this can not be accepted in my mind, because i think a lot of casual gamers have a situation like i do (lots of crap(other games) installed on the system)... if you deliver a a7 game wich is programmed to be framerate independet, and everything is multiplied with time_step the player will see so many stuttering movement and not play the game. now what i did was take out my laptop wich does not suffer from the above described problems. i consulted my manual and played around with the same source on both stations only changing the 3 values. (fps_max, fps_min, time_smooth) now in theory one should find values that work for every 3dgs game and every computer best!!! why? simply because you can not say how much the time_step is jumping on the target computer (it could range from almost no jumps at all to frequent jumps causing the double time_step value every x'th frame). shure you could measure the difference in time_step every frame and if the difference is too high, set a higher time_smooth value. but you have to start with something, if you dont set time_smooth you will almost certainly produce problems on some pc's. at least thats what i found out, also there is some kind of strange difference in window mode and fullscreen. windowmode always looks more stuttering in the movement although it comes with more fps. so please lets test this out, right now i'm using the following: fps_max = 190; fps_min = 16; time_smooth = 0.75; this gives me the best results on both machines, but its not perfect. shure i could just say its the users fault if he tries to play a game with winamp running and has a fragmented harddrive. but if you think so you might lose a lot of possible customers. -> not everyone has a perfectly clean pc. *duck* so lets discuss please. thanks.
Last edited by ulf; 01/30/08 16:41.
|
|
|
Re: time_smooth, fps_xxx, experience exchange!
[Re: ulf]
#180925
01/30/08 15:44
01/30/08 15:44
|
Anonymous
Unregistered
|
Anonymous
Unregistered
|
time_smooth has a range from 0 .. 0.99
|
|
|
Re: time_smooth, fps_xxx, experience exchange!
[Re: ulf]
#180926
01/30/08 16:05
01/30/08 16:05
|
Joined: Oct 2003
Posts: 827 22�21'24"N 114�07'30"E
Frederick_Lim
User
|
User
Joined: Oct 2003
Posts: 827
22�21'24"N 114�07'30"E
|
This is an interesting thread because I have some problem with those fps_ functions. The problem is not about the movement, it is about the shooting rate of projectile. I found I use a wrong approach to control the shooting rate, after reading the AUM56 again, I realize that I should use total_frames to control the shooting rate. Quote:
Acknex stores the total number of frames that have passed since the game was started in a variable named "total_frames". If we limit the frame rate to 80 fps, just like I did with this demo, and the PC is fast enough, total_frames will be set to 80 after 1 second, to 160 after 2 seconds, and so on - get it?
Our "if ((total_frames % 80) == 1)" line of code can be translated to "if total_frames reaches 1, 81, 161, 241...". This means that the two lines of code that are placed inside the curly brackets are executed each and every second, provided that the computer is able to deliver at least 80 fps in our level.
So my problem is, if I don't set fps_max, the default fps_max is 240, assume my game run really fast at 240 fps in window mode, if ((total_frames % 60) == 1) then I will fire 4 times a second. But if I switch to full screen and my screen refresh rate is 60Hz, it will fire 1 bullet a second!
And in the manual, the total_frames also use to control animation. In that case, if the (total_frames %60) not change, the shooting rate and model animation in 75Hz monitor is faster than 60Hz monitor.
Right now I just set the fps_max and fps_min to 60. Any good idea?
|
|
|
Re: time_smooth, fps_xxx, experience exchange!
[Re: ]
#180927
01/30/08 16:42
01/30/08 16:42
|
Joined: Aug 2005
Posts: 1,012 germany, dresden
ulf
OP
Serious User
|
OP
Serious User
Joined: Aug 2005
Posts: 1,012
germany, dresden
|
Quote:
time_smooth has a range from 0 .. 0.99
shure that was just a typo, i meant i use time_smooth = 0.75;
so what are you guys using? or are you not taking care of this case at all?
|
|
|
Re: time_smooth, fps_xxx, experience exchange!
[Re: ulf]
#180928
01/30/08 17:31
01/30/08 17:31
|
Anonymous
Unregistered
|
Anonymous
Unregistered
|
If the jumps are based on the app/game design/script I check the F11-panel for their reason. Most often it's the number of visible entites or the flush time of the video memory. Then i try to reduce these jumps by optimizing the game.
I never use fps_min. This may result in strange caluculation errors. Sometimes I limit the framerate with fps_max to the monitors framerate.
Jumps not based on the gamedesign do not bother me.
|
|
|
Re: time_smooth, fps_xxx, experience exchange!
[Re: ]
#180929
01/30/08 19:09
01/30/08 19:09
|
Joined: May 2002
Posts: 7,441
ventilator
Senior Expert
|
Senior Expert
Joined: May 2002
Posts: 7,441
|
Quote:
Right now I just set the fps_max and fps_min to 60. Any good idea?
you should use total_ticks instead of total_frames. total_frames of course isn't frame rate independent.
... i usually use something like fps_min=10 and fps_max=120 and leave time_smooth at the default value (which is 0.5). i never had big problems with those settings except if something was wrong with the script like mercuryus mentioned.
|
|
|
benchmark test project included
[Re: ulf]
#180930
01/31/08 09:51
01/31/08 09:51
|
Joined: Aug 2005
Posts: 1,012 germany, dresden
ulf
OP
Serious User
|
OP
Serious User
Joined: Aug 2005
Posts: 1,012
germany, dresden
|
okay, to prove what i mean i made a quick test project with the following code. it just vec_accelerate a skill and does a c_move afterwards. very simple, there is no 'wrong code' that causes the stuttering in the movement. (at least to my knowledge, correct me please if i'm wrong) just download and start it here: http://www.ackbytes.com/upload/fpstest.zippress Q to start the movement and R to see it again. please look close at cbabe and you will notice a stuttering in the movement. please test this and respond. i use the following code and just set fps_max to 60, everything else unchanged at standard but see yourself: edit: with this testproject i do get stuttering at both my laptop and pc. ): Code:
///////////////////////////////
#include <acknex.h> #include <default.c>
// system libs #include <stdio.h>
// debug #include "deb.c" // debug #include "deb.h" // debug
///////////////////////////////
function testentity() {
deb_print("Q to start movement | R reset position"); while(!key_q){wait(1);} while(key_q){wait(1);}
while(1) {
vec_accelerate(my.skill1, my.skill10, vector(5,0,0), 0.5); c_move (me, me.skill1, nullvector ,IGNORE_YOU|IGNORE_MODELS|IGNORE_MAPS|IGNORE_PASSABLE|IGNORE_SPRITES|IGNORE_PASSENTS|IGNORE_CONTENT); wait(1); if(key_r) { while(key_r){wait(1);} vec_set(my.x,nullvector); } }
}
function main() { level_load("test.WMB"); wait(2);
video_set(800,600, 32, 2); // init video adapter
fps_max = 60;
wait(1);
ent_create("cbabe.mdl",nullvector,testentity); }
Last edited by ulf; 01/31/08 10:08.
|
|
|
|