Incorrect speed of AI on server

sovteq
Posts: 3
Joined: Thu Aug 27, 2020 11:53 pm

Incorrect speed of AI on server

Post by sovteq »

Platform: PC

Issue:

Configuration:
One dedicated server and one client connected to it. Dedicated server is configured to not "Pause Game If Empty".

Problem:
When I hire a worker on a client machine to spray my fields then his normal speed on the field is 20km/h. When I disconnect a client then server is still working but the speed of the tractor on the server is about 5km/h. It is causing that the spray usage is 4 times bigger, cause server still thinks that worker is driving 20km/h but apparently he is moving only 5km/h.

I noticed that in a function Vehicle.updateVehicleSpeed there is a line

movedDistance = speedReal*g_physicsDt

When I am connected to the server, both variables: dt and g_physicsDt, are equal to about 16ms. But when I am disconnected from the server they values are:
g_physicsDt = 50ms
dt=200ms.

Difference is 4 times, very similar to the speed differences mentioned in problem statement.

Additionaly spray usage is calculated incorrectly here:
Sprayer.getSprayerUsage
line:
return scale * litersPerSecond * self.speedLimit * workWidth * dt * 0.001

it is calculated as follows:

1*0.006*20kmh*30m*200ms*0.001
but it should be:
1*0.006*5kmh*30m*200ms*0.001

because the vehicle is really moving with 5km/h velocity.

Yes, speed limit is in km/h, it should be in m/s (but this is different bug).
Alagos
Moderator
Posts: 1934
Joined: Thu Aug 15, 2013 2:54 pm
Location: The Netherlands

Re: Incorrect speed of AI on server

Post by Alagos »

Sounds like this is a mod issue, and not a game issue. I advice you to figure out what mod causes this.
I assume people don't use Seasons, unless they say otherwise.

How to upload your >> log<<
How to upload >>images << to the forum
How to get your gamekey's activation limit >>reset<<
How to report a >> bug <<

>>Rules<<
sovteq
Posts: 3
Joined: Thu Aug 27, 2020 11:53 pm

Re: Incorrect speed of AI on server

Post by sovteq »

Source code that I pasted becomes from official GDN. I just reproduced this issue again without any mods installed.

Normally combine is driving from one field end to the other field end in 35 seconds. So I hired a worker, and left multiplayer. Wait 35 seconds and combine should be on the second end of the field. When I joined multiplayer game again, combine was about 25% on his way.

It means that game is 4 times slower when no one is connected to the dedi server and an option "Pause game if empty" is unchecked (disabled)
sovteq
Posts: 3
Joined: Thu Aug 27, 2020 11:53 pm

Re: Incorrect speed of AI on server

Post by sovteq »

So could you please move this thread again to the main game bug forum.

Thank you!
Post Reply