Closed AdamC1228 closed 7 months ago
@Voidheartd This should be greatly improved on the experimental branch but has yet to be merged into the dev branch. If you wish to test, id recommend testing commit fc9a20dc95376ba82fe56ae1552b4c3fea7250a4 from Experimental.
Edit: It is minimally tested at this time but appears to improve the situation.
So far it appears to work well. I did see this error in the log several times with varying keys: [01:35:54.12 ERR RouteManager.BepInEx] 2024-01-15 01:35:54Z - Dispatcher_V2.0.0.6 - ERR: Paused Mode dictionary does not contain key: (Cb1v NRR FS1)
I noticed that while paused, the forward/reverse buttons returned, but I could not switch from forward to reverse.
I believe the error is less so a true error and more of an ignore-able error as it sits right now if I remember correctly.
As for the forward/reverse buttons, I will take a look. As I pointed out, I have yet to test it thoroughly so I would be more surprised if you didn't find something at this stage :) .
@Voidheartd I have made some adjustments as outlined below.
Error was an erroneous error message. Forward & Reverse lockout fixed. Attempt to auto restore previous direction / speed.
Commit bb252a352793c6a1169afacb009b96f149998d44
Edit: See 2.0.0.6 Beta
Nice, I was considering asking if it could save and restore the speed.
It doesn't appear to restore speed as of 052c25b. I had the train depart Bryson for Ela, hit pause, set speed to 0, waited for the train to stop, and then hit resume. The train stayed set to 0. railloader.log
Edit: Also in this log I started route manager sitting at Bryson, with Bryson, Ela, and Whittier selected. The train moved backward a short distance (toward Whittier), then forward to stop in the same place at Bryson again.
It doesn't appear to restore speed as of 052c25b. I had the train depart Bryson for Ela, hit pause, set speed to 0, waited for the train to stop, and then hit resume. The train stayed set to 0. railloader.log
Edit: Also in this log I started route manager sitting at Bryson, with Bryson, Ela, and Whittier selected. The train moved backward a short distance (toward Whittier), then forward to stop in the same place at Bryson again.
The attempt to restore the speed is simply an attempt. It is not guaranteed and, at least for the moment, my stance is that since the slider is directly above the unpause button and the user practically is staring at the slider as they unpause the ai, they can just re-set the slider to the requisite value they want.
The technical answer is that we would need to adjust the code so that either we separately save the slider value at the moment of pause or we adjust the code such that we can ignore the slider inputs while paused and then restore them on unpause. This is because now that we are relinquishing command temporarily back to the game, using the "native" route mode or other modes will cause the slider to be set to 0 in certain circumstances. To restore the direction stored in loco telemetry we are required to submit a speed value to the auto-engineer thus we "offer" the current tracked value (which unfortunately the gui updates rather frequently) such that we can restore the direction and attempt to prevent the train from doing its "reverse dance".
Long story short, it will stay 0 in a lot of instances but there are times it does restore it. Its just best effort right now.
Noted
@Voidheartd Since this is working as intended at this time (noting that there could be room for improvement in a future release) I am going to consider the core issue resolved unless there are other issues at hand?
Train was located at Whittier with passengers loaded. Selected stations Ela, Bryson, Hemingway, and Alarka Jct. Everything but Ela was unchecked on the cars. railloader.log
Next, I repeated the above, except for also checking Whittier on route manager. Train departed Whittier normally. Train was then stopped outside Whitter by going to manual, and then route manager was turned back on. Train returned to Whittier and then was able to depart normally for Ela. Not great behavior but not dumping passengers. railloader.log
I then tried including Whittier again, letting the train get out of Whittier station and stopping manually, but this time unchecking Whittier as a destination before enabling route manager again. The destination was determined to be Bryson, and Ela was unchecked on the cars. railloader.log
Based on this testing there doesn't seem to be a good way to pause and resume route manager that doesn't involve the train driving back to the closest station first (could cause train to proceed afterward in the wrong direction potentially at middle stations? will test later). Including the save that was being used in case it is helpful. save.zip
Originally posted by @Voidheartd in https://github.com/Erabior/RouteManager/issues/67#issuecomment-1890989027