[Fixed] Move speed with different FPS

Think you found a bug ? This is where to go...

Moderator: Brume Dev Team

[Fixed] Move speed with different FPS

Postby rubbish on Wed Feb 07, 2007 3:10 am

Same time,Same speed,
When the fps is low ,fps=15,Tiny move distance = a;
When the fps is high ,fps = 30,Tiny move distance = b;
fps = 40 ,Tiny move distance = c;

I think a= b= c ,but...a<b<c!Why??
rubbish
Brume user
 
Posts: 183
Joined: Fri Nov 03, 2006 5:05 am

Postby Silmaryls on Wed Feb 07, 2007 9:04 pm

I think that the moving function is FPS dependent.

You have to found another one based on fElapsedTime.
User avatar
Silmaryls
Brume Team Member
 
Posts: 340
Joined: Tue Feb 21, 2006 10:09 pm
Location: Paris - France

Postby rubbish on Thu Feb 08, 2007 2:18 am

:roll:
In the Ice,
which moving function base on fElapsedTime?
rubbish
Brume user
 
Posts: 183
Joined: Fri Nov 03, 2006 5:05 am

Postby rubbish on Thu Feb 08, 2007 4:07 am

In the Tutorial_Skinning
I added many meshes so that the fps < 20 ,tiny move distance = a in 10 seconds.
And I remove the mesh ,the fps > 50,tiny move distance = b in 10seconds.
a < b.....
rubbish
Brume user
 
Posts: 183
Joined: Fri Nov 03, 2006 5:05 am

Postby Silmaryls on Thu Feb 08, 2007 8:30 pm

Hi Rubbish !

I think that you should use the following formula :

Code: Select all
distance = velocity * time


For example, If I take your rabbit :lol: it gives something like that :

Code: Select all
rabbit.Pos += -rabbit.Up * velocity * fElapsedTime;


I reduced velocity to 0.003f in order to keep the rabbit in the screen.

Ah yes and by the way if you want to slow down your game, just add this line somewhere in the MoveScene method :

Code: Select all
Thread.Sleep(50);


(you should import System.Threading)

Bye
User avatar
Silmaryls
Brume Team Member
 
Posts: 340
Joined: Tue Feb 21, 2006 10:09 pm
Location: Paris - France

Postby rubbish on Fri Feb 09, 2007 1:52 am

Ok,everything looks perfect! :)
Thanks a lot~dear friend
BTW, I think the Tutorial_Skinning ,will add the formula :) it'll be perfect
rubbish
Brume user
 
Posts: 183
Joined: Fri Nov 03, 2006 5:05 am


Return to Bugs In English

Who is online

Users browsing this forum: No registered users and 1 guest

cron