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).
Incorrect speed of AI on server
4 posts
Page 1 of 1
Re: Incorrect speed of AI on server
Sounds like this is a mod issue, and not a game issue. I advice you to figure out what mod causes this.
Re: Incorrect speed of AI on server
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)
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)
Re: Incorrect speed of AI on server
So could you please move this thread again to the main game bug forum.
Thank you!
Thank you!
4 posts
Page 1 of 1