Jump to content

Different player speed


Athelios
 Share

Recommended Posts

Hello,

Don't know if it is a bug but players with different FPS move by different speed.
I use FreeCamera.

I have got 60 FPS and I move about three times slower then other player with 20 FPS.
That's weird because players with lower FPS should move slowly. I guess there is some speed compensating code.

Also if player is for some time in another browser window and switch to game immediately holding move button he move for a while by huge speed.

Sorry for my English.

Thanks!

Link to comment
Share on other sites

public _computeLocalCameraSpeed(): number {
    var engine = this.getEngine();
    return this.speed * ((engine.getDeltaTime() / (engine.getFps() * 10.0)));
}

In my opinion this function isn't correct.

Example:
FPS = 40, DeltaTime = 25 Result is 0.0625
FPS = 20, DeltaTime = 50 Result is 0.25

This makes player with 20 FPS 4 times faster, but he should be 2 times faster.
Shouldn't be Math.sqrt((engine.getDeltaTime() / (engine.getFps() * 10.0))) ?

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.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...