[1.1.2579] Pawn tried to path while downed

Started by LWM, September 03, 2018, 02:54:09 AM

Previous topic - Next topic

LWM

Today I ran into a situation where an animal "tried to path while downed."  "This should never happen."

This WILL happen in the following situation:

# The animal's master is drafted
## the animal responds to drafting
# the animal is in combat
# (maybe not important) While the animal is in combat, the zone for the animal is changed to one that means it must move
# The animal is wounded
# the animal makes an attack? (and is busy?)
# The animal is undrafted (master is still drafted?)
# The animal is downed by combat before it can begin moving.

Guy tried to path while downed. This should never happen. curJob=LayDown (Job_1989186) A=Thing_AnimalSleepingSpot592075
Verse.Log:Error(String, Boolean)
Verse.AI.Pawn_PathFollower:StartPath(LocalTargetInfo, PathEndMode)
RimWorld.<GotoBed>c__AnonStorey0:<>m__0()
Verse.AI.JobDriver:TryActuallyStartNextToil()
Verse.AI.JobDriver:ReadyForNextToil()
Verse.AI.JobDriver:TryActuallyStartNextToil()
Verse.AI.JobDriver:ReadyForNextToil()
Verse.AI.JobDriver:DriverTick()
Verse.AI.Pawn_JobTracker:JobTrackerTick()
Verse.Pawn:Tick()
Verse.TickList:Tick()
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:UpdatePlay() etc

It's not a huge bug, and not important, but maybe once a pawn goes down, its current job should be set to "being unconscious" or something?

Thanks,

--LWM

Ramsis

Hi LWM thank you for the report; I'm trying to reproduce the bug on my end following your instructions and scenario breakdown but I'm not having much luck at the moment. Have you had this bug occur since your report? Any chance you might have a save file just before this fighting took place?

Thanks again! :)
Ugh... I have SO MANY MESSES TO CLEAN UP. Oh also I slap people around who work on mods <3

"Back off man, I'm a scientist."
- Egon Stetmann


Awoo~

LWM

Okay, happened again today.

Scenario:  Animal is attached to a drafted pawn.  Animal is in battle OUTSIDE its assigned zone.  Animal has been wounded, and the player (me) undrafts (unchecked the "follow master when drafted" bit) the animal.  The animal is now outside its assigned zone and must return to it (and wants to lie down in bed because it is hurt).  Animal is in the middle of attack and in recovery period - animal cannot immediately act on being undrafted.

Scyther incapacitates animal before the animal finishes its previous attack cooldown.  Animal is outside zone so attempts to return to proper zone...but is incapacitated.

Error log:
Elk 3 tried to path while downed. This should never happen. curJob=LayDown (Job_3324092) A=Thing_AnimalBed2537617
Verse.Log:Error(String, Boolean)
Verse.AI.Pawn_PathFollower:StartPath(LocalTargetInfo, PathEndMode)
RimWorld.<GotoBed>c__AnonStorey0:<>m__0()
Verse.AI.JobDriver:TryActuallyStartNextToil()
Verse.AI.JobDriver:ReadyForNextToil()
Verse.AI.JobDriver:TryActuallyStartNextToil()
Verse.AI.JobDriver:ReadyForNextToil()
Verse.AI.JobDriver:DriverTick()
Verse.AI.Pawn_JobTracker:JobTrackerTick()
Verse.Pawn:Tick_Patch1(Object)
Verse.TickList:Tick()
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:UpdatePlay()
Verse.Root_Play:Update()

It's kind of hard to reproduce, no?  You have to undraft an animal right before it gets incapacitated, etc.  Maybe if the animal were in attack cooldown, is undrafted and outsize zone, and dev-mode bombed into incapacitation?

It took this long before I ever saw it again!

--LWM

LWM

This time it was a human in a fight with bugs.  I undrafted him, and he tried to flee.  I changed his job to forced-go-lie-in-hospital-bed.  Then I unpaused and:

Chorniy, Writer tried to path while downed. This should never happen. curJob=LayDown (Job_4364770) A=Thing_Bed282676
Verse.Log:Error(String, Boolean)
Verse.AI.Pawn_PathFollower:StartPath(LocalTargetInfo, PathEndMode)
RimWorld.<>c__DisplayClass0_0:<GotoBed>b__0()
etc.

Entertaining, but not super helpful.  So I played with similar situations.

I managed to reproduce the bug:  I picked a pawn, debug-injured to down.  Then I spawned some hostile turkeys next to her (sorry, Nora, but this was for science).  Then I debug-healed her 10.  Then I repeated until it happened!

Then I realized you might like some job logging, so I played around it with a little more.

Sequence:
# Nora stands up badly wounded
# Draft Nora; she instantly takes a swing at a turkey
# Undraft Nora - she wants to run away
# Force prioritize moving to hospital bed to rest
# while Nora is in cooldown from her attack, turkeys attack her.
# She goes down.
# Nora tried to path while downed.

14567372 Nora: StartJob [FleeAndCower (Job_4392259) A=(99, 0, 68)] lastJobEndCondition=None, jobGiver=RimWorld.JobGiver_ConfigurableHostilityResponse, cancelBusyStances=False
14567372 Nora: TryTakeOrderedJob LayDown (Job_4392260) A=Thing_HospitalBed668168
14567372 Nora:     Queueing job
14567372 Nora: ClearQueuedJobs
14567372 Nora: EndCurrentJob FleeAndCower (Job_4392259) A=(99, 0, 68) condition=InterruptForced curToil=0
14567372 Nora: CleanupCurrentJob FleeAndCower condition InterruptForced
14567372 Nora: TryFindAndStartJob
14567372 Nora:    Returning queued job: LayDown (Job_4392260) A=Thing_HospitalBed668168
14567372 Nora: StartJob [LayDown (Job_4392260) A=Thing_HospitalBed668168] lastJobEndCondition=None, jobGiver=Verse.AI.ThinkNode_QueuedJob, cancelBusyStances=False
14567465 Nora: ClearQueuedJobs
Nora, Barkeep tried to path while downed. This should never happen. curJob=LayDown (Job_4392260) A=Thing_HospitalBed668168
14567492 Nora: EndCurrentJob LayDown (Job_4392260) A=Thing_HospitalBed668168 condition=ErroredPather curToil=1
14567492 Nora: CleanupCurrentJob LayDown condition ErroredPather
14567492 Nora: StartJob [Wait (Job_4392266)] lastJobEndCondition=None, jobGiver=, cancelBusyStances=True

I am attaching the full stack trace of that if it's helpful.