Freelancer Community Network
Reminder: Internet Explorer 6 or below are NOT supported.
Multiplayer Connection Tutorial
Collapse/Expand Login


Remember me

Lost Password?

Register now!
Collapse/Expand Chat
Collapse/Expand Who's Online
77 user(s) are online (50 user(s) are browsing Forum)

Members: 0
Guests: 77

Collapse/Expand Donations
Monthly costs: -30€
Income (ads): +5€
Donations (last month): +165€

Current balance: 105€
(last updated 02/2021)

Please make a donation if you want to help keeping The-Starport online:

Collapse/Expand Links
Collapse/Expand Advertisement
There are currently 42 users playing Freelancer on 38 servers.
April. 16, 2021

Browsing this Thread:   1 Anonymous Users

 Bottom   Previous Topic   Next Topic  Register To Post

Update rate fluctuation?
Starport Admin
2009/2/21 21:42
Registered Users
Posts: 3520
So we've been attempting to debug some issues with varying maneuverability apparently tied to frame rates. Low frame rate (sub-30) makes ships much slower to turn, while very high frame rates (over 90) makes ships faster and also makes them stutter about.

Now, I'm not exactly sure what could be causing this, but one thing I noticed while debugging is that IServer::Update is being called with a varying spacing. In fact, I can get it myself to vary between 15-16 (the expected value) to 31-32 (double that) to even 46-47 and 0.

In windowed mode at 144Hz (framerate varying between 120 and 144), I get 50% of all ticks as 0 spacing and most of the rest at 16 and 15. At 60Hz, 15 and 16 make up well over 90% of all ticks. At 24Hz, it's all over the place, with 31-32 leading, then 46-47, then 0 and 15-16, each making up between 20-40%.

Now, as far as I know, Freelancer expects this to be called 60 times per second flat. If my measurements are correct, this is most certainly not the case.

I'd rather not limit framerate to 60 at all times (though I will if that's necessary), but I'd like to know what in the hell could possibly cause the update calls to change in such a manner because of frame rate differences?

EDIT: Some digging indicates that FL correctly uses the performance counter (that's what the Timing class uses), so the base timer is accurate and reliable enough not to be the cause. This means that the likely source of the problem is the caller for IServer::Update, which appears to be sub_5A89B0 in Freelancer.exe. The logic resembles a standard game loop, but there's a few things I'm not sure about yet.

Posted on: 2015/9/9 7:37
"Cynicism is not realistic and tough. It's unrealistic and kind of cowardly because it means you don't have to try."
-Peggy Noonan