cseelhoff / RimThreaded

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

Pawns Ignoring Job Assignments #669

Open robinzilla opened 2 years ago

robinzilla commented 2 years ago

IMPORTANT:

Please first search existing bugs to ensure you are not creating a duplicate bug report!
Make sure you have the latest version of Rimworld!

Describe the bug

Pawns will no longer do jobs assigned to them beyond their top level job. For instance, one pawn that is set to cook, butcher, and brew first will do those tasks anytime they are available, but will not do any other jobs assigned to her. She will just go idle instead and wander. I can force these pawns to do things, but as soon as i undo that or they complete the task, they return to idle if there is not a task to perform under that one 'main' job. Changing priorities does not change that 'main' job that they will do. Drafting them doesn't effect that either. Disabling RimThreaded is the only thing that removes this issue so far. It works every time i disable the mod, load my save, save it again, and then load that save.

Steps to reproduce the behavior (VERY IMPORTANT)

  1. Load Save
  2. Watch pawns until you see them start to go idle (usually happens within the first couple minutes)

HugsLib log

https://gist.github.com/83ea93c0052cdf56139836dbd3c0048f

Save file

ModTesting2 (RT Enabled;FB Disabled).zip

Mod list (Preferably a RimPy compatible list.)

ModTest (RT Enabled).txt

Niilo007 commented 2 years ago

This issue is most likely a mod conflict of some sort, haven't had this issue with my mod list on 2.5.16 Need someone to test with the reported mod list

lagun commented 2 years ago

I have the same problem. My log. https://gist.github.com/HugsLibRecordKeeper/ebd9875e4c84b3f23e5f5eac7e432549

My pawn don't cutting rock. I setting priority to 1. Disable rimthreaded problem gone My save file. bug.zip

sophiachan213 commented 2 years ago

Currently experiencing similar/the same issue https://git.io/JisZr

MichelJonkman commented 2 years ago

I'm experiencing the same issue: https://gist.github.com/HugsLibRecordKeeper/3e48af566d63bd51c1c7f6019166edba

I reproduced this using these steps with only Harmony, HugsLib, RimThreaded and all DLC installed:

MichelJonkman commented 2 years ago

@Niilo007 As I experience this in an otherwise vanilla game, can this be set to high priority?

Niilo007 commented 2 years ago

@K1ll3rM @sophiachan213 does this happen in 2.5.16 ? (steam release is 2.5.15)

CaptainBligh1947 commented 2 years ago

@K1ll3rM @sophiachan213 does this happen in 2.5.16 ? (steam release is 2.5.15)

I was playing last night with what I think was 2.5.16, and jobs worked for the most part. There was one point where my pawns stopped growing, but would cut. I changed everyone's priority to 1 and deleted a recent grow zone I made (that was half-done) and things went back to normal.

Hope this helps

export.txt

Capture

I just loaded up my save from last night, and my jobs are all reset strangely. Here's the save if it helps.

Monqualium.zip

There seems to be something wrong with installing furniture.

Not furniture, but hopefully a help:

Suspending manager job because it error-ed on tick: System.InvalidOperationException: Collection was modified; enumeration operation may not execute. at System.ThrowHelper.ThrowInvalidOperationException (System.ExceptionResource resource) [0x0000b] in :0 at System.Collections.Generic.List1+Enumerator[T].MoveNextRare () [0x00013] in <eae584ce26bc40229c1b1aa476bfa589>:0 at System.Collections.Generic.List1+Enumerator[T].MoveNext () [0x0004a] in :0 at System.Linq.Enumerable+WhereListIterator1[TSource].MoveNext () [0x0004e] in <351e49e2a5bf4fd6beabb458ce2255f3>:0 at System.Linq.Enumerable.Sum[TSource] (System.Collections.Generic.IEnumerable1[T] source, System.Func`2[T,TResult] selector) [0x00038] in <351e49e2a5bf4fd6beabb458ce2255f3>:0 at FluffyManager.ManagerJob_Mining.GetCountInChunks () [0x0004a] in <80071463a7df4c2993867b4db55631f6>:0 at FluffyManager.ManagerJob_Mining.Tick () [0x00019] in <80071463a7df4c2993867b4db55631f6>:0 at FluffyManager.Manager.MapComponentTick () [0x00029] in <80071463a7df4c2993867b4db55631f6>:0 UnityEngine.StackTraceUtility:ExtractStackTrace () Verse.Log:Error (string) FluffyManager.Manager:MapComponentTick () Verse.MapComponentUtility:MapComponentTick (Verse.Map) Verse.Map:MapPostTick () RimThreaded.Map_Patch:MapsPostTickPrepare () RimThreaded.RimThreaded:PrepareWorkLists () RimThreaded.RimThreaded:ProcessTicks (RimThreaded.RimThreaded/ThreadInfo) RimThreaded.RimThreaded:InitializeThread (object) System.Threading.ThreadHelper:ThreadStart_Context (object) System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object) System.Threading.ThreadHelper:ThreadStart (object)

My pawn, Jojo, seems to only construct while set to priority 3 or higher.

StillUnnamed-main commented 2 years ago

As of right now, I can confirm that some aspects of this issue persist in specific modded saves, but I do not experience issues in vanilla. Initially, I was having trouble with pawns completely ignoring job assignments unless manually tasked, but now the problem seems to be that they will complete a job (crafting task, mining a cell of stone, etc.) and then spend several hours (while scheduled to work) wandering aimlessly. This is also not creating any log errors. I tried using a save with a number of mods from my library. Hopefully this helps; the following mods do not appear to be resulting in issues based on my tests: Stabilize Do Your F** Research Auto-Cut Blight Misc. Training Map Reroll Perfect Pathing Incident Person Stat Graze Up Color Coded Mood Bar Misc. Robots Real Ruins Dubs Break Mod EdB Prepare Carefully Wall Light Allow Tool Quarry DoorMat Drag Select Beta Traps Dubs Mint Minimap RT Fuse Fuse Plus Defenses Expanded Reinforced Walls Defensive Machine Gun Turret Pack Quest Rewards Rebalance Tilled Soil

This was tested by using dev tools to generate a test colony repeatedly and observing how colonists behaved, however, neither DLC was used. None of these were allowed to run for more than a few minutes, however, so I may update this if it turns out to be an issue that takes a little while to arise.

Edit: Adding all of my mods back and using the same testing methodology revealed no issues. This implies that this is something that arises after some event triggers it further down the line, which means this is going to be a headache to troubleshoot.

Edit 2: Now seeing this error every now and again, which is odd.

Error in WorldPawnGCTick(): System.NullReferenceException: Object reference not set to an instance of an object at RimWorld.Planet.WorldPawnGC.WorldPawnGCTick () [0x00069] in :0 at RimThreaded.WorldPawns_Patch.WorldPawnsTick (RimWorld.Planet.WorldPawns __instance) [0x0012b] in <56b8e9fdc69e4b49a5ad5823c300adf3>:0 UnityEngine.StackTraceUtility:ExtractStackTrace () Verse.Log:Error (string) RimThreaded.WorldPawns_Patch:WorldPawnsTick (RimWorld.Planet.WorldPawns) (wrapper dynamic-method) RimWorld.Planet.WorldPawns:RimWorld.Planet.WorldPawns.WorldPawnsTick_Patch1 (RimWorld.Planet.WorldPawns) RimThreaded.WorldPawns_Patch:WorldPawnsPrepare () RimThreaded.RimThreaded:PrepareWorkLists () RimThreaded.RimThreaded:ProcessTicks (RimThreaded.RimThreaded/ThreadInfo) RimThreaded.RimThreaded:InitializeThread (object) System.Threading.ThreadHelper:ThreadStart_Context (object) System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object) System.Threading.ThreadHelper:ThreadStart (object)

Edit 3: Unrelated: Console occasionally floods with these errors, which were not previously encountered:

Exception ticking Cobra149785 (at (190, 0, 82)): System.NullReferenceException: Object reference not set to an instance of an object at RimWorld.PawnWoundDrawer.ReturnDrawCallList (System.Collections.Generic.List1[T] lst) [0x00000] in <cdbd0ed5089a418da09b9a259f9dbd8f>:0 at RimWorld.PawnWoundDrawer.ClearCache () [0x0001a] in <cdbd0ed5089a418da09b9a259f9dbd8f>:0 at Verse.Hediff_MissingPart.set_IsFresh (System.Boolean value) [0x00026] in <cdbd0ed5089a418da09b9a259f9dbd8f>:0 at RimThreaded.HediffSet_Patch.AddDirect (Verse.HediffSet __instance, Verse.Hediff hediff, System.Nullable1[T] dinfo, Verse.DamageWorker+DamageResult damageResult) [0x001a1] in <56b8e9fdc69e4b49a5ad5823c300adf3>:0 at (wrapper dynamic-method) Verse.HediffSet.Verse.HediffSet.AddDirect_Patch1(Verse.HediffSet,Verse.Hediff,System.Nullable1<Verse.DamageInfo>,Verse.DamageWorker/DamageResult) at Verse.Pawn_HealthTracker.AddHediff (Verse.Hediff hediff, Verse.BodyPartRecord part, System.Nullable1[T] dinfo, Verse.DamageWorker+DamageResult result) [0x0000a] in :0 at Verse.DamageWorker_AddInjury.FinalizeAndAddInjury (Verse.Pawn pawn, Verse.Hediff_Injury injury, Verse.DamageInfo dinfo, Verse.DamageWorker+DamageResult result) [0x00163] in :0 at Verse.DamageWorker_AddInjury.FinalizeAndAddInjury (Verse.Pawn pawn, System.Single totalDamage, Verse.DamageInfo dinfo, Verse.DamageWorker+DamageResult result) [0x000c1] in :0 at Verse.DamageWorker_AddInjury.ApplySpecialEffectsToPart (Verse.Pawn pawn, System.Single totalDamage, Verse.DamageInfo dinfo, Verse.DamageWorker+DamageResult result) [0x0000b] in :0 at Verse.DamageWorker_AddInjury.ApplyDamageToPart (Verse.DamageInfo dinfo, Verse.Pawn pawn, Verse.DamageWorker+DamageResult result) [0x00145] in :0 at Verse.DamageWorker_AddInjury.ApplyToPawn (Verse.DamageInfo dinfo, Verse.Pawn pawn) [0x00091] in :0 at Verse.DamageWorker_AddInjury.Apply (Verse.DamageInfo dinfo, Verse.Thing thing) [0x00013] in :0 at (wrapper dynamic-method) Verse.Thing.Verse.Thing.TakeDamage_Patch0(Verse.Thing,Verse.DamageInfo) at RimWorld.Verb_MeleeAttackDamage.ApplyMeleeDamageToTarget (Verse.LocalTargetInfo target) [0x0002e] in :0 at RimWorld.Verb_MeleeAttack.TryCastShot () [0x001e8] in :0 at Verse.Verb.TryCastNextBurstShot () [0x00012] in :0 at Verse.Verb.VerbTick () [0x00055] in :0 at Verse.VerbTracker.VerbsTick () [0x00019] in :0 at Verse.Pawn.Tick () [0x00074] in :0 at RimThreaded.TickList_Patch.NormalThingTick () [0x00025] in <56b8e9fdc69e4b49a5ad5823c300adf3>:0 UnityEngine.StackTraceUtility:ExtractStackTrace () Verse.Log:Error (string) RimThreaded.TickList_Patch:NormalThingTick () RimThreaded.RimThreaded:ExecuteTicks () RimThreaded.RimThreaded:ProcessTicks (RimThreaded.RimThreaded/ThreadInfo) RimThreaded.RimThreaded:InitializeThread (object) System.Threading.ThreadHelper:ThreadStart_Context (object) System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object) System.Threading.ThreadHelper:ThreadStart (object)

jptrrs commented 2 years ago

Following complaints of this affecting Human Resources, I investigated the matter. The only thing I can say for sure is your patch for JobGiver_Work for some reason isn't calling the WorkGiver like it's supposed to. In HR's case, that's WorkGiver_Knowledge, derived from the vanilla WorkGiver_DoBill. It overrides the vanilla HasJobOnThing method, and it would be the first step in a pawn determining there's work to do. With Rimthreaded, that's never called. But that's as far as I could dig. I figured this could be potentially useful information. If not, please ignore.

JoshKeegan commented 2 years ago

I'm having what appears to be this issue when only using vanilla (only Harmony & RimThreaded 2.6.4 loaded). In my case it's doctors never performing surgery unless I manually tell them to prioritise the task. They will even end up idling rather than performing the surgery if they have no other tasks to do, so the task seems ignored rather than just having its priorities broken. They will still do other doctor duties though.