RimWorld

RimWorld

Windows
tcw7468 29 Oct, 2021 @ 7:26pm
Bug involving ore chunk maps
I've noticed a very strange bug seemingly unrelated to windows when using this mod; when I enter a scanned ore quest map, the ore doesn't appear, and the biome features are replaced with a dirt map. Upon looking at the logs, and activating verbose logs, I get this:

Error in GenStep: System.IndexOutOfRangeException: Index was outside the bounds of the array. at Verse.EdificeGrid.get_Item (Verse.IntVec3 c) [0x00017] in <e13bd2f1929544099ed2b58e66ece833>:0 at Verse.GridsUtility.GetEdifice (Verse.IntVec3 c, Verse.Map map) [0x00000] in <e13bd2f1929544099ed2b58e66ece833>:0 at Verse.GenGrid.CanBeSeenOverFast (Verse.IntVec3 c, Verse.Map map) [0x00000] in <e13bd2f1929544099ed2b58e66ece833>:0 at OpenTheWindows.Building_Window+ScanLine.IsClear (Verse.IntVec3 c, System.Boolean inside) [0x00009] in <910ee7ac4fff4711b290223235640184>:0 at OpenTheWindows.Building_Window+ScanLine+<>c__DisplayClass32_0.<Unobstructed>b__0 (Verse.IntVec3 target, System.Boolean inside) [0x0000e] in <910ee7ac4fff4711b290223235640184>:0 at OpenTheWindows.WindowUtility.ClearForward (Verse.IntVec3 position, System.Boolean horizontal, OpenTheWindows.WindowUtility+cellTest test, System.Boolean inside, System.Int32 dist, Verse.IntVec3& output) [0x0002e] in <910ee7ac4fff4711b290223235640184>:0 at OpenTheWindows.Building_Window+ScanLine.Unobstructed (Verse.IntVec3 motivator, System.Boolean removed) [0x000c7] in <910ee7ac4fff4711b290223235640184>:0 at OpenTheWindows.Building_Window+ScanLine.FindObstruction (Verse.IntVec3 motivator, System.Boolean removed, Verse.Map updatedMap) [0x00017] in <910ee7ac4fff4711b290223235640184>:0 at OpenTheWindows.Building_Window.MapUpdateHandler (System.Object sender, OpenTheWindows.MapUpdateWatcher+MapUpdateInfo info) [0x0007b] in <910ee7ac4fff4711b290223235640184>:0 at (wrapper delegate-invoke) System.EventHandler`1[OpenTheWindows.MapUpdateWatcher+MapUpdateInfo].invoke_void_object_TEventArgs(object,OpenTheWindows.MapUpdateWatcher/MapUpdateInfo) at OpenTheWindows.MapUpdateWatcher.OnMapUpdate (System.Object sender, OpenTheWindows.MapUpdateWatcher+MapUpdateInfo info) [0x00009] in <910ee7ac4fff4711b290223235640184>:0 at OpenTheWindows.ThingGrid_Register.Postfix (Verse.Thing t, Verse.IntVec3 c) [0x00058] in <910ee7ac4fff4711b290223235640184>:0 at (wrapper dynamic-method) Verse.ThingGrid.Verse.ThingGrid.RegisterInCell_Patch1(Verse.ThingGrid,Verse.Thing,Verse.IntVec3) at (wrapper dynamic-method) Verse.ThingGrid.Verse.ThingGrid.Register_Patch3(Verse.ThingGrid,Verse.Thing) at (wrapper dynamic-method) Verse.Thing.Verse.Thing.SpawnSetup_Patch2(Verse.Thing,Verse.Map,bool) at Verse.ThingWithComps.SpawnSetup (Verse.Map map, System.Boolean respawningAfterLoad) [0x00000] in <e13bd2f1929544099ed2b58e66ece833>:0 at (wrapper dynamic-method) Verse.Building.Verse.Building.SpawnSetup_Patch1(Verse.Building,Verse.Map,bool) at (wrapper dynamic-method) Verse.GenSpawn.Verse.GenSpawn.Spawn_Patch4(Verse.Thing,Verse.IntVec3,Verse.Map,Verse.Rot4,Verse.WipeMode,bool) at Verse.GenSpawn.Spawn (Verse.Thing newThing, Verse.IntVec3 loc, Verse.Map map, Verse.WipeMode wipeMode) [0x00008] in <e13bd2f1929544099ed2b58e66ece833>:0 at Verse.GenSpawn.Spawn (Verse.ThingDef def, Verse.IntVec3 loc, Verse.Map map, Verse.WipeMode wipeMode) [0x00007] in <e13bd2f1929544099ed2b58e66ece833>:0 at RimWorld.GenStep_RocksFromGrid.Generate (Verse.Map map, Verse.GenStepParams parms) [0x000e9] in <e13bd2f1929544099ed2b58e66ece833>:0 at Verse.MapGenerator.GenerateContentsIntoMap (System.Collections.Generic.IEnumerable`1[T] genStepDefs, Verse.Map map, System.Int32 seed) [0x000d2] in <e13bd2f1929544099ed2b58e66ece833>:0 UnityEngine.StackTraceUtility:ExtractStackTrace () (wrapper dynamic-method) Verse.Log:Verse.Log.Error_Patch2 (string) Verse.MapGenerator:GenerateContentsIntoMap (System.Collections.Generic.IEnumerable`1<Verse.GenStepWithParams>,Verse.Map,int) (wrapper dynamic-method) Verse.MapGenerator:Verse.MapGenerator.GenerateMap_Patch3 (Verse.IntVec3,RimWorld.Planet.MapParent,Verse.MapGeneratorDef,System.Collections.Generic.IEnumerable`1<Verse.GenStepWithParams>,System.Action`1<Verse.Map>) Verse.GetOrGenerateMapUtility:GetOrGenerateMap (int,Verse.IntVec3,RimWorld.WorldObjectDef) RimWorld.Planet.CaravanArrivalAction_VisitSite:DoEnter (RimWorld.Planet.Caravan,RimWorld.Planet.Site) RimWorld.Planet.CaravanArrivalAction_VisitSite/<>c__DisplayClass8_0:<Arrived>b__0 () Verse.LongEventHandler:UpdateCurrentSynchronousEvent (bool&) Verse.LongEventHandler:LongEventsUpdate (bool&) (wrapper dynamic-method) Verse.Root:Verse.Root.Update_Patch1 (Verse.Root) Verse.Root_Play:Update ()

No error messages pop up when not in development mode. I tried disabling Real Ruins, thinking that a window there may have caused something, but I have the same problem with that mod off. Disabling only this mod restores normal behaviour. Replacing this mod with the other fork still creates this error. It may be a conflict with another mod, but I'm not sure which mod that would be. This seems to only happen for quest ore maps, but one ore vein had worked before without problems in the same playthrough, and it has always worked before the most recent update. Could you look into this and see what may be wrong?
< >
Showing 1-7 of 7 comments
Owlchemist  [developer] 29 Oct, 2021 @ 7:43pm 
Thanks, this is hopefully fixed now.
tcw7468 29 Oct, 2021 @ 8:11pm 
Wow, thanks for the quick response! Unfortunately I still have the same problem. I've tried unsub/resub to ensure my files are updated (and checked the date modified tag). The logs show the exact same error, except a few different hex values. I'll try again tomorrow just in case there's some weirdness with the Steam servers.

Again thanks for the awesome work!

In case you need the different hex values, the new log is:

ROCKETMAN: <color=red>Warm up</color> started for new map! Error in GenStep: System.IndexOutOfRangeException: Index was outside the bounds of the array. at Verse.EdificeGrid.get_Item (Verse.IntVec3 c) [0x00017] in <e13bd2f1929544099ed2b58e66ece833>:0 at Verse.GridsUtility.GetEdifice (Verse.IntVec3 c, Verse.Map map) [0x00000] in <e13bd2f1929544099ed2b58e66ece833>:0 at Verse.GenGrid.CanBeSeenOverFast (Verse.IntVec3 c, Verse.Map map) [0x00000] in <e13bd2f1929544099ed2b58e66ece833>:0 at OpenTheWindows.Building_Window+ScanLine.IsClear (Verse.IntVec3 c, System.Boolean inside) [0x00009] in <ac72ca0ca2c04d1ea0add28efba9a527>:0 at OpenTheWindows.Building_Window+ScanLine+<>c__DisplayClass32_0.<Unobstructed>b__0 (Verse.IntVec3 target, System.Boolean inside) [0x0000e] in <ac72ca0ca2c04d1ea0add28efba9a527>:0 at OpenTheWindows.WindowUtility.ClearForward (Verse.IntVec3 position, System.Boolean horizontal, OpenTheWindows.WindowUtility+cellTest test, System.Boolean inside, System.Int32 dist, Verse.IntVec3& output) [0x0002e] in <ac72ca0ca2c04d1ea0add28efba9a527>:0 at OpenTheWindows.Building_Window+ScanLine.Unobstructed (Verse.IntVec3 motivator, System.Boolean removed) [0x000c7] in <ac72ca0ca2c04d1ea0add28efba9a527>:0 at OpenTheWindows.Building_Window+ScanLine.FindObstruction (Verse.IntVec3 motivator, System.Boolean removed, Verse.Map updatedMap) [0x00017] in <ac72ca0ca2c04d1ea0add28efba9a527>:0 at OpenTheWindows.Building_Window.MapUpdateHandler (System.Object sender, OpenTheWindows.MapUpdateWatcher+MapUpdateInfo info) [0x0008b] in <ac72ca0ca2c04d1ea0add28efba9a527>:0 at (wrapper delegate-invoke) System.EventHandler`1[OpenTheWindows.MapUpdateWatcher+MapUpdateInfo].invoke_void_object_TEventArgs(object,OpenTheWindows.MapUpdateWatcher/MapUpdateInfo) at OpenTheWindows.MapUpdateWatcher.OnMapUpdate (System.Object sender, OpenTheWindows.MapUpdateWatcher+MapUpdateInfo info) [0x00009] in <ac72ca0ca2c04d1ea0add28efba9a527>:0 at OpenTheWindows.ThingGrid_Register.Postfix (Verse.Thing t, Verse.IntVec3 c) [0x00058] in <ac72ca0ca2c04d1ea0add28efba9a527>:0 at (wrapper dynamic-method) Verse.ThingGrid.Verse.ThingGrid.RegisterInCell_Patch1(Verse.ThingGrid,Verse.Thing,Verse.IntVec3) at (wrapper dynamic-method) Verse.ThingGrid.Verse.ThingGrid.Register_Patch3(Verse.ThingGrid,Verse.Thing) at (wrapper dynamic-method) Verse.Thing.Verse.Thing.SpawnSetup_Patch2(Verse.Thing,Verse.Map,bool) at Verse.ThingWithComps.SpawnSetup (Verse.Map map, System.Boolean respawningAfterLoad) [0x00000] in <e13bd2f1929544099ed2b58e66ece833>:0 at (wrapper dynamic-method) Verse.Building.Verse.Building.SpawnSetup_Patch1(Verse.Building,Verse.Map,bool) at (wrapper dynamic-method) Verse.GenSpawn.Verse.GenSpawn.Spawn_Patch4(Verse.Thing,Verse.IntVec3,Verse.Map,Verse.Rot4,Verse.WipeMode,bool) at Verse.GenSpawn.Spawn (Verse.Thing newThing, Verse.IntVec3 loc, Verse.Map map, Verse.WipeMode wipeMode) [0x00008] in <e13bd2f1929544099ed2b58e66ece833>:0 at Verse.GenSpawn.Spawn (Verse.ThingDef def, Verse.IntVec3 loc, Verse.Map map, Verse.WipeMode wipeMode) [0x00007] in <e13bd2f1929544099ed2b58e66ece833>:0 at RimWorld.GenStep_RocksFromGrid.Generate (Verse.Map map, Verse.GenStepParams parms) [0x000e9] in <e13bd2f1929544099ed2b58e66ece833>:0 at Verse.MapGenerator.GenerateContentsIntoMap (System.Collections.Generic.IEnumerable`1[T] genStepDefs, Verse.Map map, System.Int32 seed) [0x000d2] in <e13bd2f1929544099ed2b58e66ece833>:0 (Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 39)
Owlchemist  [developer] 29 Oct, 2021 @ 8:28pm 
I see, I see. Yeah it was a theoretical fix since I can't reproduce it myself, but I could see why it could potentially happen so I was trying to make the code more defensive. It seems the problem is happening elsewhere in the code, then.

I just pushed an attempt #2 fix out now. Hope it helps.
tcw7468 29 Oct, 2021 @ 8:42pm 
This attempt fixed it! Thanks for the help!
Owlchemist  [developer] 29 Oct, 2021 @ 8:44pm 
Out of curiosity, when you arrived at the map that was giving you errors, did you see any windows anywhere? Like in the ruins. The code that was erroring was tied to an instance of a window, but I wouldn't expect windows to just be spawning on their own like that.
tcw7468 29 Oct, 2021 @ 9:14pm 
I don't remember seeing any windows, but they could have been hidden in the FOW or I may have just missed them. I have Real Ruins, so windows are bound to pop up once in a while, as that mod uses real player bases and preserves modded content, which is actually why I tested disabling that mod first when trying to find the problem. It doesn't explain why the problem still happened with that mod off though. I'll keep an eye out though and let you know if I see any windows out in the wild that don't appear to be in a player ruin.
Owlchemist  [developer] 29 Oct, 2021 @ 9:34pm 
> It doesn't explain why the problem still happened with that mod off though.

If the map data was internally generated (between quest generation and actually visiting the map) and then after that you disabled real runes, it may not have made any difference. That's my best guess.
< >
Showing 1-7 of 7 comments
Per page: 1530 50