Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array index error in MOM detour #29

Open
originalfoo opened this issue Apr 7, 2020 · 11 comments
Open

Array index error in MOM detour #29

originalfoo opened this issue Apr 7, 2020 · 11 comments

Comments

@originalfoo
Copy link

Full log: http://m.uploadedit.com/beth/1586289652925.txt

Simulation error: Array index is out of range.
at MetroOverhaul.Detours.PassengerTrainAIDetour.StartPathFind (uint16,Vehicle&) <0x004fc>
at PassengerTrainAI.SetTarget (uint16,Vehicle&,uint16) <0x00122>
at DepotAI.ProduceGoods (uint16,Building&,Building/Frame&,int,int,Citizen/BehaviourData&,int,int,int,int,int,int) <0x00827>
at TransportStationAI.ProduceGoods (uint16,Building&,Building/Frame&,int,int,Citizen/BehaviourData&,int,int,int,int,int,int) <0x0008f>
at PlayerBuildingAI.SimulationStepActive (uint16,Building&,Building/Frame&) <0x009cb>
at CommonBuildingAI.SimulationStep (uint16,Building&,Building/Frame&) <0x00e71>
at PlayerBuildingAI.SimulationStep (uint16,Building&,Building/Frame&) <0x0002f>
at DepotAI.SimulationStep (uint16,Building&,Building/Frame&) <0x0002a>
at TransportStationAI.SimulationStep (uint16,Building&,Building/Frame&) <0x002f8>
at BuildingAI.SimulationStep (uint16,Building&) <0x00060>
at (wrapper dynamic-method) CommonBuildingAI.SimulationStep_Patch1 (object,uint16,Building&) <0x00055>
at BuildingManager.SimulationStepImpl (int) <0x00675>
at SimulationManagerBase`2.SimulationStep (int) <0x0004c>
at BuildingManager.ISimulationManager.SimulationStep (int) <0x00024>
at SimulationManager.SimulationStep () <0x00693>
at SimulationManager.SimulationThread () <0x0018a>
  [Core]

The error above seems to trigger a recurring error as follows:

Simulation error: Array index is out of range.
  at TransportLine.GetPrevSegment (UInt16 stop) [0x00000] in <filename unknown>:0 
  at TransportLine.CanLeaveStop (UInt16 nextStop, Int32 waitTime) [0x00000] in <filename unknown>:0 
  at PassengerTrainAI.CanLeave (UInt16 vehicleID, .Vehicle& vehicleData) [0x00000] in <filename unknown>:0 
  at PassengerTrainAI.SimulationStep (UInt16 vehicleID, .Vehicle& vehicleData, .Frame& frameData, UInt16 leaderID, .Vehicle& leaderData, Int32 lodPhysics) [0x00000] in <filename unknown>:0 
  at VehicleAI.SimulationStep (UInt16 vehicleID, .Vehicle& vehicleData, UInt16 leaderID, .Vehicle& leaderData, Int32 lodPhysics) [0x00000] in <filename unknown>:0 
  at TrafficManager.Custom.AI.CustomTrainAI.CustomSimulationStep (UInt16 vehicleId, .Vehicle& vehicleData, Vector3 physicsLodRefPos) [0x00000] in <filename unknown>:0 
  at VehicleManager.SimulationStepImpl (Int32 subStep) [0x00000] in <filename unknown>:0 
  at SimulationManagerBase`2[Manager,Properties].SimulationStep (Int32 subStep) [0x00000] in <filename unknown>:0 
  at VehicleManager.ISimulationManager.SimulationStep (Int32 subStep) [0x00000] in <filename unknown>:0 
  at SimulationManager.SimulationStep () [0x00000] in <filename unknown>:0 
  at SimulationManager.SimulationThread () [0x00000] in <filename unknown>:0   [Core]
@originalfoo
Copy link
Author

originalfoo commented Apr 8, 2020

@pinnaval
Copy link

pinnaval commented Apr 10, 2020

Entire log file:output_log.txt

Simulation error: Array index is out of range.
at MetroOverhaul.Detours.PassengerTrainAIDetour.StartPathFind (uint16,Vehicle&) <0x004fc>
at PassengerTrainAI.SetTarget (uint16,Vehicle&,uint16) <0x00122>
at DepotAI.ProduceGoods (uint16,Building&,Building/Frame&,int,int,Citizen/BehaviourData&,int,int,int,int,int,int) <0x00827>
at TransportStationAI.ProduceGoods (uint16,Building&,Building/Frame&,int,int,Citizen/BehaviourData&,int,int,int,int,int,int) <0x0008f>
at PlayerBuildingAI.SimulationStepActive (uint16,Building&,Building/Frame&) <0x009cb>
at CommonBuildingAI.SimulationStep (uint16,Building&,Building/Frame&) <0x00e6d>
at PlayerBuildingAI.SimulationStep (uint16,Building&,Building/Frame&) <0x0002f>
at DepotAI.SimulationStep (uint16,Building&,Building/Frame&) <0x0002a>
at TransportStationAI.SimulationStep (uint16,Building&,Building/Frame&) <0x002f8>
at BuildingAI.SimulationStep (uint16,Building&) <0x00060>
at (wrapper dynamic-method) CommonBuildingAI.SimulationStep_Patch1 (object,uint16,Building&) <0x00055>
at BuildingManager.SimulationStepImpl (int) <0x00675>
at SimulationManagerBase`2.SimulationStep (int) <0x0004c>
at BuildingManager.ISimulationManager.SimulationStep (int) <0x00024>
at SimulationManager.SimulationStep () <0x00693>
at SimulationManager.SimulationThread () <0x0018a>
  [Core]

@StefanHue
Copy link

StefanHue commented Apr 24, 2020

Had the same error.
I could solve the problem by

  1. pausing the game (must be quick, between closing error-popup and next error-popup),
  2. closing the error-popup like 20 times until it did not appear again,
  3. deleting all traffic (TM:PE) and then disabling Inter-City-Traffic on the metro-parts of my (modular) railway/metro-station (and then unpausing). Seems working so far, playing 1h without error :)

Edit: Played now for several hours and error did not occur again, so this seems to fix it.

@15six
Copy link

15six commented May 13, 2020

I had the same issue, @StefanHue's solution worked for me. However, now CS just crashes whenever I try saving.

I'm getting this line heaps of times right before the crash:

Error with BUILDING_SHORT_DESC[1412775439.Elevated - Glass - Station_Data_XANALOGX_Metro]:0: The id was not found in the localization files.  [Localization - Internal]
 
(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

It's about a train station that I set up as a metrostation instead, and where I had to disable intercity trains.

Full log:
output_log.txt

@originalfoo
Copy link
Author

@15six That's just missing translation of the station name; it shouldn't cause any issues.

If CS is crashing while saving, it could be lack of RAM. Try reducing number of assets to free RAM, and if you have Loading Screen Mod make sure all it's sharing/optimisation features are enabled.

@15six
Copy link

15six commented May 14, 2020

@aubergine10 I'll try removing some assets (should've done that ages ago anyways), but I doubt the RAM's the issue. It's saving fine before I apply @StefanHue's workaround, but when I try to save right after disabling intercity traffic it just crashes.

@originalfoo
Copy link
Author

Another approach could be to use "Safe Mode" options in loading screen mod, load the save (all traffic will be cleared by LSM safe mode), then disable inter-city traffic on metro stations?

I'm just guessing, but it's likely that the game was trying to send trains to what it perceives to be intercity stations, only to find that they are now metro stations that don't accept intercity trains.

@15six
Copy link

15six commented May 16, 2020

I eventually found that another metro station which I used near the edge of the map was the culprit. It still had intercity trains checked. It's been working fine ever since. Thanks for the help!

@Monniasza
Copy link

I eventually found that another metro station which I used near the edge of the map was the culprit. It still had intercity trains checked. It's been working fine ever since. Thanks for the help!

Metro Overhaul Mod should disable intercity traffic for metro tracks by default.

@jakejcheng
Copy link

@StefanHue Thank you it worked! Though I only cleared the traffic in TM:PE.

@wusatosi
Copy link

I've encountered this issue as well, though I need my station (a metro & train hybrid) to be able to accept both intercity and innercity trains. Is it possible to get a fix on this? @bloodypenguin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants