Jump to content

Why UPS update slowly?


Joh
 Share

Recommended Posts

I am sorry but how this could help me?

If i set the velocity to 50 it will move 50 in one second so exactly 50/UPS()..

How this appspeed can help me in this way? I'll need to know how much the entity is moving in a loop.

Intel Corei7-6700, NVIDIA GeForce GTX 980, 32GB DDR4, W-10.

Link to comment
Share on other sites

Yeah sorry, i am using bodies.

So do you know how can i do for UPS? Is UPS = FPS? I got it in mind right now if it is i can calculate the FPS and use that..

Intel Corei7-6700, NVIDIA GeForce GTX 980, 32GB DDR4, W-10.

Link to comment
Share on other sites

Physics movement has really nothing to do with FPS or UPS. It has only to do something with time, so you can check how much a body has moved with something like this:

double vtimer=clock()+1000, vcount=0, vcur=0, vpersec=0;
while(){
vcur=Length(GetBodyVelocity(body));
vcount+=vcur;
if(vtimer<clock()){
	vtimer=clock()+1000;
	vpersec=vcount;
	vcount=0;
}
DrawText(1,100,"speed per second=%f",vpersec);
}

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

mmm well in some way it have to do with UPS (Update per Second) check this:

 

C: TVec3 CalcBodyVelocity( TBody body, TVec3 &position, flt smoothing=1 )

Lua: CalcVelocity:TVec3( position, smoothing )

Calculates the velocity required to make the body reach the specified position in one second, with no damping. This can be used for precise control of body movement.

 

Also in the example he use Flip (1) and use 60 (flip 1 should fix the UPS to 60)

SetBodyVelocity(body,t.scale(60.0))

So i am pretty sure it have something to do with it..

 

Anyway i'll check your way too.

Intel Corei7-6700, NVIDIA GeForce GTX 980, 32GB DDR4, W-10.

Link to comment
Share on other sites

No it hasn't. You should never use Flip(1), but always Flip(0), since on different machines Flip(1) might not even work (if the user has force sync=off). Flip(0) quarantees that your program runs with the same speed on all machines (with AppSpeed() for non-physics movements). Flip(0) makes also the application run faster than Flip(1), regardless of the FPS. You can see this especially in heavy scenes where the FPS is less than 20.

John Carmack also said that you should never use vsync, but always time-based sync.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...