Mehni / PickUpAndHaul

Colonists will gather stuff in their inventory, then haul it all to a stockpile.
MIT License
54 stars 46 forks source link

[Issue] Strange behavior when interacting with Extended Storage mod #12

Closed Terragg closed 6 years ago

Terragg commented 6 years ago

Been having some issues with stuttering / slowdown and logspam that seem to be linked to having PickUpAndHaul loaded with Extended Storage loaded and multiple stacks of stacks on the same cell. This is a normal occurance - its how Extended Storage works. The logspam indicates that it's multiple hauls generated per tick that throws the game into a tizzy (formatted for easier reading:

[...]
Hal started 10 jobs in one tick. 
newJob=HaulToCell (Job_2116986) A=Thing_Meat_Cassowary221137 B=(176, 0, 107)
jobGiver=RimWorld.JobGiver_Work 
jobList=
    (HaulToCell (Job_2116966) A=Thing_Meat_Cassowary221137 B=(176, 0, 107))
    (HaulToCell (Job_2116968) A=Thing_Meat_Cassowary221137 B=(176, 0, 107))
    (HaulToCell (Job_2116970) A=Thing_Meat_Cassowary221137 B=(176, 0, 107))
    (HaulToCell (Job_2116972) A=Thing_Meat_Cassowary221137 B=(176, 0, 107))
    (HaulToCell (Job_2116974) A=Thing_Meat_Cassowary221137 B=(176, 0, 107))
    (HaulToCell (Job_2116976) A=Thing_Meat_Cassowary221137 B=(176, 0, 107))
    (HaulToCell (Job_2116978) A=Thing_Meat_Cassowary221137 B=(176, 0, 107))
    (HaulToCell (Job_2116980) A=Thing_Meat_Cassowary221137 B=(176, 0, 107))
    (HaulToCell (Job_2116982) A=Thing_Meat_Cassowary221137 B=(176, 0, 107))
    (HaulToCell (Job_2116984) A=Thing_Meat_Cassowary221137 B=(176, 0, 107))
    (HaulToCell (Job_2116986) A=Thing_Meat_Cassowary221137 B=(176, 0, 107))
lastJobGiver=RimWorld.JobGiver_Work
[...]

The excerpt is from HugsLib. The log is from another user @Sixdd6, but shows the same errors (but different item ids & destination cells) that I encountered.

When testing just Extended Storage + my own mod (+HugsLibs, +JecsTools) I did not run into this at all and I know my mod doesn't touch / make any code changes.

The slowdowns and the logspam went away once I disabled PickUpAndHaul and reloaded.

Maybe HaulToCell (patched by PickUpAndHaul) does not like that multiple target stacks can be on one cell? I would like to help, but my C#-fu is very-weak sauce.

alextd commented 6 years ago

I'm not seeing this problem. What exactly do you do to make this happen?

Terragg commented 6 years ago

Nothing personally (no clicks, no orders, no swtiching overlays, etc). It occurs immediately when pawns try to pickup things to haul from an ES building. They are fine moving to the ES building as part of the hauling job (based on the white line jumping to the ES building when they are selected), but once in range of picking stuff up - errors.

It's not constant either - sometimes hauling from ES buildings will work fine, othertimes errors. It does seems to happen more frequently with 'fuller' ES buildings, so I get the funny feeling that some sort of 'selection' request is returning all stacks in a cell and something is immediately looping through the request and building haul jobs for them all immediately.

I'll spend some time this evening trying to build a minimum viable test case to highligh the issue.

Terragg commented 6 years ago

Pulled down the latest update and added back into my most recent game. There were some slowdowns that were associated with the activity generating the linked logs, but the slowdowns were far more tolerable, and did clear up by themselves while I was examining the logs (previously I had to draft everyone and then undraft to clear it). I cleared the log in preparation for debugging prior to the slowdowns and it still filled up.

HugsLib log capture at: https://git.io/fx91Q

alextd commented 6 years ago

Well, unrelated, but those log lines "Missing method TendAdvice in assembly data-0x10b015200, type Pharmacist.PharmacistUtility could not be loaded, used in SmartMedicine"

I updated Smart Medicine that should fix that.

Terragg commented 6 years ago

Drive-by debugging, cool!

Mehni commented 6 years ago

Can I close this issue?

Terragg commented 6 years ago

Since it isn't throwing errors anymore, core problem solved.

Close away!