Who can help with log analysis to identify a mod problem?

Started by Solarius Scorch, October 19, 2020, 09:11:47 AM

Previous topic - Next topic

Solarius Scorch

I may get no errors, but I'm still not getting any guests... :-\

I just happened to have a mechanoid problem and I got a message that guests are afraid to enter due to that; when I said yes, they still were not generated. Here's what the log says:

Hospitality: Something failed when setting up visitors from faction Pond Cryptodome League (luminous aurora):
System.NullReferenceException: Object reference not set to an instance of an object
  at Hospitality.SpawnGroupUtility.ValidGuest (Verse.Pawn pawn, RimWorld.Faction faction) [0x00008] in <e43536b7e9794111ae228f0955444338>:0
  at Hospitality.SpawnGroupUtility+<>c__DisplayClass9_0.<GetKnownPawns>b__0 (Verse.Pawn pawn) [0x00000] in <e43536b7e9794111ae228f0955444338>:0
  at System.Linq.Enumerable+WhereListIterator`1[TSource].MoveNext () [0x00037] in <351e49e2a5bf4fd6beabb458ce2255f3>:0
  at Hospitality.SpawnGroupUtility+<RandomlyUsingTitleAsChance>d__11.MoveNext () [0x000ca] in <e43536b7e9794111ae228f0955444338>:0
  at System.Collections.Generic.List`1[T]..ctor (System.Collections.Generic.IEnumerable`1[T] collection) [0x00077] in <567df3e0919241ba98db88bec4c6696f>:0
  at System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x00018] in <351e49e2a5bf4fd6beabb458ce2255f3>:0
  at Verse.GenCollection+<InRandomOrder>d__4`1[T].MoveNext () [0x00035] in <6326ac03f61f45efb3178f3bfd084139>:0
  at System.Linq.Enumerable+EnumerablePartition`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 Hospitality.IncidentWorker_VisitorGroup.GetPawnsToSpawn (RimWorld.IncidentParms parms) [0x0002d] in <e43536b7e9794111ae228f0955444338>:0
  at Hospitality.IncidentWorker_VisitorGroup.SpawnPawns (RimWorld.IncidentParms parms, System.Collections.Generic.List`1[T] spawned) [0x0000c] in <e43536b7e9794111ae228f0955444338>:0
  at Hospitality.IncidentWorker_VisitorGroup.SpawnGroup (RimWorld.IncidentParms parms, Verse.Map map) [0x00006] in <e43536b7e9794111ae228f0955444338>:0
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)


I assume the problem happens all the time, but usually there's no warning.

The entire log can be found here: https://gist.github.com/HugsLibRecordKeeper/e44869d96efb9614eab5d539fe33236f

Canute

Try at first to move Hospitality at the end of the modlist and at the beginning after the libaries. Maybe that allready helps.

You should try with the dev tools to spawn more visitors, just to check the error if only that faction give error's or all.
Enable Developer mode at the options
Debug action (Icon top), Do incident (map), Visitorgroup.
When it is only these faction, you need to identify the mod which add that faction, and ask the mod author for help/fix.

I don't think it is because their equipment, the error looks different.

You have plenty of error's afrer loading the safegame, did you remove some mods ?

Try to give Petaxai a new drug policy.

RawCode

run game under debugger and check extended info about error
https://github.com/dnSpy/dnSpy/wiki/Debugging-Unity-Games

perfectly sure that issue actually rise inside RandomlyUsingTitleAsChance and related to outdated mod related to royalty titles that cause pawn lookup to fail.

remove all mods related to royal titles and try again

Solarius Scorch

Many thanks, guys.
To be honest I dropped the game for now, having exhausted my patience to deal with this... But thanks to you, I've decided to give it another try.
I searched the Mods folder for RandomlyUsingTitleAsChance and the only instance I found was in the, well, Hospitality mod. So I disabled it and tried to spawn a trader caravan. And I got this: https://gist.github.com/1009f0ab795cc737177af72846ed57d3

The relevant part is probably this:

Error while generating pawn. Rethrowing. Exception: System.NullReferenceException: Object reference not set to an instance of an object
  at RimWorld.Planet.WorldPawns.GetSituation (Verse.Pawn p) [0x0000b] in <6326ac03f61f45efb3178f3bfd084139>:0
  at RimWorld.Planet.WorldPawns+<>c__DisplayClass27_0.<GetPawnsBySituation>b__0 (Verse.Pawn x) [0x00000] in <6326ac03f61f45efb3178f3bfd084139>:0
  at System.Linq.Utilities+<>c__DisplayClass1_0`1[TSource].<CombinePredicates>b__0 (TSource x) [0x00000] in <351e49e2a5bf4fd6beabb458ce2255f3>:0
  at System.Linq.Enumerable+WhereListIterator`1[TSource].MoveNext () [0x00037] in <351e49e2a5bf4fd6beabb458ce2255f3>:0
  at Verse.GenCollection.TryRandomElementByWeight[T] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] weightSelector, T& result) [0x00186] in <6326ac03f61f45efb3178f3bfd084139>:0
  at Verse.PawnGenerator.GenerateOrRedressPawnInternal (Verse.PawnGenerationRequest request) [0x00144] in <6326ac03f61f45efb3178f3bfd084139>:0
  at (wrapper dynamic-method) Verse.PawnGenerator.Verse.PawnGenerator.GeneratePawn_Patch4(Verse.PawnGenerationRequest)
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

Exception while generating thing set: System.NullReferenceException: Object reference not set to an instance of an object
  at RimWorld.Planet.WorldPawns.GetSituation (Verse.Pawn p) [0x0000b] in <6326ac03f61f45efb3178f3bfd084139>:0
  at RimWorld.Planet.WorldPawns+<>c__DisplayClass27_0.<GetPawnsBySituation>b__0 (Verse.Pawn x) [0x00000] in <6326ac03f61f45efb3178f3bfd084139>:0
  at System.Linq.Utilities+<>c__DisplayClass1_0`1[TSource].<CombinePredicates>b__0 (TSource x) [0x00000] in <351e49e2a5bf4fd6beabb458ce2255f3>:0
  at System.Linq.Enumerable+WhereListIterator`1[TSource].MoveNext () [0x00037] in <351e49e2a5bf4fd6beabb458ce2255f3>:0
  at Verse.GenCollection.TryRandomElementByWeight[T] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] weightSelector, T& result) [0x00186] in <6326ac03f61f45efb3178f3bfd084139>:0
  at Verse.PawnGenerator.GenerateOrRedressPawnInternal (Verse.PawnGenerationRequest request) [0x00144] in <6326ac03f61f45efb3178f3bfd084139>:0
  at (wrapper dynamic-method) Verse.PawnGenerator.Verse.PawnGenerator.GeneratePawn_Patch4(Verse.PawnGenerationRequest)
  at RimWorld.StockGenerator_Animals+<GenerateThings>d__7.MoveNext () [0x001a1] in <6326ac03f61f45efb3178f3bfd084139>:0
  at RimWorld.ThingSetMaker_TraderStock.Generate (RimWorld.ThingSetMakerParams parms, System.Collections.Generic.List`1[T] outThings) [0x000e5] in <6326ac03f61f45efb3178f3bfd084139>:0
  at RimWorld.ThingSetMaker.Generate (RimWorld.ThingSetMakerParams parms) [0x00019] in <6326ac03f61f45efb3178f3bfd084139>:0
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

Error while generating pawn. Rethrowing. Exception: System.NullReferenceException: Object reference not set to an instance of an object
  at RimWorld.Planet.WorldPawns.GetSituation (Verse.Pawn p) [0x0000b] in <6326ac03f61f45efb3178f3bfd084139>:0
  at RimWorld.Planet.WorldPawns+<>c__DisplayClass27_0.<GetPawnsBySituation>b__0 (Verse.Pawn x) [0x00000] in <6326ac03f61f45efb3178f3bfd084139>:0
  at System.Linq.Utilities+<>c__DisplayClass1_0`1[TSource].<CombinePredicates>b__0 (TSource x) [0x00000] in <351e49e2a5bf4fd6beabb458ce2255f3>:0
  at System.Linq.Enumerable+WhereListIterator`1[TSource].MoveNext () [0x00037] in <351e49e2a5bf4fd6beabb458ce2255f3>:0
  at Verse.GenCollection.TryRandomElementByWeight[T] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] weightSelector, T& result) [0x00186] in <6326ac03f61f45efb3178f3bfd084139>:0
  at Verse.PawnGenerator.GenerateOrRedressPawnInternal (Verse.PawnGenerationRequest request) [0x00144] in <6326ac03f61f45efb3178f3bfd084139>:0
  at (wrapper dynamic-method) Verse.PawnGenerator.Verse.PawnGenerator.GeneratePawn_Patch4(Verse.PawnGenerationRequest)
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

Exception while generating pawn group: System.NullReferenceException: Object reference not set to an instance of an object
  at RimWorld.Planet.WorldPawns.GetSituation (Verse.Pawn p) [0x0000b] in <6326ac03f61f45efb3178f3bfd084139>:0
  at RimWorld.Planet.WorldPawns+<>c__DisplayClass27_0.<GetPawnsBySituation>b__0 (Verse.Pawn x) [0x00000] in <6326ac03f61f45efb3178f3bfd084139>:0
  at System.Linq.Utilities+<>c__DisplayClass1_0`1[TSource].<CombinePredicates>b__0 (TSource x) [0x00000] in <351e49e2a5bf4fd6beabb458ce2255f3>:0
  at System.Linq.Enumerable+WhereListIterator`1[TSource].MoveNext () [0x00037] in <351e49e2a5bf4fd6beabb458ce2255f3>:0
  at Verse.GenCollection.TryRandomElementByWeight[T] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] weightSelector, T& result) [0x00186] in <6326ac03f61f45efb3178f3bfd084139>:0
  at Verse.PawnGenerator.GenerateOrRedressPawnInternal (Verse.PawnGenerationRequest request) [0x00144] in <6326ac03f61f45efb3178f3bfd084139>:0
  at (wrapper dynamic-method) Verse.PawnGenerator.Verse.PawnGenerator.GeneratePawn_Patch4(Verse.PawnGenerationRequest)
  at RimWorld.PawnGroupKindWorker_Trader.GenerateGuards (RimWorld.PawnGroupMakerParms parms, RimWorld.PawnGroupMaker groupMaker, Verse.Pawn trader, System.Collections.Generic.List`1[T] wares, System.Collections.Generic.List`1[T] outPawns) [0x00097] in <6326ac03f61f45efb3178f3bfd084139>:0
  at RimWorld.PawnGroupKindWorker_Trader.GeneratePawns (RimWorld.PawnGroupMakerParms parms, RimWorld.PawnGroupMaker groupMaker, System.Collections.Generic.List`1[T] outPawns, System.Boolean errorOnZeroResults) [0x00233] in <6326ac03f61f45efb3178f3bfd084139>:0
  at (wrapper dynamic-method) RimWorld.PawnGroupKindWorker.RimWorld.PawnGroupKindWorker.GeneratePawns_Patch1(RimWorld.PawnGroupKindWorker,RimWorld.PawnGroupMakerParms,RimWorld.PawnGroupMaker,bool)
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

(...)

Exception while generating pawn group: System.NullReferenceException: Object reference not set to an instance of an object
  at RimWorld.Planet.WorldPawns.GetSituation (Verse.Pawn p) [0x0000b] in <6326ac03f61f45efb3178f3bfd084139>:0
  at RimWorld.Planet.WorldPawns+<>c__DisplayClass27_0.<GetPawnsBySituation>b__0 (Verse.Pawn x) [0x00000] in <6326ac03f61f45efb3178f3bfd084139>:0
  at System.Linq.Utilities+<>c__DisplayClass1_0`1[TSource].<CombinePredicates>b__0 (TSource x) [0x00000] in <351e49e2a5bf4fd6beabb458ce2255f3>:0
  at System.Linq.Enumerable+WhereListIterator`1[TSource].MoveNext () [0x00037] in <351e49e2a5bf4fd6beabb458ce2255f3>:0
  at Verse.GenCollection.TryRandomElementByWeight[T] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] weightSelector, T& result) [0x00186] in <6326ac03f61f45efb3178f3bfd084139>:0
  at Verse.PawnGenerator.GenerateOrRedressPawnInternal (Verse.PawnGenerationRequest request) [0x00144] in <6326ac03f61f45efb3178f3bfd084139>:0
  at (wrapper dynamic-method) Verse.PawnGenerator.Verse.PawnGenerator.GeneratePawn_Patch4(Verse.PawnGenerationRequest)
  at RimWorld.PawnGroupKindWorker_Trader.GenerateCarriers (RimWorld.PawnGroupMakerParms parms, RimWorld.PawnGroupMaker groupMaker, Verse.Pawn trader, System.Collections.Generic.List`1[T] wares, System.Collections.Generic.List`1[T] outPawns) [0x0011e] in <6326ac03f61f45efb3178f3bfd084139>:0
  at RimWorld.PawnGroupKindWorker_Trader.GeneratePawns (RimWorld.PawnGroupMakerParms parms, RimWorld.PawnGroupMaker groupMaker, System.Collections.Generic.List`1[T] outPawns, System.Boolean errorOnZeroResults) [0x00228] in <6326ac03f61f45efb3178f3bfd084139>:0
  at (wrapper dynamic-method) RimWorld.PawnGroupKindWorker.RimWorld.PawnGroupKindWorker.GeneratePawns_Patch1(RimWorld.PawnGroupKindWorker,RimWorld.PawnGroupMakerParms,RimWorld.PawnGroupMaker,bool)
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)


However, after I tried doing the same on a new colony, everything went fine: the caravan spawned (with delay, as I'm using a mod to detect movement ahead of time), with a trader, and the trader was just fine as well.

Any ideas what can be wrong with my current campaign and how to fix it? I know it's an extremely hard question, but maybe you have some idea.

RawCode

RandomlyUsingTitleAsChance is not source of error, other mod that messed with pawn data is source.

to determinate what exactly pawn record (or other data) caused pawn lookup failure, you must use debugger or make custom patches that will expose data (or make pawn lookup work in more robust way and instead of failing on some record, skip it and continue).

ever if you remove every mod that inject into pawn generation, (use "GeneratePawn" as keyword over your log and it will tell mods that add injections to this method) your save likely to fail

in your case injections are vanilla extended, alien races and some mod with meaningless name, if you removed all mods properly GeneratePawn_Patch4 in trace output will display as GeneratePawn

if this helped, enable mods one by one, if not, you will need debugger or custom patches


Solarius Scorch

Sorry, I have no idea what kind of debugger you're talking about. I don't think I can remove these mods anyway, even for testing purposes, and still be able to load the game at all.

Anyway, things seem to work fine on a new save, so I guess that old one is not salvageable... Oh well.

Canute

As player you don't need to use a debugger, that is basicly a developer tool.
It might could help to identify the mod who cause the problem, then you can contact the mod author so he can try fix the problem.
But you prolly need some better knowledge about XML and maybe C# to get any useful information. Unless you want to start modding at your own i think you should forget it.

But to identify a mod or mods that conflict is very hard or impossible for a player at an ongoing colony.
Like you notice self, at a new colony anything is working, but only later error's happen.
That is because later you have access to different items, guests/raiders got more point's to spawn and use advanced/expensive items.

As player you don't have much choises, mosttimes you need to life with the problems if they arn't gamebreaking or start a new colony with less/different mods.
Be sure you don't have error's after mod activation that increase the chance that you don't have problems later.
More mods = more chances for problems.
If you like to play with many mods, maybe look at some mod collection other people shared at steam.


But

Solarius Scorch

Got it... Thanks for sharing, I appreciate it.
Have a good New Year!

Asmith

After updating a few mods I started having this exact same issue (no hospitality visitors, all traders and towns have empty inventory)...  Did you ever have any luck figuring this out?

Canute

You should look at the log window and check for errors.
If you get some luck, you can maybe see a modname, but i wouldn't bet on it.
My guess are that there are some items that cause the problems when rimworld generate the inventories.

Developer mode on at the option
Create a new colony (if you use hugslib use the quickstart feature, top right icon shift-click).
Then create an incident (map) visitor or caravan, when they got empty inventories, just disable some mod's that add stuff to the game and try it again.