Ludeon Forums

RimWorld => Bugs => Topic started by: FluffyCat on July 01, 2016, 10:51:56 PM

Title: Trade window can't open after prisoner leaves map
Post by: FluffyCat on July 01, 2016, 10:51:56 PM
version: 0.13.1135 rev816 (Windows)

1. What the circumstances were: attempted trading repeatedly with multiple entities
2. What happened:
-- case 1: visitors from another faction, I sent a colonist to trade, upon reaching the trader no trade window opens and my colonist walks away
-- case 2: combat supplier arrives, I send a colonist to trade, they approach comms console and walk away with no trade window opening. I attempted trading with multiple colonists, and confirmed I'm still able to call other factions. It appears trade windows no longer appear.
3. What you expected to happen: trade windows open
4. Steps we can follow to make the bug appear on our machine:
-- in the attached save game a new combat supplier just arrived. try trading with them and it won't open the trading window.

Checked the output_log.txt and I see references to trades being attempted, but am not familiar enough with the code to identify the bug. Hope this helps. Trading has worked fine for a long time and I'm more than a year into the game.

Possibly related: I recently constructed a second orbital trade beacon next to my comms console. The first trade beacon's stock pile was fully loaded so I wanted to expand the area to store eligible trade goods. Update: I just attempted deconstructing the second trade beacon and trading again which still did not work.

I hope this can be fixed with the current save file as I'm close to finally launching my first ship.

NOTE: I had to zip the save files since they exceeded the 600k file limit.
NOTE 2: The only mod I have enabled is a Colonists bar which shows colonists as a UI at the top of the screen. I tested temporarily disabling this to see if it fixes the bug but it had no effect.

[attachment deleted by admin - too old]
Title: Re: All trading broken, includes logs
Post by: FluffyCat on July 04, 2016, 09:35:17 AM
2 updates:

I've pretty much stopped my run since my strategy relied on the assumption I'd be able to trade and I built my colony around it. Appreciate if any insight is available that might allow me to trade again without going back several saves.
Title: Re: All trading broken, includes logs
Post by: DariusWolfe on July 04, 2016, 11:33:31 AM
Damn. I was having this error last night, too. I finally said to hell with it on the campaign, and built a spaceship. I thought messing with my mods had broken it. It's working again on a new campaign.

I only had one orbital beacon, total. The only thing I'd done prior to noticing the problem was messing with my mod order to try and fix an unrelated problem.
Title: Re: All trading broken, includes logs
Post by: milon on July 05, 2016, 07:49:43 AM
Bows before FluffyCat and his/her awesome bug-reporting and direction-following prowess.  (I'm serious! You actually followed the directions! I don't know how to react. ;))

I'm on my phone right now, so I can't check your save. But a save consists of both a colony file (.rws) and a world file (.rww). Together it's unlikely be small enough to attach here. If you need to upload elsewhere, try drop box, Google drive, one drive, etc and share the link.  (But I'm just assuming. I could be wrong.)

Also, it would be helpful to have both the before and after saves you mentioned.
Title: Re: All trading broken, includes logs
Post by: FluffyCat on July 07, 2016, 07:16:37 AM
Thanks for the kind words, Milon, and for taking a look at this bug when your time permits. Really appreciate your help. Confirming both .rws and .rww files are saved in the zip attached to the original post. Most likely the save files have a lot of redundant data so the compression is highly efficient.

I just opened my game and tried to open 3-4 prior save periods and run the time on 3x fast forward to get to a trading point, but waiting 5-10 minutes on each save none of them brought a trading event. Is there some secret admin/debugging command I can enter to try triggering a trade event?

In the mean time I attached 'need bionics.zip' which contains a 'need bionics.rws' save file. It's from a few hours before the trading bug appeared so I hope it's a helpful state of the game. I can keep hunting for a pre-case where trading works if it's helpful to resolving the bug. Thanks again.

[attachment deleted by admin - too old]
Title: Re: All trading broken, includes logs
Post by: skullywag on July 07, 2016, 07:36:21 AM
main menu options, enable dev mode, click the list looking item at the top of your screen (dev menu) find one of the options for sending a trade caravan or a trade ship, done. HTH.
Title: Re: All trading broken, includes logs
Post by: sc4s2cg on July 09, 2016, 06:15:24 PM
Actually came to report this bug, glad to see such a detailed post! I also only have the Colonist Bar mod.

I have the same issue as FluffyCat, along with some stuff that might be a bug (or might not):


I attached my output log below. The world and colony are here: https://www.dropbox.com/sh/augi69icropk062/AAAJN_1O0F87tQEXLLcDhZINa?dl=0

Originally posted this on reddit: https://www.reddit.com/r/RimWorld/comments/4s2hev/bug_my_colonists_up_and_decided_they_were_not/

Edit: People suggested I take everything out of the cryptosleep pod. After waiting a couple days for a merchant to arrive, trading works like normal again.

[attachment deleted by admin - too old]
Title: Re: All trading broken, includes logs
Post by: FluffyCat on July 18, 2016, 11:21:57 PM
Enabled developer mode per skullywag's suggestion. Opened a debugging window while attempting to trade and captured the specific error. (screenshot attached as NullRef.png -- update: file was too large to attach, so uploaded to imgur @ http://imgur.com/2IHw2og)

The error for reference:

JobDriver threw exception initAction Pawn=Sam, Job=UseCommsConsole A=Thing_CommsConsole208888, Exception: System.NullReferenceException: Object reference not set to an instance of an object


I tried resolving this by having my colonists deconstruct the comms console and trade beacon, and deleting the underlying stockpile. I then reconstructed everything and confirmed trading is still broken.

TBH sort of lost motivation to play further after getting so far and having the run paralyzed by an inability to trade. I acknowledge this is a risk of playing a prerelease game and am not complaining. I just hope the bug can get fixed before others encounter the same experience.
Title: Re: All trading broken, includes logs
Post by: FluffyCat on July 18, 2016, 11:43:52 PM
Update: following Skullywag's advice I also forced a trade event in the 'need bionics.zip' save instance posted earlier on this thread and confirmed trading still worked fine about an hour earlier. There were no errors when I attempted trading so I don't know what else to report there except that it's an earlier save instance that worked per your request.

Also: I learned that a full stack trace can be seen by clicking on an error in the debug window. Uploaded a full trace of the trading error to imgur: http://imgur.com/gRD6L1D
Title: Re: All trading broken, includes logs
Post by: milon on July 26, 2016, 09:48:50 PM
^ You also get the same info in your debug log.  That's in your RimWorld###Data folder, and it's called output_log.txt.  If you still have it, you could upload it here.
Title: Re: All trading broken, includes logs
Post by: FluffyCat on July 26, 2016, 10:26:23 PM
Thanks, @milon. Confirming output_log.txt is already attached to the original post.
Title: Re: All trading broken, includes logs
Post by: milon on July 27, 2016, 06:56:35 AM
Why yes it is. That was a total derp on my part. :)

(It's also what happens when I browse from my phone and don't try to review the thread before replying to the most recent post.   ::))
Title: Re: All trading broken, includes logs
Post by: Tynan on July 29, 2016, 03:18:41 PM
Looks like this bug and all the info is from Alpha 13.

Is it present in A14? Do you have a savegame or repro steps?
Title: Re: [Need info] All trading broken, includes logs
Post by: FluffyCat on July 29, 2016, 07:05:39 PM
@Tynan, confirming this bug occurred in alpha 13.  Per my reply #7 below the bug was sufficiently demotivating for me to stop playing the game several hours into a run.

My original post included all save files requested in addition to the game's logs. A subsequent followup already includes earlier save files from the same world where the bug didn't yet occur (as requested). I've already volunteered a few hours trying to figure this out and capture helpful diagnostic information.

I will not download Alpha 14 with the intention of reproducing this bug which occurred mysteriously several hours into a game. The steps to reproduce (encounter) the bug are outlined in the original post.

If this bug gets archived to eventually ruin subsequent player experiences because it's from alpha 13 and is tricky to intentionally reproduce that would be a shame. I don't know enough about the game's implementation to solve it here, but I suspect sufficient information is contained in this post including all relevant save & log files if someone would take the time to look.

Good luck.
Title: Re: [Need info] All trading broken, includes logs
Post by: DariusWolfe on July 29, 2016, 07:17:06 PM
I think he's asking because the bug has already been fixed in A14.

I can confirm that I haven't seen it in A14, with or without a colonist/prisoner in a cryptosleep capsule (which was the cause in my A13 game)
Title: Re: [Need info] All trading broken, includes logs
Post by: FluffyCat on July 29, 2016, 07:48:39 PM
If this was a known bug and was fixed elsewhere that's great. However, usually bugs about known/existing issues are identified as duplicate and resolved. I haven't read all posts on this forum, but the inquiries from developers on this thread suggest this was/is an open issue.

With a quirky bug that took 10+ hours of gameplay to trigger (longer if you average it out including other players who haven't triggered the bug at all), it's probably not safe to conclude the bug is "fixed" in A14 because one player who saw it before hasn't yet seen it again.   This bug will most likely be fixed by a developer isolating the issue and actually pushing a fix.

Related: I've never had a colonist in cryosleep (relating to the prior reply), so that's probably not a reliable trigger for this particular bug.
Title: Re: [Need info] All trading broken, includes logs
Post by: Tynan on July 29, 2016, 08:46:37 PM
I'm not asking you to do work, I just wondered if you incidentally had some info.

Thanks for your report - I do appreciate it.

All I've got to go on now is this error from the log, so I'll see if this code might still be broken.

JobDriver threw exception in initAction. Pawn=Sam, Job=UseCommsConsole A=Thing_CommsConsole203888, Exception: System.NullReferenceException: Object reference not set to an instance of an object
  at RimWorld.Pawn_GuestTracker.get_PrisonerIsSecure () [0x00000] in <filename unknown>:0
  at RimWorld.TradeUtility+<>c__Iterator104.MoveNext () [0x00000] in <filename unknown>:0
  at RimWorld.TradeShip+<>c__Iterator102.MoveNext () [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal.AddAllTradeables () [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal.Reset () [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal..ctor () [0x00000] in <filename unknown>:0
  at RimWorld.TradeSession.SetupWith (ITrader newTrader, Verse.Pawn newPlayerNegotiator) [0x00000] in <filename unknown>:0
  at RimWorld.TradeShip.TryOpenComms (Verse.Pawn negotiator) [0x00000] in <filename unknown>:0
  at RimWorld.JobDriver_UseCommsConsole+<MakeNewToils>c__Iterator34.<>m__94 () [0x00000] in <filename unknown>:0
  at Verse.AI.JobDriver.TryActuallyStartNextToil () [0x00000] in <filename unknown>:0
Title: Re: Trade window doesn't open, game acts as if nothing happened
Post by: FluffyCat on July 29, 2016, 09:19:51 PM
Thanks, Tynan, and thanks for all your hard work making a great game.
Title: Re: Trade window doesn't open, game acts as if nothing happened
Post by: Tynan on July 29, 2016, 09:40:00 PM
I tried to load the old A13 code back in to check this one but it was from an old Unity version.

I managed to repro the bug on my A13 saved build. Sadly I don't have the dev build so I can't figure out the troublesome line easily. Still investigating though. It is repeatable, at least.
Title: Re: Trade window can't open after prisoner leaves map
Post by: Tynan on July 29, 2016, 10:06:08 PM
Okay! I almost certainly fixed it. It had to do with trying to trade after your prisoners leave the map. The system tries to add off-map prisoners to the sellable items and it gets all screwed up.

Can you just confirm: Did you have a prisoner escape or be sold at some point?
Title: Re: Trade window can't open after prisoner leaves map
Post by: LesserJohn on June 15, 2017, 02:58:43 AM
Sorry for the necro post, but I've run into exactly this bug in my current a17 game. Trading was working, now it's not. I did release some prisoners a while back, I'm pretty sure it was after they left that it stopped working. I mean, it was definitely after they left, but I'm not sure if I was able to open a trade window between when they left and now. They were raider prisoners, I mention that because earlier I had released some tribal prisoners and had no issues from that. Guessing since they were raiders and I didn't get any faction bonus for releasing them, it triggered the bug. Is there a work around for this?
Title: Re: Trade window can't open after prisoner leaves map
Post by: MrFinnT on June 19, 2017, 11:08:21 AM
i have run into this bug as well now
but i have two games both started with many mods and on A17 just a few days ago
in one of the saves i have run into this problem but i am sure i never let any prisoner go. i had one in my jail for months and first trader i met was a slaver so i wanted to sell him but the shop window did not pop up
other (older) save i had many prisoners and let many of them go and can still trade with no problem

the biggest difference is one game is played on open field (all good) the other in a mountan area (bugged). maybe that could be a reason
files are to large to attache if you need them i will uploade them somewere else

Edit: the save games are uploaded here
https://www.dropbox.com/s/7dskntgnvq9d3oz/Saves.zip?dl=0
Title: Re: Trade window can't open after prisoner leaves map
Post by: Calahan on July 02, 2017, 05:04:33 AM
Cross-linking to another possible report in a GD thread: https://ludeon.com/forums/index.php?topic=34159.0 (credit to Canute for noticing it is / it might be this bug).
Title: Re: Trade window can't open after prisoner leaves map
Post by: kenmtraveller on July 08, 2017, 04:10:20 AM
I also just encountered this bug with the current A17 build, but I am running the hardcore SK modpack.
Here is the error from the debug log:
JobDriver threw exception in initAction. Pawn=Mal, Job=TradeWithPawn A=Thing_Alien_Orassan321597, Exception: System.NullReferenceException: Object reference not set to an instance of an object
  at RimWorld.TransferableUtility.TransferAsOne (Verse.Thing a, Verse.Thing b) [0x00000] in <filename unknown>:0
  at RimWorld.TransferableUtility.TransferableMatching[Tradeable] (Verse.Thing thing, System.Collections.Generic.List`1 transferables) [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal.AddToTradeables (Verse.Thing t, Transactor trans) [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal.AddAllTradeables () [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal.Reset () [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal..ctor () [0x00000] in <filename unknown>:0
  at RimWorld.TradeSession.SetupWith (ITrader newTrader, Verse.Pawn newPlayerNegotiator) [0x00000] in <filename unknown>:0
  at RimWorld.Dialog_Trade..ctor (Verse.Pawn playerNegotiator, ITrader trader) [0x00000] in <filename unknown>:0
  at RimWorld.JobDriver_TradeWithPawn+<MakeNewToils>c__Iterator3F.<>m__B6 () [0x00000] in <filename unknown>:0
  at Verse.AI.JobDriver.TryActuallyStartNextToil () [0x00000] in <filename unknown>:0  lastJobGiver=, curJob.def=TradeWithPawn, curDriver=RimWorld.JobDriver_TradeWithPawn
Verse.Log:Error(String)
Verse.AI.Pawn_JobTracker:StartErrorRecoverJob(String)
Verse.AI.JobDriver:TryActuallyStartNextToil()
Verse.AI.JobDriver:ReadyForNextToil()
Verse.AI.JobDriver:Notify_PatherArrived()
Verse.AI.Pawn_PathFollower:PatherArrived()
Verse.AI.Pawn_PathFollower:TryEnterNextPathCell()
Verse.AI.Pawn_PathFollower:PatherTick()
Verse.Pawn:Tick()
Verse.TickList:Tick()
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:UpdatePlay()
Verse.Root_Play:Update()

Title: Re: Trade window can't open after prisoner leaves map
Post by: ApesAmongUs on July 10, 2017, 11:01:10 PM
So, if it is trying to find things to add to the list and one of the objects (a prisoner) isn't there, then there must be a list of potential objects somewhere.  Does anyone know where that's found in the save?

I'm thinking that if I can find the reference to the prisoner I released and remove it, then I might be able to trade again.

And just as a suggestion, it might make for a better error message to reference the missing object ID.
Title: Re: Trade window can't open after prisoner leaves map
Post by: KuyaManoy on July 19, 2017, 12:17:32 AM
Hi all,

Is there a workaround by editing the save game please? I had a prisoner that tried to escape but was killed. I do not have a prisoner that left offmap. (unless burial is considered offmap?)

Encountered this bug, running on latest A17 on Steam with:
mods Core, HugsLib, Hospitality, Expanded Prosthetics and Organ Engineering 2.0, Misc. Training, [sd] advanced powergeneration, HelpTab, and EdB Prepare Carefully

Relevant output log entry:

JobDriver threw exception in initAction. Pawn=Zinaida, Job=TradeWithPawn A=Thing_Human306522, Exception: System.NullReferenceException: Object reference not set to an instance of an object
  at RimWorld.TransferableUtility.TransferAsOne (Verse.Thing a, Verse.Thing b) [0x00000] in <filename unknown>:0
  at RimWorld.TransferableUtility.TransferableMatching[Tradeable] (Verse.Thing thing, System.Collections.Generic.List`1 transferables) [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal.AddToTradeables (Verse.Thing t, Transactor trans) [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal.AddAllTradeables () [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal.Reset () [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal..ctor () [0x00000] in <filename unknown>:0
  at RimWorld.TradeSession.SetupWith (ITrader newTrader, Verse.Pawn newPlayerNegotiator) [0x00000] in <filename unknown>:0
  at RimWorld.Dialog_Trade..ctor (Verse.Pawn playerNegotiator, ITrader trader) [0x00000] in <filename unknown>:0
  at RimWorld.JobDriver_TradeWithPawn+<MakeNewToils>c__Iterator3F.<>m__B6 () [0x00000] in <filename unknown>:0
  at Verse.AI.JobDriver.TryActuallyStartNextToil () [0x00000] in <filename unknown>:0  lastJobGiver=, curJob.def=TradeWithPawn, curDriver=RimWorld.JobDriver_TradeWithPawn

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 42)
Title: Re: Trade window can't open after prisoner leaves map
Post by: ApesAmongUs on July 20, 2017, 07:32:24 PM
Quote from: KuyaManoy on July 19, 2017, 12:17:32 AM
Hi all,

Is there a workaround by editing the save game please? I had a prisoner that tried to escape but was killed. I do not have a prisoner that left offmap. (unless burial is considered offmap?)

Encountered this bug, running on latest A17 on Steam with:
mods Core, HugsLib, Hospitality, Expanded Prosthetics and Organ Engineering 2.0, Misc. Training, [sd] advanced powergeneration, HelpTab, and EdB Prepare Carefully

Relevant output log entry:

JobDriver threw exception in initAction. Pawn=Zinaida, Job=TradeWithPawn A=Thing_Human306522, Exception: System.NullReferenceException: Object reference not set to an instance of an object
  at RimWorld.TransferableUtility.TransferAsOne (Verse.Thing a, Verse.Thing b) [0x00000] in <filename unknown>:0
  at RimWorld.TransferableUtility.TransferableMatching[Tradeable] (Verse.Thing thing, System.Collections.Generic.List`1 transferables) [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal.AddToTradeables (Verse.Thing t, Transactor trans) [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal.AddAllTradeables () [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal.Reset () [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal..ctor () [0x00000] in <filename unknown>:0
  at RimWorld.TradeSession.SetupWith (ITrader newTrader, Verse.Pawn newPlayerNegotiator) [0x00000] in <filename unknown>:0
  at RimWorld.Dialog_Trade..ctor (Verse.Pawn playerNegotiator, ITrader trader) [0x00000] in <filename unknown>:0
  at RimWorld.JobDriver_TradeWithPawn+<MakeNewToils>c__Iterator3F.<>m__B6 () [0x00000] in <filename unknown>:0
  at Verse.AI.JobDriver.TryActuallyStartNextToil () [0x00000] in <filename unknown>:0  lastJobGiver=, curJob.def=TradeWithPawn, curDriver=RimWorld.JobDriver_TradeWithPawn

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 42)

Deleting the pawns of the old prisoners doesn't work.  I think because references still appear in the history (saying they were captured/released).  So when it tries to load, it's a hard crash.  I also tried changing coordinates to see if I could set them back on the map, but I did not see them anywhere.  I was looking at setting them to dead, but wasn't sure about everywhere that needed to be done.
Title: Re: Trade window can't open after prisoner leaves map
Post by: eldiabs on July 26, 2017, 12:25:29 PM
Seems this is still a relevant bug. Just happened to me as well a couple of years into a campaign. A volcanic winter just started...so maybe that has something to do with it? Tried removing some pawns from cryosleep with no effect so that didn't work for me.

My colony is self sustaining at this point, so not exactly game breaking. Annoying though...

QuoteJobDriver threw exception in initAction. Pawn=Mod, Job=TradeWithPawn A=Thing_Human627553, Exception: System.NullReferenceException: Object reference not set to an instance of an object
  at RimWorld.TransferableUtility.TransferAsOne (Verse.Thing a, Verse.Thing b) [0x00000] in <filename unknown>:0
  at RimWorld.TransferableUtility.TransferableMatching[Tradeable] (Verse.Thing thing, System.Collections.Generic.List`1 transferables) [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal.AddToTradeables (Verse.Thing t, Transactor trans) [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal.AddAllTradeables () [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal.Reset () [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal..ctor () [0x00000] in <filename unknown>:0
  at RimWorld.TradeSession.SetupWith (ITrader newTrader, Verse.Pawn newPlayerNegotiator) [0x00000] in <filename unknown>:0
  at RimWorld.Dialog_Trade..ctor (Verse.Pawn playerNegotiator, ITrader trader) [0x00000] in <filename unknown>:0
  at RWAutoSell.ASJobDriver_TradeWithPawn+<>c__DisplayClass2_0.<MakeNewToils>b__1 () [0x00000] in <filename unknown>:0
  at Verse.AI.JobDriver.TryActuallyStartNextToil () [0x00000] in <filename unknown>:0  lastJobGiver=, curJob.def=TradeWithPawn, curDriver=RWAutoSell.ASJobDriver_TradeWithPawn
Verse.Log:Error(String)
Verse.AI.Pawn_JobTracker:StartErrorRecoverJob(String)
Verse.AI.JobDriver:TryActuallyStartNextToil()
Verse.AI.JobDriver:ReadyForNextToil()
Verse.AI.JobDriver:Notify_PatherArrived()
Verse.AI.Pawn_PathFollower:PatherArrived()
Verse.AI.Pawn_PathFollower:TryEnterNextPathCell()
Verse.AI.Pawn_PathFollower:PatherTick()
Verse.Pawn:Tick()
Verse.TickList:Tick()
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:UpdatePlay()
Verse.Root_Play:Update()
Title: Re: Trade window can't open after prisoner leaves map
Post by: ivusaur on July 28, 2017, 03:03:15 PM
I got this error as well. I think I both had prisoners die and the end of a volcanic winter. It's hard to say if that's relevant though.
Title: Re: Trade window can't open after prisoner leaves map
Post by: ison on September 06, 2017, 09:50:21 AM
Could anyone please upload an unmodded savefile where this happens?
Title: Re: Trade window can't open after prisoner leaves map
Post by: ison on November 08, 2017, 10:41:04 AM
bump
Title: Re: Trade window can't open after prisoner leaves map
Post by: Tynan on September 11, 2018, 02:45:52 AM
Is this bug still occurring?