cseelhoff / RimThreaded

RimThreaded is a RimWorld mod designed to enable RimWorld to utilize multiple threads.
MIT License
117 stars 21 forks source link

Project Rimfactory Throws Rimthreaded Reservation Manager Errors with Enough Colonists #760

Open Whyareuhere opened 2 years ago

Whyareuhere commented 2 years ago

Developer To Do Notes:

Non-Vanilla Bug Report

Describe the bug

Project Rimfactory machines throw errors with Rimthreaded Reservation Manager with mor ecolonists. As the colony got bigger (more colonists, currently at 16 colonists) errors with the Rimthreaded Reservation Manager started appearing throwing a red error and pausing all production from Rimfactory machines - but WITHOUT TPS lag or anything similar. They just halt whatever they are supposed to do

Steps to reproduce the behavior (VERY IMPORTANT)

  1. Load Rimfactory, then Rimthreaded
  2. Spawn in at least 16 colonists. Current bug is found on an extremely large map (dev mode). Assign them jobs like a normal colony. (Do animals count towards this? I have about 8 colony animals, 5 of which are in a pen).
  3. Spawn in a Rimfactory assembler, the one that is used on a workstation. Give it something to do (I am doing stonecutting).
  4. See red Rimthreaded Reservation Manager error after about 5-15 minutes. Unfortunately I am not really sure how long it usually takes, it depends on the load Rimthreaded has to deal with from raids/events.

Error Logs ?

Example of error: 
Exception ticking PRF_FurnaceIII2903182 (at (148, 0, 196)). Suppressing further errors. Exception: System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
  at System.Collections.Generic.Dictionary`2+ValueCollection+Enumerator[TKey,TValue].MoveNext () [0x00013] in <eae584ce26bc40229c1b1aa476bfa589>:0 
  at RimThreaded.ReservationManager_Patch+<getAllReservations>d__37.MoveNext () [0x000ac] in <128952d2e17644cd87e76a1b3cc94a06>:0 
  at RimThreaded.ReservationManager_Patch+<AllReservedThings2>d__34.MoveNext () [0x0006c] in <128952d2e17644cd87e76a1b3cc94a06>:0 
  at System.Linq.Enumerable.Contains[TSource] (System.Collections.Generic.IEnumerable`1[T] source, TSource value, System.Collections.Generic.IEqualityComparer`1[T] comparer) [0x00036] in <351e49e2a5bf4fd6beabb458ce2255f3>:0 
  at System.Linq.Enumerable.Contains[TSource] (System.Collections.Generic.IEnumerable`1[T] source, TSource value) [0x0000a] in <351e49e2a5bf4fd6beabb458ce2255f3>:0 
  at ProjectRimFactory.SAL3.Things.Assemblers.Building_ProgrammableAssembler.<get_AllAccessibleThings>b__26_1 (Verse.Thing t) [0x00010] in <0c6ff558357b46239d0d73df0cb63217>:0 
  at System.Linq.Utilities+<>c__DisplayClass1_0`1[TSource].<CombinePredicates>b__0 (TSource x) [0x0000e] in <351e49e2a5bf4fd6beabb458ce2255f3>:0 
  at System.Linq.Utilities+<>c__DisplayClass1_0`1[TSource].<CombinePredicates>b__0 (TSource x) [0x00000] in <351e49e2a5bf4fd6beabb458ce2255f3>:0 
  at System.Linq.Enumerable+WhereEnumerableIterator`1[TSource].ToList () [0x0001b] in <351e49e2a5bf4fd6beabb458ce2255f3>:0 
  at System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x0001f] in <351e49e2a5bf4fd6beabb458ce2255f3>:0 
  at ProjectRimFactory.SAL3.Things.Assemblers.Building_ProgrammableAssembler.TryGetNextBill () [0x00043] in <0c6ff558357b46239d0d73df0cb63217>:0 
  at ProjectRimFactory.SAL3.Things.Assemblers.Building_ProgrammableAssembler.Tick () [0x0016b] in <0c6ff558357b46239d0d73df0cb63217>:0 
  at RimThreaded.TickList_Patch.NormalThingTick () [0x00025] in <128952d2e17644cd87e76a1b3cc94a06>:0  
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 39)

HugsLib log

https://gist.github.com/b0388b458e2e496dbc8d162fdb1a1bfe

Player.log (Optional)

❗❗❗ Link to contents of Player.log or Error.log (MUST BE LINK) ❗❗❗

Save file ?

❗❗❗ Please add a save file where the issue occurs to speed up testing and fixing of the issue ❗❗❗

Screenshots (Optional) ?

❗❗❗ Add screenshots to help explain your problem here ❗❗❗

Mod list (Preferably a RimPy compatible list.) ?

❗❗❗ Add RimPy mod list here (load in order) ❗❗❗ 
Whyareuhere commented 2 years ago

Additional log. Here I was able to run three Project Rimfactory machines for about 15 minutes before tick exceptions happened, resulting in similar effects: https://gist.github.com/906694e218bada10cb65796ed551176f

Whyareuhere commented 2 years ago

Additional observation: ran Project Rimfactory Drone's drones (construction/caretaker/etc, does not matter). Reverts some colonists to be stuck on "standing" and throwing AI node errors. This gets fixed when rebooting the game and loading the save.

Whyareuhere commented 2 years ago

Tick errors are also created for colonists when running Project Rimfactory Drones, not sure if I should open up a new bug ticket or not: https://gist.github.com/12da963beb5ad17c6257479e7e6dca74