Erabior / RouteManager

Mod for Railroader the game that adds basic automation for passenger routes
13 stars 6 forks source link

Confusion over next destination #33

Closed Voidheartd closed 9 months ago

Voidheartd commented 10 months ago

[1.0.1.12] Twice now I've had the train get to Ela and decide to dump out all the passengers for what should have been the next station, one time causing the passengers to be lost because the station refreshed before they could be reloaded.

This was from enabling route mode at Whittier/Bryson with people already loaded. The train gets to Ela and then decides it should go back to the station it was just at. It seems like it doesn't understand where it was starting from or at least it seems to be quite good at picking the wrong station to go to next.

nitroSkirata commented 10 months ago

Can Confirm, when activating the RouteManager between Bryson and Ela, it will drive to Ela and return empty to Bryson, before running the route as designed.

dtwilliams10 commented 10 months ago

[1.0.1.12] I'm having a similar issue between Nantahala and Almond. It successfully made the trip from Whittier all the way out to Nantahela, but now it's stuck driving back and forth between the two stations.

nitroSkirata commented 10 months ago

Here are some clips of the Issue, when activating a Station that has already been passed, the RouteManager dumps the PAX at the next station and runs to the one that was just activated.

https://youtu.be/KN_1tsbqU-w

AdamC1228 commented 10 months ago

Please reproduce & provide the player log file (C:\Users\%username%\AppData\LocalLow\Giraffe Lab LLC\Railroader\Player.log) from the affected session for review.

AdamC1228 commented 10 months ago

It would seem there are potentially 3 separate issues here. Feel free to correct me if i am wrong in my summary:

Issue 1 When route mode is enabled with passengers already loaded, the AI proceeds to the first station, then selects the wrong station potentially doubling back after selecting the wrong station. This implicates an error in the station selection logic.

Screenshots of the station selection window and the logs will greatly help diagnosing this.

Issue 2 Potentially an extension of issue 1 implied by JD Tiger that the passenger selection is not correctly copying to the coaches and / or the train is not waiting at the station to take on passengers.

I too have noticed something similar running between Silva and Dillsboro but in that instance there were surprisingly no passengers at the station destined for Silva as determined when examining the station as it will reveal the destinations for the passengers waiting. I would ask that when an empty train is experienced, that it is confirmed that there are passengers waiting for the destination station. Once that is confirmed we can start diagnosing further.

Issue 3 Once more related to station logic, there seems to be an edge case where when more than 2 stations are selected, that the locomotive gets stuck cycling between the same 2 stations.

Again, a screenshot of the selected stations and the player log will help to diagnose this edge case.


Finally, listing the steps to reproduce these will help either Erabior or myself reproduce it and introduce a patch.

I also ask that you confirm whether the issues listed above (if accurate) are present in 1.0.1.10 which was prior to the new station load/unload logic.

nitroSkirata commented 10 months ago

Bryson-->Ela-->Bryson-->Ela-->Whittier-->...->Sylva issue:

Train arrives from the last round of Bryson->...->Sylva-->...-->Bryson at Bryson. Engine gets detached for refueling and watering whilst Passengers are transfered.

When the engine is reattached, and the RouteManager is activated, it will always try to go to Bryson before running the intended route.

If Bryson is selected before starting the RM, the Engine will take off towards Ela and stop once it left the Bryson station limit (the point where it sounds the whistle on approach). It will now return to Bryson and only then start to run the route proper.

If Bryson gets selected later on, the engine drives to the next station (Ela), disembarks the passengers, takes on passengers for Bryson and goes there.

After reaching Bryson and exchanging Pax, the engine drives the route as intended.

All of this seems to have happend only after version 1.0.1.10. in early versions of the mod the problem did not occur.

Here is a video and the log for all stations selected: https://youtu.be/F1pK085ZBY0

Player.log

AdamC1228 commented 10 months ago

~Nothing immediately stands out to me when comparing the code releases as to why the behavior would be different. Seems like I will have to stare at the code and your logs and try to reproduce based on what you have provided.~

Just noticed you edited your post and attached a video and the player log.

Strictly speaking to the video: This issue seems to be in the AutoEngineer logic not recognizing that it is already in the station limits for the station it is stopped at when RouteAI is activated. This behavior, however undesired, is (as I understand Erabior's code) more or less the expected behavior with the current design of the AI logic circuit.

New logic will need to be implemented to correct this. Since the AutoEngineer seems to recover itself and resume the trip this might be considered minor.

As for selecting Bryson later on, I will have to review the code logic and test before I comment on a potential fix.

nitroSkirata commented 10 months ago

Here is the Log and video, when the train is started close to Ela with all stations selected and instead of running the Route it dumps its pax at ela and returns to Bryson:

Player.log https://youtu.be/YfOJHQ_PfSc

And with Bryson selected after starting the RM: Player.log https://youtu.be/N9l7IF_xqX8

This behavior makes it impossible to just set the RouteManager going again in the middle of a run, as it has to be started with only those stations selected that are in the direction of the current run and the rest selected when the end is reached

Erabior commented 10 months ago

from my (limited) testing, I believe this issue should be fixed in Beta 1.0.1.13 Thumbs up if this latest beta fixes the issue so i know if i can close it.

nitroSkirata commented 10 months ago

I can confirm, the Issue seems to be resolved with Beta 1.0.1.13

nitroSkirata commented 10 months ago

Sorry, only partially fixed.

The train still goes Bryson->Ela->Bryson->...->Sylva but now at least retains the passengers at Ela, wich where previously diembarked.

Log: Player.log

AdamC1228 commented 10 months ago

I have published an alpha build of the V2 rewrite. Please test and report back if the new code shows any improvement on this issue.

AdamC1228 commented 9 months ago

This should be fixed as part of the improvements to V2. If the issue remains in V2 please open a new issue.

Illegal-Prime commented 9 months ago

Player-prev.log Encountered a similar bug at Alarka Jct where instead of stopping at Alarka Jct for the trip to Whittier, the train proceeds directly to Whittier without stopping at any intermediate stops. Presumably it believes Whittier to Alarka Jct is the route, rather than the reverse.