RimWorld

RimWorld

Sir NutNut Dec 18, 2021 @ 6:22am
Generating Pawns cause red errors (modded)
Hi, I play with some race mods and other kind of mods, and in the beggining of the run, there was no problem, but now it throws around red errors, whenever it wants to generate pawns (Cant get the melatonin?).
https://gist.github.com/a7760219d4c08923950b552b2350849d
did somebody have the same issue and tell me, what mod causes this? Or what in general the problem is?
I know, it's difficult to find the problem when i use so many mods, but maybe somebody had the same issue and already knows a solution.

pls.
Last edited by Sir NutNut; Dec 18, 2021 @ 6:50am
< >
Showing 1-6 of 6 comments
AdmiralTigerclaw Dec 18, 2021 @ 7:04am 
Looking at the log, I notice one thing with the pawn generation errors. They all throw the line:

"Exception: System.NullReferenceException: Object reference not set to an instance of an object"

NullRef exception means that the game is looking for something that should exist, but it doesn't find it in memory. Instead, it's finding a 'blank' or 'NULL' value where that variable should be. The significance of this when you find this exception is that, for example, if the game is looking for a number value, like how many apples you have in a stack, the game isn't finding the memory allocation to the number of apples in said stack. It's not finding zero apples, it's finding null.

IE, I ask: "How many apples do you have?" And query a memory address.
And the game responds with: "What's an apple?"

You don't have 'zero' apples, because you don't even know what an apple is.


Given that the errors thrown seem to be for generating world pawns, you may have a corrupted world pawn list, or something it's looking for is chain-reacting down the pawn generation system.

I note the following:

ROCKETMAN: <color=red>Warm up</color> started for new map!
ROCKETMAN: <color=red>Warm up ABORTED!</color> for new map!
ROCKETMAN: <color=red>Warm up</color> started for new map!
Cannot register Verse.Pawn Ion-Son, (id=Thing_Human681 in loaded object directory. Id already used by Verse.Pawn Ion-Son.
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 39)

This is the first error seen being thrown just after 'ROCKETMAN' loads. The errors below that appear to be Ion-Son's associated gear. The thing that standards out with THIS error is that it's trying to Register Ion-Son, when Ion-Son is already registered. Which may be either you have an Evil Clone problem, or corrupted data.

I would start by pursuing two options:

1: Clear the world pawn list. There's a mod that does that, if it's up to date.
2: Remove 'ROCKETMAN'.


EDIT:
This mod, assuming this is the right link:
https://steamcommunity.com/sharedfiles/filedetails/?id=2559582557&searchtext=memory

If the link isn't right, it's called
"RuntimeGC"

It has various cleanup options, and might be useful to clean up the world pawn list. Start there.

Also, if you don't have it already, install 'ModManager' mod. It can identify if you have out of date mods or bad loading orders for certain mods.

https://steamcommunity.com/sharedfiles/filedetails/?id=1507748539&searchtext=modmanager
Last edited by AdmiralTigerclaw; Dec 18, 2021 @ 7:19am
Sir NutNut Dec 18, 2021 @ 5:59pm 
Thank you very much for the detailed help! I dont know why I didnt come up with rimworld gc since it seems to be none of my colonists.
AdmiralTigerclaw Dec 18, 2021 @ 11:51pm 
Originally posted by Sir NutNut:
Thank you very much for the detailed help! I dont know why I didnt come up with rimworld gc since it seems to be none of my colonists.

NullRef exceptions are one of those things you just sort of learn to watch for over the years. They are the debugger friendly version of CTD, or crash to desktop. Because once-upon-a-time the only response a program had to a finding a null value was to immediately close, as it would not know what to do with itself without the value it was looking for. Now programs are surprisingly robust enough in many cases to throw said error and step around it gracefully. The debug logger catches it, but the program keeps going.
Sir NutNut Dec 19, 2021 @ 3:16am 
Thank you very much. It worked! and also for your explanation. It will hopefully be helpful if I encounter similar problems in another run :lunar2019smilingpig:
AdmiralTigerclaw Dec 19, 2021 @ 11:04am 
Originally posted by Sir NutNut:
Thank you very much. It worked! and also for your explanation. It will hopefully be helpful if I encounter similar problems in another run :lunar2019smilingpig:

Just knowing about NullRef exceptions will make you all the better at reading logs all over the place.

Keep in mind, error logs are MEANT to be understood so errors can be fixed. If you couldn't figure them out, they would be useless. Usually, the errors contain the likes of what the error is and where the error occurred in code. That's more useful to the coders themselves, but you can still use it to narrow down the problem for yourself.

And that's all I did when I sorted through the error log you posted.

First I skimmed the log, scrolling past all the loading messages until things started to look different, then I ran into the ROCKETMAN error. I read the message there, noting what I told you about Ion-Son. I read the errors that followed it, and realized it was just child errors to the first one (In Other Words: All the gear errors stem from the fact that the pawn itself was messed up.)

After that I scrolled further until I ran into the pawn generation errors...

equest : OutlanderCivil, Town_Trader
request : OutlanderCivil, Town_Trader
request : OutlanderCivil, Mercenary_Gunner
request : OutlanderCivil, Mercenary_Gunner
request : OutlanderCivil, Grenadier_Destructive
request : OutlanderCivil, Grenadier_Destructive
Error while generating pawn. Rethrowing. Exception: System.NullReferenceException: Object reference not set to an instance of an object
at RimWorld.ChildRelationUtility.GetMelanin (Verse.Pawn pawn, System.Nullable`1[T] request) [0x0001c] in <cdbd0ed5089a418da09b9a259f9dbd8f>:0
at RimWorld.ChildRelationUtility.ChanceOfBecomingChildOf (Verse.Pawn child, Verse.Pawn father, Verse.Pawn mother, System.Nullable`1[T] childGenerationRequest, System.Nullable`1[T] fatherGenerationRequest, System.Nullable`1[T] motherGenerationRequest) [0x000c3] in <cdbd0ed5089a418da09b9a259f9dbd8f>:0
at (wrapper dynamic-method) RimWorld.PawnRelationWorker_Sibling.RimWorld.PawnRelationWorker_Sibling.GenerationChance_Patch1(RimWorld.PawnRelationWorker_Sibling,Verse.Pawn,Verse.Pawn,Verse.PawnGenerationRequest)
at OneBigFamily.PawnGenerator_Patch+GeneratePawnRelations+<>c__DisplayClass0_0.<Prefix>b__3 (System.Collections.Generic.KeyValuePair`2[TKey,TValue] x) [0x00025] in <0f142c9015a6464e875b47a79bcb140b>:0
at Verse.GenCollection.RandomElementByWeightWithDefault[T] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] weightSelector, System.Single defaultValueWeight) [0x0002f] in <cdbd0ed5089a418da09b9a259f9dbd8f>:0
at OneBigFamily.PawnGenerator_Patch+GeneratePawnRelations.Prefix (Verse.Pawn pawn, Verse.PawnGenerationRequest& request) [0x00167] in <0f142c9015a6464e875b47a79bcb140b>:0
at (wrapper dynamic-method) Verse.PawnGenerator.Verse.PawnGenerator.GeneratePawnRelations_Patch3(Verse.Pawn,Verse.PawnGenerationRequest&)
at (wrapper dynamic-method) Verse.PawnGenerator.Verse.PawnGenerator.TryGenerateNewPawnInternal_Patch4(Verse.PawnGenerationRequest&,string&,bool,bool)
at (wrapper dynamic-method) Verse.PawnGenerator.Verse.PawnGenerator.GenerateNewPawnInternal_Patch1(Verse.PawnGenerationRequest&)
at Verse.PawnGenerator.GenerateOrRedressPawnInternal (Verse.PawnGenerationRequest request) [0x00183] in <cdbd0ed5089a418da09b9a259f9dbd8f>:0
at (wrapper dynamic-method) Verse.PawnGenerator.Verse.PawnGenerator.GeneratePawn_Patch3(Verse.PawnGenerationRequest)
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 39)

When I read this error, I read the error message itself, but the big clue were the lines just above the line 'Error while generating pawn.'

equest : OutlanderCivil, Town_Trader
request : OutlanderCivil, Town_Trader
request : OutlanderCivil, Mercenary_Gunner
request : OutlanderCivil, Mercenary_Gunner
request : OutlanderCivil, Grenadier_Destructive
request : OutlanderCivil, Grenadier_Destructive

This is what it was doing right before it threw the error. It was generating a set of world pawns.


Then I noticed this below the error:

Exception: System.NullReferenceException: Object reference not set to an instance of an object at RimWorld.ChildRelationUtility.ChanceOfBecomingChildOf (Verse.Pawn child, Verse.Pawn father, Verse.Pawn mother, System.Nullable`1[T] childGenerationRequest, System.Nullable`1[T] fatherGenerationRequest, System.Nullable`1[T] motherGenerationRequest) [0x000c3] in <cdbd0ed5089a418da09b9a259f9dbd8f>:0
at (wrapper dynamic-method) RimWorld.PawnRelationWorker_Sibling.RimWorld.PawnRelationWorker_Sibling.GenerationChance_Patch1(RimWorld.PawnRelationWorker_Sibling,Verse.Pawn,Verse.Pawn,Verse.PawnGenerationRequest)

Let me filter that down to what I SAW between the lines in that single error:
**!! NullReferenceException !!**
- ChanceOfBecomingChildOf
- Pawn child
- Pawn father
- Pawn mother
- childGenerationRequest
- fatherGenerationRequest
- motherGenerationRequest
- PawnRelationWorker
- Sibling
- PawnRelationWorker
- Sibling
- PawnGenerationRequest

Does that not look like a problem building a family tree?

At that point, I figured this was going to be a world pawn problem, and I worked from memory that RuntimeGC would be good, because it fixed problems with the world pawn list becoming overloaded.

It's simple assumption and association with a hint of past lessons and remembering tidbits. In short, if you suspect A and B are related when it looks like it in an error log, chances are that they ARE.
Sir NutNut Dec 19, 2021 @ 3:58pm 
That is absolutely logical. I suspected something with world pawns, but didn't see the connection to the rocketman error. And the biggest problem was, that I just had no clue that the term "NullRef" was important in any kind of matter. But now i know better. And if I encounter another problem I will try to see the whole thing, not just error by error.
< >
Showing 1-6 of 6 comments
Per page: 1530 50

Date Posted: Dec 18, 2021 @ 6:22am
Posts: 6