Page 1 of 2

Playing around with the Frame Rate In-game.

PostPosted: Thu Oct 25, 2007 10:03 pm
by Sgt. Sparky
I think it would be awsome to be able to adjust the maximum frame rate while the game was being played.
:D
one of the reasons I want this function is because of this game I am making:

Re: Playing around with the Frame Rate In-game.

PostPosted: Thu Oct 25, 2007 11:28 pm
by Game A Gogo
Yes, this would be good for slowing down, like a slow-mo cinmatic *nods*

Re: Playing around with the Frame Rate In-game.

PostPosted: Fri Oct 26, 2007 1:46 am
by Fuzzy
Make a variable called TimeDilation. Its a float value.

Now everytime you draw, set all the actors velocity at whatever rate, multiplied by TimeDilation.

If you want full speed, then set TimeDilation to 1.0. When it comes time for a slow cinematic effect, set TimeDilation to 0.75, or maybe even 0.5.

Re: Playing around with the Frame Rate In-game.

PostPosted: Fri Oct 26, 2007 9:55 am
by Bee-Ant
Yeah, I want it too... :D

Re: Playing around with the Frame Rate In-game.

PostPosted: Sat Oct 27, 2007 8:12 pm
by Sgt. Sparky
Fuzzy wrote:Make a variable called TimeDilation. Its a float value.

Now everytime you draw, set all the actors velocity at whatever rate, multiplied by TimeDilation.

If you want full speed, then set TimeDilation to 1.0. When it comes time for a slow cinematic effect, set TimeDilation to 0.75, or maybe even 0.5.

I know, but I would rather have the ability to adjust the frame rate.
:(

Re: Playing around with the Frame Rate In-game.

PostPosted: Sat Oct 27, 2007 8:38 pm
by Fuzzy
The problem is probably that the frame rate and the clock time are tied together, so any timers would be badly affected.

Re: Playing around with the Frame Rate In-game.

PostPosted: Sun Oct 28, 2007 12:16 am
by Game A Gogo
Timer and Frame rate does not run on the same thing, if your frame rate is low, the timer will be the same.

Re: Playing around with the Frame Rate In-game.

PostPosted: Sun Oct 28, 2007 1:25 am
by Fuzzy
Thats not what i mean gogo.

pretend you had a timer that makes an actor line up with another. Since the actors move based on the frame rate, the timer would not synch with the draw and you would get odd problems.

actor A is told to move --------> for 0.5 seconds. Its x velocity is 5(five pixels per frame).
actor B(a platform) moves up and down constantly with a velocity of 5.

at 30 frames per second actor A would move 75 pixels.

at 15 frames per second, it would move only 37.5

Normally we calculate what we need in advance, but in this case, we couldnt do it. what would happen if at 0.4 seconds, the frame rate suddenly was lowered to 10 for a special effect? Actor A would miss landing on actor B. Or at the very least, it wouldnt line up.

Re: Playing around with the Frame Rate In-game.

PostPosted: Sun Oct 28, 2007 4:18 am
by DilloDude
Using a variable such as TimeDilation as Fuzzy suggested would probably be prefered than changing the framerate, as things would still move smoothly. In this case, timers become a problem (they do anyway if your framerate slows down). In this case, you would have to substitute variable 'counters', which are incremented on draw actor, for timers.

Re: Playing around with the Frame Rate In-game.

PostPosted: Sun Oct 28, 2007 5:15 pm
by Game A Gogo
yes I agree. So you would need to do the timer manually, which would be best.
Maybe Makslane could change the timer to work with the FPS?

Re: Playing around with the Frame Rate In-game.

PostPosted: Sun Oct 28, 2007 11:51 pm
by Fuzzy
I still dont think thats a good idea. the timer is based on the CPU clock.. FPS is based at least partly on your graphics card. Suddenly timers would get inaccurate when lots was happening(it apparently already does). Plus, when multiplayer comes in, it would really mess with things.

Re: Playing around with the Frame Rate In-game.

PostPosted: Mon Oct 29, 2007 11:52 pm
by Game A Gogo
yes, especially when there is the motion-compensation.

Re: Playing around with the Frame Rate In-game.

PostPosted: Tue Oct 30, 2007 1:43 am
by Fuzzy
what is this motion compensation i keep hearing about?

Re: Playing around with the Frame Rate In-game.

PostPosted: Tue Oct 30, 2007 3:29 pm
by Troodon
It's a thing in the game options that makes characters faster when fps goes down. It can be put on and off. I think it came in 1.3.8, atleast it wasn't yet in 1.3.3.

Re: Playing around with the Frame Rate In-game.

PostPosted: Tue Oct 30, 2007 5:07 pm
by Bee-Ant
Ummm...do you still have GE v 1.3.3 Mike???