Erabior / RouteManager

Mod for Railroader the game that adds basic automation for passenger routes
12 stars 5 forks source link

V2 - RR Passenger.GetCenterPoint - Game Crash on getting centerpoint - RR Progression BUG #59

Closed armyf35 closed 7 months ago

armyf35 commented 7 months ago

When using the beta version (v2.0.0.2) I cannot get the mod to function.

Specifically the train will function as if in road mode using the direction set prior to enabling route mode and with the speed set by the slider.

Attached is the log file, config is default with LogLevel set to Trace, log should just contain the game starting, selecting the engine, trying to activate the mod and then exiting. Here is the error message and everything up to the most recent trace entry

2024-01-03 23:27:08Z - Dispatcher_V2.0.0.2 - TRA: ENTERED FUNCTION: GetClosestStation
2024-01-03 23:27:08Z - Dispatcher_V2.0.0.2 - DEB: Car BNSF 9063 calculating closest station...
2024-01-03 23:27:08Z - Dispatcher_V2.0.0.2 - VER: Car (Cork BNSF 9063) centerpoint (4437.55, 529.00, 5394.78) has value (4437.55, 529.00, 5394.78))
2024-01-03 23:27:08Z - Dispatcher_V2.0.0.2 - VER: Station center was: (24603.29, 620.60, -938.92)
2024-01-03 23:27:08Z - Dispatcher_V2.0.0.2 - VER: Car center was: (4437.55, 529.00, 5394.78)
2024-01-03 23:27:08Z - Dispatcher_V2.0.0.2 - VER: Station center was: (-29959.43, 539.00, -20076.18)
2024-01-03 23:27:08Z - Dispatcher_V2.0.0.2 - VER: Car center was: (4437.55, 529.00, 5394.78)
2024-01-03 23:27:08Z - Dispatcher_V2.0.0.2 - VER: Station center was: (-6324.65, 525.00, -1327.83)
2024-01-03 23:27:08Z - Dispatcher_V2.0.0.2 - VER: Car center was: (4437.55, 529.00, 5394.78)
Span P3ox is missing points or references (invalid)
TrackSpan P3ox failed to cache points
Uploading Crash Report
Exception: TrackSpan P3ox has no points
  at Track.TrackSpan.GetCenterPoint () [0x0004b] in <d1683bc7c5c14f74b69a8b6c783efbc1>:0 
  at RollingStock.PassengerStop.get_CenterPoint () [0x00009] in <d1683bc7c5c14f74b69a8b6c783efbc1>:0 
  at RouteManager.v2.core.StationManager.GetClosestStation (Model.Car currentCar) [0x00092] in <487d25a3c33f4c12aec041a198de9198>:0 
  at RouteManager.v2.core.StationManager.getNextStation (Model.Car locomotive) [0x00028] in <487d25a3c33f4c12aec041a198de9198>:0 
  at RouteManager.v2.core.AutoEngineer+<AutoEngineerControlRoutine>d__0.MoveNext () [0x000e5] in <487d25a3c33f4c12aec041a198de9198>:0 
  at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) [0x00026] in <16292a0376dd4a2e8ff79beef190c0a8>:0 
UnityEngine.MonoBehaviour:StartCoroutineManaged2(MonoBehaviour, IEnumerator)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
RouteManager.v2.Dispatcher:Update()

Player.log

AdamC1228 commented 7 months ago

At first blush, it would appear that this might be due to an underlying issue in the base game that is being exposed by the mod. Would you be adverse to providing a copy of your save for further testing to isolate this?

armyf35 commented 7 months ago

Tell me if this works, had to zip it for GitHub.

The train in question is the only passenger train, currently stopped outside the station in Bryson.

Save1.zip

AdamC1228 commented 7 months ago

Tell me if this works, had to zip it for GitHub.

The train in question is the only passenger train, currently stopped outside the station in Bryson.

Save1.zip

Yes that did work and I can reproduce the error through your save. I am convinced though that it is indeed a base game issue and as such I doubt this will be a fixable issue.

I am going to reach out to the devs through the Discord and see if they would be willing to have a dialogue with us. Hopefully they will be willing to entertain and discuss this with us but since this is exposed via an unsupported MOD, we will have to wait and see.

armyf35 commented 7 months ago

Thanks, Ill just stay on v1 for now since that seems to work.

I will mess around with it a bit later and see if I can get some more info. Also if you do make a bug report on discord can you link it please. Ill make sure to update that if I find anything else.

AdamC1228 commented 7 months ago

Thanks, Ill just stay on v1 for now since that seems to work.

I will mess around with it a bit later and see if I can get some more info. Also if you do make a bug report on discord can you link it please. Ill make sure to update that if I find anything else.

https://discord.com/channels/795878618697433097/1192341645891473438

dtwilliams10 commented 7 months ago

Experiencing the same issues here on the latest version. Excited for the new changes that were made, but it completely blows past the stations.

armyf35 commented 7 months ago

@AdamC1228 Just did some further testing, if you enable the map feature "Bryson Bridge to Fontana Bridge" you can successfully start the route mode. Player.log

Experiencing the same issues here on the latest version. Excited for the new changes that were made, but it completely blows past the stations.

@dtwilliams10 do you have the same error message in the log files, and if so have you unlocked the Bryson to Fontana bridge milestone yet?

AdamC1228 commented 7 months ago

@armyf35 Thanks for the update. That would make sense why I was not seeing the error as I already have those sections. ~I will update the issue with the devs over on discord.~

Thanks for updating the post with the information the devs needed.

AdamC1228 commented 7 months ago

Work around implemented to temporarily mitigate the crash until the developers figure out / fix the underlying issue.

The underlying issue appears to be that depending on the station and the users progression throughout the campaign play certain stations (typically at the farthest ends of the unlocked sections) have trouble calculating their center-point with the builtin function. Something that that function is relying upon is missing until the next section is unlocked.

Short term solution is to revert to Erabior's hard-coded station center logic in those instances. Alpha 2 will contain the updated code intended to mitigate this issue.

armyf35 commented 7 months ago

If you wanna laugh... its still throwing the error.

Seems like this line https://github.com/Erabior/RouteManager/blob/ac85fce7b8966db8ba15f1738cb377ab3cd80c94/v2/core/StationManager.cs#L108 is also causing it since it uses station.CenterPoint as well

AdamC1228 commented 7 months ago

Thanks, forgot to save the file before pushing but I already fixed it. ;)

armyf35 commented 7 months ago

Hah, I feel that... seems to be working well now though so thanks!

I did some further checking and it looks like only hemingway

Span P3ox is missing points or references (invalid)
TrackSpan P3ox failed to cache points

and alarkajct

Span Pwad is missing points or references (invalid)
TrackSpan Pwad failed to cache points

throw the errors.

Based on the fact those are then only two stations without any rails until their relevant milestone (Bryson Bridge to Fontana Bridge) is completed, my guess is that is causing the PassengerStop.CenterPoint->TrackSpan.GetCenterPoint calls in the base game to fail

AdamC1228 commented 7 months ago

Since this appears fixed. Closing.