1 registered members (TipmyPip),
18,388
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
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...
Frederick_Lim
User
|
User
Joined: Oct 2003
Posts: 827
22�21'24"N 114�07'30...
|
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?
|
|
|
Entire Thread
|
time_smooth, fps_xxx, experience exchange!
|
ulf
|
01/30/08 15:22
|
Re: time_smooth, fps_xxx, experience exchange!
|
Anonymous
|
01/30/08 15:44
|
Re: time_smooth, fps_xxx, experience exchange!
|
ulf
|
01/30/08 16:42
|
Re: time_smooth, fps_xxx, experience exchange!
|
Anonymous
|
01/30/08 17:31
|
Re: time_smooth, fps_xxx, experience exchange!
|
ventilator
|
01/30/08 19:09
|
Re: time_smooth, fps_xxx, experience exchange!
|
Frederick_Lim
|
01/31/08 12:11
|
Re: time_smooth, fps_xxx, experience exchange!
|
Frederick_Lim
|
01/30/08 16:05
|
benchmark test project included
|
ulf
|
01/31/08 09:51
|
Re: benchmark test project included
|
Frederick_Lim
|
01/31/08 12:05
|
Re: benchmark test project included
|
ulf
|
01/31/08 12:14
|
Re: benchmark test project included
|
Slin
|
01/31/08 14:52
|
Re: benchmark test project included
|
FBL
|
01/31/08 17:03
|
Re: benchmark test project included
|
Anonymous
|
01/31/08 18:15
|
Re: benchmark test project included
|
ulf
|
01/31/08 18:36
|
Re: benchmark test project included
|
Anonymous
|
02/01/08 09:57
|
Re: benchmark test project included
|
ulf
|
02/01/08 10:10
|
Re: benchmark test project included
|
Anonymous
|
02/01/08 11:09
|
|
|