IndexOutOfRangeException exception when open a save, on Windows

Started by mirrornexto, July 29, 2017, 11:51:03 AM

Previous topic - Next topic

mirrornexto

I'm getting an exception when trying to open a game save. This issue only happens on my Windows machine. I happen to have 2 Macs and they both work fine.

The game file for the colony was first initiated on the Mac with the mods:

HugsLib
JTReplaceWalls [A17]
QualityBuilder
Allow Tool
QualitySurgeon
Moody
Stack Merger
Hand Me That Brick

I'm running the Steam version of the game on all 3 machines and using SteamCloud to share saves.

This issue only happens when I try to open this specific colony save. This that I already tried without success:

- Created other save files
- Disabled all the mods and saved the game again
- Reinstalled RimWorld on Windows and deleted all caches (in the Steam folder and in the AppData folder)
- Open the first save file just after the colonists land on the planet (which means that I have 0 construction on the map)

Both Macs open any save file for that colony no problem. This issue only happens on my Windows machine.

My specs:
Windows 10 Pro build 15063.483
Both Macs: Mac OS Sierra

Here is the error log: https://pastebin.com/wuUq9MQ4

I'll paste part of the exception here just in case other people are searching for the same issue and it can be indexed:


Exception from asynchronous event: System.IndexOutOfRangeException: Array index is out of range.
  at RimWorld.Planet.WorldPathFinder.FloodPathsWithCost (System.Collections.Generic.List`1 startTiles, System.Func`3 costFunc, System.Func`2 impassable, System.Func`3 terminator) [0x00000] in <filename unknown>:0
  at RimWorld.Planet.WorldGenStep_Roads.GenerateProspectiveLinks (System.Collections.Generic.List`1 indexToTile) [0x00000] in <filename unknown>:0
  at RimWorld.Planet.WorldGenStep_Roads.GenerateRoadNetwork () [0x00000] in <filename unknown>:0
  at RimWorld.Planet.WorldGenStep_Roads.GenerateFromScribe (System.String seed) [0x00000] in <filename unknown>:0
  at RimWorld.Planet.World.ExposeData () [0x00000] in <filename unknown>:0
  at Verse.Game.LoadGame () [0x00000] in <filename unknown>:0
  at Verse.SavedGameLoader.LoadGameFromSaveFile (System.String fileName) [0x00000] in <filename unknown>:0
  at Verse.Root_Play.<Start>m__84F () [0x00000] in <filename unknown>:0
  at Verse.LongEventHandler.RunEventFromAnotherThread (System.Action action) [0x00000] in <filename unknown>:0


From the exception, it looks like it's a colony location on the map issue. I can open the World map on the Macs no problem, but on Windows, I can't even open any save file from this colony.

I also created a new colony on the Mac, saved a new game file and it opens file on Windows. It looks like that specific colony has some corrupted data that the Windows build can't read.

Here is a sample save file: https://www.dropbox.com/s/xm7lgaowbcv3pgn/Nexts-start.rws

milon

This is likely a mod-related issue, but I'm going to leave this thread here for now. The fact that you can open it on Mac and not on Windows seems important (but in the end it could be related to how the two handle errors).

EDIT - Forgot to say that I didn't have any immediate ideas, but I'd continue to think about it

Calahan

This maybe the same issue as this other support thread: https://ludeon.com/forums/index.php?topic=34027.0

Edit - Quick check of the two logs shows the following error at the top of them both (which is probably not a coincidence)

Exception from asynchronous event: System.IndexOutOfRangeException: Array index is out of range.
  at RimWorld.Planet.WorldPathFinder.FloodPathsWithCost (System.Collections.Generic.List`1 startTiles, System.Func`3 costFunc, System.Func`2 impassable, System.Func`3 terminator) [0x00000] in <filename unknown>:0
  at RimWorld.Planet.WorldGenStep_Roads.GenerateProspectiveLinks (System.Collections.Generic.List`1 indexToTile) [0x00000] in <filename unknown>:0
  at RimWorld.Planet.WorldGenStep_Roads.GenerateRoadNetwork () [0x00000] in <filename unknown>:0
  at RimWorld.Planet.WorldGenStep_Roads.GenerateFromScribe (System.String seed) [0x00000] in <filename unknown>:0
  at RimWorld.Planet.World.ExposeData () [0x00000] in <filename unknown>:0
  at Verse.Game.LoadGame () [0x00000] in <filename unknown>:0
  at Verse.SavedGameLoader.LoadGameFromSaveFile (System.String fileName) [0x00000] in <filename unknown>:0
  at Verse.Root_Play.<Start>m__84F () [0x00000] in <filename unknown>:0
  at Verse.LongEventHandler.RunEventFromAnotherThread (System.Action action) [0x00000] in <filename unknown>:0

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 42)


Starting to think this might be a bug, but the devs might need to have a vanilla save that reproduces this to confirm it (assuming it's not 100% reliably reproduced with any Mac>Windows save transfers, which it might be but I have no access to a Mac to confirm it myself).

milon

Good call, Calahan!

@mirrornexto, how are you transferring save files?  If you're relying on Steam sync, try a manual file transfer instead:

  • On the Mac, copy the .rws to a flash drive
  • Connect the flash drive to the Windows PC
  • Launch RimWorld on the Windows PC (important - this makes it play nice with Steam Sync)
  • Go into Options and click the button to open your save data location
  • Copy your .rws from the flash drive to the Windows PC RimWorld save folder
  • Go back to RimWorld and attempt to load the colony file

Let us know if that works!

mirrornexto

Tried the suggestion and no luck. Same problem.

1. For you previous question, yes, I'm using Steam Sync to share the saved between the 2 Macs and the Windows machine.
2. In my initial post I've shared the link to the save file that got from one of the Macs.
3. I tried reproducing this error by creating another colony on the Mac but the new colony file works fine my Windows machine.

And yes Calahan, the issue seems to be exactly the same as the link you shared.

It looks like both games started the colony on the Mac.

milon

Thanks for the update. This is a difficult one for sure.

About the test coming you recently created on the Mac that works on Windows - is it vanilla or does it include mods too?

mirrornexto

Yeah, even with all the mods enabled a new colony works fine on Windows.

But I must say that based on the stacktrace, it looks like the error is a bug in the game, not mods. The error is during the world generation of roads and paths. I wonder if that's has anything to do with the seed of my world and the location of my colony.

mirrornexto

I'm able to reproduce this with all mods disabled. So It's not a mod issue, it's a bug in the game.

Here are the steps:

1. Follow these steps on the mac.
2. Generate a world with the seed "peza" and 50% coverage
3. Place your colony at location really close to coordinates 38.78ºS 4.37ºE. In my tests I was placing it right next to the river.
4. Save the game, and open it on a Windows machine (I'm using Steam Sync to move the save files)


I'm unsure if all those steps are necessary. I didn't spend more time on this eliminating unrelated stuff, I'm guessing if a dev have the debugger on, he'll be able to see what is going wrong.

My guess stands that it's related to the seed of the world and the location of the colony on the planet.

milon

@mirrornexto, thanks for narrowing that down & for the reproducer steps!  I don't have a Mac, but I'm flagging this to other mods/admins and we'll see if anyone else can reproduce it.  Also, I haven't had time to see if the bug can be created on a Windows machine alone, so that would be good for someone to test.

Xgkkp

I am having this exact same issue. 0.17.1557, Started a game on my Mac, copied over to windows by manually moving the save. Save is here: https://www.dropbox.com/s/psuura5ac30fv7v/Graton.7z

Exception from asynchronous event: System.IndexOutOfRangeException: Array index is out of range.
  at RimWorld.Planet.WorldPathFinder.FloodPathsWithCost (System.Collections.Generic.List`1 startTiles, System.Func`3 costFunc, System.Func`2 impassable, System.Func`3 terminator) [0x00000] in <filename unknown>:0
  at RimWorld.Planet.WorldGenStep_Roads.GenerateProspectiveLinks (System.Collections.Generic.List`1 indexToTile) [0x00000] in <filename unknown>:0
  at RimWorld.Planet.WorldGenStep_Roads.GenerateRoadNetwork () [0x00000] in <filename unknown>:0
  at RimWorld.Planet.WorldGenStep_Roads.GenerateFromScribe (System.String seed) [0x00000] in <filename unknown>:0
  at RimWorld.Planet.World.ExposeData () [0x00000] in <filename unknown>:0
  at Verse.Game.LoadGame () [0x00000] in <filename unknown>:0
  at Verse.SavedGameLoader.LoadGameFromSaveFile (System.String fileName) [0x00000] in <filename unknown>:0
  at Verse.Root_Play.<Start>m__84F () [0x00000] in <filename unknown>:0
  at Verse.LongEventHandler.RunEventFromAnotherThread (System.Action action) [0x00000] in <filename unknown>:0
Verse.Log:Error(String)
Verse.LongEventHandler:RunEventFromAnotherThread(Action)
Verse.LongEventHandler:<UpdateCurrentAsynchronousEvent>m__84C()


No mods, never installed any onto the machine I was using. I presume this classes as a bug but won't file one until I can get access to the machine and validate that the file wasn't somehow corrupted whilst moving it over.