Just a minor bug. I'm using stock tractor and tipper with Mode 1. While the tractor waiting until fill level is reach by the overloader, the engine is keep running even the Fuel Save is set On. And also the beacon light doesn't work on Mode 1 even i've set the beacon to "Always On". I'm using CP version 232.
Geht bisher nur am Ende der Feldarbeit.
Getestet mit V353.
I use a lot of Mode 1 for hauling from the field to bin/silo and I notice this issue, too.
Disclaimer: I am new to CP modding, but not software development.
I did some playing around with the code in this branch: https://github.com/Courseplay/courseplay/compare/master...dlbromen:debug_grain_transport
What is somewhat unique about Mode 1 is that it has a custom drive method with a resetSpeed call. To make a long story short, what happens is that because of this the lastMoveCommandTime variable is constantly updated and the mechanism for checking the engine should be shut off to save fuel thinks that the vehicle moved in the last frame.
allowedToDrive = false)resetSpeed is called by the GrainTransportAIDriver:drive function. Last move time is not updated because allowed=false. Speed is set to math.huge and allowed is reset.resetSpeed is called again by base AIDriver:update. This time because speed > 0 and allowed=true, it does update the lastMoveCommandTime.At the end of the day, it seems like GrainTransportAIDriver:drive:resetSpeed() call is both causing the issue and unnecessary because of the call in the base update loop. I've been running this debug build with it commented out for a while and it fixes the issue seemingly without side effects. But that claim is not based on data or extensive experience.
I thought I'd chime in with my findings and see what the dev team thinks. Thanks.
@pvaiko
@dlbromen you are right, that call isn't needed, do you mind creating a pull request?
And thanks for the contribution!
It looks like this regressed since 6.02.x. I'm not quite sure why yet.
It looks like this regressed since 6.02.x. I'm not quite sure why yet.
Update: I think it's because of this commit.
It resets the timer on every update loop.
Unfortunately, I'm not familiar enough with the CP code to understand the intention of that change to fix it.
There are more Modes that doesnt use fuel save mode right now I think.
Need to check for it.
@dlbromen I think the intent is clear from the comments and the commit message. (Also the TODO: rethink this whole blocking logic, is now confusing as hell :)
A trivial solution may be to use setSpeed(0) instead of hold()
Most helpful comment
I use a lot of Mode 1 for hauling from the field to bin/silo and I notice this issue, too.
Disclaimer: I am new to CP modding, but not software development.
I did some playing around with the code in this branch: https://github.com/Courseplay/courseplay/compare/master...dlbromen:debug_grain_transport
What is somewhat unique about Mode 1 is that it has a custom
drivemethod with aresetSpeedcall. To make a long story short, what happens is that because of this thelastMoveCommandTimevariable is constantly updated and the mechanism for checking the engine should be shut off to save fuel thinks that the vehicle moved in the last frame.allowedToDrive=false)resetSpeedis called by theGrainTransportAIDriver:drivefunction. Last move time is not updated because allowed=false. Speed is set tomath.hugeand allowed is reset.resetSpeedis called again by baseAIDriver:update. This time because speed > 0 and allowed=true, it does update thelastMoveCommandTime.At the end of the day, it seems like
GrainTransportAIDriver:drive:resetSpeed()call is both causing the issue and unnecessary because of the call in the base update loop. I've been running this debug build with it commented out for a while and it fixes the issue seemingly without side effects. But that claim is not based on data or extensive experience.I thought I'd chime in with my findings and see what the dev team thinks. Thanks.