RimWorld

RimWorld

Adaptive Storage Framework
 This topic has been pinned, so it's probably important
Soul  [developer] 10 Sep, 2023 @ 12:05pm
BUG REPORTS
This is the bug report thread.

We would prefer if you'd instead use our Github Issues page for bug reports.
https://github.com/bbradson/Adaptive-Storage-Framework/issues


Otherwise, please comment down below any and all bugs or mod incompatibilities you may find using our mod.

MAKE SURE TO INCLUDE YOUR HUGSLIB LOG!

Without a log, your message will very likely be ignored!
Last edited by Soul; 27 Dec, 2024 @ 3:13am
< >
Showing 1-15 of 91 comments
AtomicRobot 1 Apr, 2024 @ 9:49am 
I might've found a bug with buildings that have <showContainedItems>true</showContainedItems> set in the def.

When Receiving or Losing Items it runs into a NullReferenceException.

Excerpt from my Log [gist.github.com]

JobDriver threw exception in toil PlaceHauledThingInCell's initAction for pawn Anarchist driver=JobDriver_HaulToCell (toilIndex=10) driver.job=(HaulToCell (Job_12517) A=Thing_MinifiedThing48371 B=(102, 0, 148)) System.NullReferenceException: Object reference not set to an instance of an object at AdaptiveStorage.ExtensionMethods.Overlaps[TCollection,TElement] (TCollection a, System.Collections.Generic.List`1[T] b) [0x00000] in <8177e67c484c498f9b0902efcfae71c0>:0 at AdaptiveStorage.GraphicsDef.Allows (Verse.ThingDef thingDef) [0x00013] in <8177e67c484c498f9b0902efcfae71c0>:0 at AdaptiveStorage.GraphicsDef.Allows[T] (T thingDefs) [0x0006e] in <8177e67c484c498f9b0902efcfae71c0>:0 at AdaptiveStorage.StorageRenderer.GetGraphicVariationIndexForStoredThings () [0x00064] in <8177e67c484c498f9b0902efcfae71c0>:0 at AdaptiveStorage.StorageRenderer.CalculateGraphicIndex () [0x00000] in <8177e67c484c498f9b0902efcfae71c0>:0 at AdaptiveStorage.StorageRenderer.UpdateCurrentGraphic () [0x00007] in <8177e67c484c498f9b0902efcfae71c0>:0 at AdaptiveStorage.ThingClass.Notify_ReceivedThing (Verse.Thing newItem) [0x0002e] in <8177e67c484c498f9b0902efcfae71c0>:0 at (wrapper dynamic-method) Verse.Thing.Verse.Thing.SpawnSetup_Patch3(Verse.Thing,Verse.Map,bool) at (wrapper dynamic-method) Verse.ThingWithComps.Verse.ThingWithComps.SpawnSetup_Patch3(Verse.ThingWithComps,Verse.Map,bool) at (wrapper dynamic-method) Verse.GenSpawn.Verse.GenSpawn.Spawn_Patch5(Verse.Thing,Verse.IntVec3,Verse.Map,Verse.Rot4,Verse.WipeMode,bool) at Verse.GenPlace.SplitAndSpawnOneStackOnCell (Verse.Thing thing, Verse.IntVec3 loc, Verse.Rot4 rot, Verse.Map map, Verse.Thing& resultingThing, System.Action`2[T1,T2] placedAction) [0x00029] in <cd7169108ea74757aa50c5b33d275c15>:0 at Verse.GenPlace.TryPlaceDirect (Verse.Thing thing, Verse.IntVec3 loc, Verse.Rot4 rot, Verse.Map map, Verse.Thing& resultingThing, System.Action`2[T1,T2] placedAction) [0x00129] in <cd7169108ea74757aa50c5b33d275c15>:0 at Verse.GenPlace.TryPlaceThing (Verse.Thing thing, Verse.IntVec3 center, Verse.Map map, Verse.ThingPlaceMode mode, Verse.Thing& lastResultingThing, System.Action`2[T1,T2] placedAction, System.Predicate`1[T] nearPlaceValidator, Verse.Rot4 rot) [0x00032] in <cd7169108ea74757aa50c5b33d275c15>:0 at (wrapper dynamic-method) Verse.GenDrop.Verse.GenDrop.TryDropSpawn_Patch1(Verse.Thing,Verse.IntVec3,Verse.Map,Verse.ThingPlaceMode,Verse.Thing&,System.Action`2<Verse.Thing, int>,System.Predicate`1<Verse.IntVec3>,bool) at Verse.ThingOwner.TryDrop (Verse.Thing thing, Verse.IntVec3 dropLoc, Verse.Map map, Verse.ThingPlaceMode mode, Verse.Thing& lastResultingThing, System.Action`2[T1,T2] placedAction, System.Predicate`1[T] nearPlaceValidator, System.Boolean playDropSound) [0x00034] in <cd7169108ea74757aa50c5b33d275c15>:0 at Verse.ThingOwner`1[T].TryDrop (Verse.Thing thing, Verse.IntVec3 dropLoc, Verse.Map map, Verse.ThingPlaceMode mode, T& lastResultingThing, System.Action`2[T1,T2] placedAction, System.Predicate`1[T] nearPlaceValidator) [0x00025] in <cd7169108ea74757aa50c5b33d275c15>:0 at Verse.Pawn_CarryTracker.TryDropCarriedThing (Verse.IntVec3 dropLoc, Verse.ThingPlaceMode mode, Verse.Thing& resultingThing, System.Action`2[T1,T2] placedAction) [0x00018] in <cd7169108ea74757aa50c5b33d275c15>:0 at Verse.AI.Toils_Haul+<>c__DisplayClass6_0.<PlaceHauledThingInCell>b__0 () [0x00102] in <cd7169108ea74757aa50c5b33d275c15>:0 at AllowTool.Patches.ToilsHaul_PlaceInCell_Patch+<>c__DisplayClass0_0.<ClearHaulUrgently>b__0 () [0x00042] in <d3e3fec3eced4dceb8190139680bcabd>:0 at Verse.AI.JobDriver.TryActuallyStartNextToil () [0x001b0] in <cd7169108ea74757aa50c5b33d275c15>:0 (Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 39)

The building in Question was a pallet from the Basic Storage mod that, at the time, allowed buildings to be stored on it.
BaalEvan 2 May, 2024 @ 9:33pm 
I found incompatibilty with MinifyEverything mod. https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=872762753

Without ASF and with only ASF i can haul minified things into storage zone. If i install any mod thats is using ASF (Tested: ASF:Neolithic and Phaneron's basic storage and Reel Storage).
Then i can see [~] instead checkmark next to Building/Misc, and even if i [allow all] MinifiedThings aren't compatible with storage. And can't be stored anywhere

I think it is problem with ASF because even Neolithic mod made by You is causing this problem.
Andromeda 3 May, 2024 @ 10:17am 
Hi, I'm the developer of Packable Containers. I found an incompatibility issue
I see you are using transpiler, so I let myself look for the cause of the error. I found that MaxItemsForCell in ThingClass accesses the array index without checking validity in any way. This is the problem.
The incompatibility occurs when calling vanilla method GenPlace.TryPlaceThing(item, Cell, map, ThingPlaceMode.Direct). This is weird

Originally posted by log:
JobDriver threw exception in toil MakeSolidThingFromBlueprintIfNecessary's initAction for pawn Nordbo driver=JobDriver_HaulToContainer (toilIndex=8) driver.job=(HaulToContainer (Job_387) A = Thing_MinifiedThing14056 B = Thing_Blueprint_Install_ReelStorageMedicineCabinet14054 Giver = JobGiver_Work [workGiverDef: DeliverResourcesToBlueprints])
System.IndexOutOfRangeException: Index was outside the bounds of the array.
[Ref B7159070]
at AdaptiveStorage.ThingClass.MaxItemsForCell (Verse.IntVec3& cell) [0x00020] in <df4d3ba5493c429da6910dff5f660cdf>:0
at AdaptiveStorage.ThingClass.GetMaxItemsForCell (Verse.IntVec3& cell) [0x00000] in <df4d3ba5493c429da6910dff5f660cdf>:0
at Verse.GridsUtility.GetMaxItemsAllowedInCell (Verse.IntVec3 c, Verse.Map map) [0x00028] in <957a20e0be784a65bc32cf449445b937>:0
- TRANSPILER adaptive.storage.framework: IEnumerable`1 AdaptiveStorage.HarmonyPatches.StorageLimit:Transpiler(IEnumerable`1 instructions, ILGenerator generator, MethodBase targetMethod)
at Verse.GenPlace.TryPlaceDirect (Verse.Thing thing, Verse.IntVec3 loc, Verse.Rot4 rot, Verse.Map map, Verse.Thing& resultingThing, System.Action`2[T1,T2] placedAction) [0x000fa] in <957a20e0be784a65bc32cf449445b937>:0
at Verse.GenPlace.TryPlaceThing (Verse.Thing thing, Verse.IntVec3 center, Verse.Map map, Verse.ThingPlaceMode mode, Verse.Thing& lastResultingThing, System.Action`2[T1,T2] placedAction, System.Predicate`1[T] nearPlaceValidator, Verse.Rot4 rot) [0x00032] in <957a20e0be784a65bc32cf449445b937>:0
at Verse.GenPlace.TryPlaceThing (Verse.Thing thing, Verse.IntVec3 center, Verse.Map map, Verse.ThingPlaceMode mode, System.Action`2[T1,T2] placedAction, System.Predicate`1[T] nearPlaceValidator, Verse.Rot4 rot) [0x00000] in <957a20e0be784a65bc32cf449445b937>:0
at PortableContainers.Patches.Postfix (RimWorld.Building_Storage __instance, Verse.Map map, System.Boolean respawningAfterLoad) [0x000be] in <f8680db09039493a94c8ecd388108b67>:0
at RimWorld.Building_Storage.SpawnSetup (Verse.Map map, System.Boolean respawningAfterLoad) [0x00063] in <957a20e0be784a65bc32cf449445b937>:0
- POSTFIX Andromeda.PackableContainers: Void PortableContainers.Patches:Postfix(Building_Storage __instance, Map map, Boolean respawningAfterLoad)
bradson  [developer] 3 May, 2024 @ 11:05am 
@Andromeda that's an issue with patch order. Your SpawnSetup postfix runs before adaptive storage finishes spawning, causing the array accessed by MaxItemsByCell to be unitialized at that time. The index accessed by the transpiler is in fact invalid, and the throw is correct there. I could look into trying to get it set up before the base.SpawnSetup call, but then there'd be a chance of the array not matching the AllSlotCellsList created in base
bradson  [developer] 3 May, 2024 @ 11:18am 
https://github.com/bbradson/Adaptive-Storage-Framework/blob/main/Source/ThingClass.cs#L235-L237
RimWorld.Building_Storage.AllSlotsCells() is set up to return an empty collection when accessed before spawning
bradson  [developer] 3 May, 2024 @ 2:30pm 
I implemented a workaround for compatibility now, but a better solution against the underlying issue of items being added to Building_Storage subclasses before they're done with their SpawnSetup by packable containers would be to have the callsite patched instead of the potentially overridden SpawnSetup method
Meyhazah 3 May, 2024 @ 8:10pm 
When using this framework and fish, linking setting on storage containers using adaptive framework freezes the game.

(No log because game froze)
Last edited by Meyhazah; 3 May, 2024 @ 8:10pm
L. Velociraptor 4 May, 2024 @ 12:29am 
Hello there! Looks like I'm getting some kind of error when making fine meals using modded meats like fish from Vanilla Fishing Expanded or Ornithopod Meat from Biomes! Prehistoric.

When the meals are created or the save is loaded with an affected meal on map, the following is a meal made with Eel from Vanilla Fishing Expanded:
Exception printing MealFine1511697 at (95, 0, 194): System.IndexOutOfRangeException: Index was outside the bounds of the array. [Ref E9A460EA] at Verse.Graphic_MealVariants.SubGraphicFor (Verse.Thing thing) [0x00014] in <a1dcdc3aee3f4bb693529c51a3916574>:0 at Verse.Graphic_StackCount.MatSingleFor (Verse.Thing thing) [0x0000a] in <a1dcdc3aee3f4bb693529c51a3916574>:0 at Verse.Graphic_StackCount.MatAt (Verse.Rot4 rot, Verse.Thing thing) [0x0000a] in <a1dcdc3aee3f4bb693529c51a3916574>:0 at Verse.Graphic.Print (Verse.SectionLayer layer, Verse.Thing thing, System.Single extraRotation) [0x000cd] in <a1dcdc3aee3f4bb693529c51a3916574>:0 at Verse.Thing.Print (Verse.SectionLayer layer) [0x00006] in <a1dcdc3aee3f4bb693529c51a3916574>:0 at Verse.ThingWithComps.Print (Verse.SectionLayer layer) [0x00000] in <a1dcdc3aee3f4bb693529c51a3916574>:0 at Verse.SectionLayer_ThingsGeneral.TakePrintFrom (Verse.Thing t) [0x00021] in <a1dcdc3aee3f4bb693529c51a3916574>:0 - PREFIX adaptive.storage.framework: Boolean AdaptiveStorage.HarmonyPatches.HideStoredThingsFromSectionLayerAndOverlayDrawer:Prefix(Thing t) UnityEngine.StackTraceUtility:ExtractStackTrace () (wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Log.Error_Patch6 (string) (wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.SectionLayer_ThingsGeneral.TakePrintFrom_Patch1 (Verse.SectionLayer_ThingsGeneral,Verse.Thing) Verse.SectionLayer_Things:Regenerate () Verse.Section:RegenerateAllLayers () Verse.MapDrawer:RegenerateEverythingNow () Verse.Map:<FinalizeInit>b__160_0 () Verse.LongEventHandler:ExecuteToExecuteWhenFinished () Verse.LongEventHandler:UpdateCurrentAsynchronousEvent () Verse.LongEventHandler:LongEventsUpdate (bool&) (wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Root.Update_Patch2 (Verse.Root) Verse.Root_Play:Update ()


And then when the meal itself is selected and the info button is pressed it spams the following to the log, again this is the fine meal containing Eel:
Exception filling window for Verse.Dialog_InfoCard: System.IndexOutOfRangeException: Index was outside the bounds of the array. [Ref B2FD83AF] at Verse.Graphic_MealVariants.SubGraphicFor (Verse.Thing thing) [0x00014] in <a1dcdc3aee3f4bb693529c51a3916574>:0 at Verse.GraphicUtility.<ExtractInnerGraphicFor>g__ResolveGraphicInner|0_0 (Verse.Graphic g, Verse.GraphicUtility+<>c__DisplayClass0_0& ) [0x0006e] in <a1dcdc3aee3f4bb693529c51a3916574>:0 at Verse.GraphicUtility.ExtractInnerGraphicFor (Verse.Graphic outerGraphic, Verse.Thing thing, System.Nullable`1[T] indexOverride) [0x0005a] in <a1dcdc3aee3f4bb693529c51a3916574>:0 - PREFIX Dubwise.DubsBadHygiene: Boolean DubsBadHygiene.Patches.HarmonyPatches_Thirst:ExtractInnerGraphicFor_Prefix(Graphic outerGraphic, Thing thing, Graphic& __result) at Verse.Widgets.GetIconFor (Verse.Thing thing, UnityEngine.Vector2 size, System.Nullable`1[T] rot, System.Boolean stackOfOne, System.Single& scale, System.Single& angle, UnityEngine.Vector2& iconProportions, UnityEngine.Color& color) [0x002ee] in <a1dcdc3aee3f4bb693529c51a3916574>:0 at Verse.Widgets.ThingIcon (UnityEngine.Rect rect, Verse.Thing thing, System.Single alpha, System.Nullable`1[T] rot, System.Boolean stackOfOne) [0x0001c] in <a1dcdc3aee3f4bb693529c51a3916574>:0 at Verse.Dialog_InfoCard.DoWindowContents (UnityEngine.Rect inRect) [0x000b6] in <a1dcdc3aee3f4bb693529c51a3916574>:0 - PREFIX VREAndroidsMod: Void VREAndroids.Dialog_InfoCard_DoWindowContents_Patch:Prefix(Dialog_InfoCard __instance, Rect inRect) - PREFIX SmashPhil.VehicleFramework: Boolean Vehicles.Gizmos:VehicleInfoCardOverride(Rect inRect, Thing ___thing, ThingDef ___def) at Verse.Window.InnerWindowOnGUI (System.Int32 x) [0x001a6] in <a1dcdc3aee3f4bb693529c51a3916574>:0 UnityEngine.StackTraceUtility:ExtractStackTrace () (wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Log.Error_Patch6 (string) Verse.Window:InnerWindowOnGUI (int) UnityEngine.GUI:CallWindowDelegate (UnityEngine.GUI/WindowFunction,int,int,UnityEngine.GUISkin,int,single,single,UnityEngine.GUIStyle)

If there's something else going on please let me know and I'll make a report with whatever mod I need to. :)

Thanks so much for making great mods and sharing them for us to enjoy.
CloudJuri 4 May, 2024 @ 4:08am 
My game freeze completely too, when i try link random or similar storages, without log. Mods for new storage, Stack gap and Save storage, not cause this problem. Maybe no log needed but i realy want fix this problem https://gist.github.com/HugsLibRecordKeeper/32c4bd39c9774f8b7e6b0b0a652e4cbb
The unit can only move some items one by one. For example, if only one silver or one log is transported at a time, the error logs are as follows

Invalid count: -1, setting to 1. Job was HaulToInventory (Job_342338) A = Thing_BlocksMarble478497 B = (147, 0, 94) Giver = JobGiver_Work [workGiverDef: HaulToInventory]
UnityEngine.StackTraceUtility:ExtractStackTrace ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Log.Error_Patch4 (string)
Verse.AI.Toils_Haul:ErrorCheckForCarry (Verse.Pawn,Verse.Thing,bool)
PickUpAndHaul.JobDriver_HaulToInventory/<>c__DisplayClass1_0:<MakeNewToils>b__2 ()
Verse.AI.JobDriver:TryActuallyStartNextToil ()
Verse.AI.JobDriver:ReadyForNextToil ()
Verse.AI.JobDriver:Notify_PatherArrived ()
Verse.AI.Pawn_PathFollower:PatherArrived ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.AI.Pawn_PathFollower.TryEnterNextPathCell_Patch1 (Verse.AI.Pawn_PathFollower)
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.AI.Pawn_PathFollower.PatherTick_Patch3 (Verse.AI.Pawn_PathFollower)
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Pawn.Tick_Patch2 (Verse.Pawn)
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.TickList.Tick_Patch2 (Verse.TickList)
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.TickManager.DoSingleTick_Patch3 (Verse.TickManager)
Verse.TickManager:TickManagerUpdate ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Game.UpdatePlay_Patch2 (Verse.Game)
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Root_Play.Update_Patch1 (Verse.Root_Play)
bradson  [developer] 5 May, 2024 @ 1:05am 
HaulToInventory and PickUpAndHaul.JobDriver_HaulToInventory are Pick Up And Haul. Has nothing to do with this mod.

The System.IndexOutOfRangeException at Verse.Graphic_MealVariants for MealFine1511697 is caused by retextures for meals. Rimworld expects a fixed amount of graphics there, if a retexture is outdated or the folder contains more files than it should after an update it throws this. Again, nothing to do with storage or even hauling. It's a retexture and throws without this mod too.

The storage linking freeze is a known performance fish bug at the moment. Doesn't happen with only adaptive storage, is not in any way relevant to adaptive storage
L. Velociraptor 5 May, 2024 @ 12:22pm 
Originally posted by bradson:
The System.IndexOutOfRangeException at Verse.Graphic_MealVariants for MealFine1511697 is caused by retextures for meals. Rimworld expects a fixed amount of graphics there, if a retexture is outdated or the folder contains more files than it should after an update it throws this. Again, nothing to do with storage or even hauling. It's a retexture and throws without this mod too.

Thanks so much for the help in figuring this out, even though it wasn't caused by your mod! I'll have to try re-verifying my mods and such, I guess, see if that helps at all.
L. Velociraptor 5 May, 2024 @ 4:24pm 
Originally posted by bradson:
HaulToInventory and PickUpAndHaul.JobDriver_HaulToInventory are Pick Up And Haul. Has nothing to do with this mod.

The System.IndexOutOfRangeException at Verse.Graphic_MealVariants for MealFine1511697 is caused by retextures for meals. Rimworld expects a fixed amount of graphics there, if a retexture is outdated or the folder contains more files than it should after an update it throws this. Again, nothing to do with storage or even hauling. It's a retexture and throws without this mod too.

The storage linking freeze is a known performance fish bug at the moment. Doesn't happen with only adaptive storage, is not in any way relevant to adaptive storage

Yo Bradson thank you so much! After your comment I went hunting thru my mod list because I use very few retextures... but I DO use Vanilla Textures Expanded which includes new meal textures. Using their built-in option to disable the meal textures fixed the issue and the bugged meals are now appearing properly.

Thanks so much for helping me figure out the root cause and fix my issue!
Thank you for your response. I will also go and organize the texture mod to give it a try.
Arkitekt 8 May, 2024 @ 3:53pm 
I have minify everything installed, so I can uninstall Ancient Pipes. Upon doing so, I have them enabled in a vanilla storage zone under the building category. However, I cannot haul buildings to vanilla storage zones. It's like the game does not recognize them as storage zones for buildings anymore.
< >
Showing 1-15 of 91 comments
Per page: 1530 50