How to find a bugged mod?

Started by Encrtia, August 05, 2021, 08:11:09 AM

Previous topic - Next topic

Encrtia

Hi,

Really simply, I get errors every now & again, to which if I can figure out the mod, I'll remove it. But sometimes I just have no idea how to find it. For instance, right now I've encountered a horrible bug where I can't call in any troopers to help me against a siege. I get the below dump, but no idea how to debug. Could any give me some assistance with this? Any tips what I should be looking out for going forward? Or maybe somewhere else I should be looking that I'm not?

Message logging is now once again on.
UnityEngine.StackTraceUtility:ExtractStackTrace ()
Verse.Log:Message (string)
Verse.Log:ResetMessageCount ()
Verse.Log:Clear ()
Verse.EditWindow_Log:DoWindowContents (UnityEngine.Rect)
Verse.Window:InnerWindowOnGUI (int)
UnityEngine.GUI:CallWindowDelegate (UnityEngine.GUI/WindowFunction,int,int,UnityEngine.GUISkin,int,single,single,UnityEngine.GUIStyle)

Root level exception in OnGUI(): System.MissingMethodException: bool RimWorld.DropCellFinder.TryFindDropSpotNear(Verse.IntVec3,Verse.Map,Verse.IntVec3&,bool,bool,bool,System.Nullable`1<Verse.IntVec2>)
  at (wrapper dynamic-method) RimWorld.PawnsArrivalModeWorker_EdgeDrop.RimWorld.PawnsArrivalModeWorker_EdgeDrop.TryResolveRaidSpawnCenter_Patch1(RimWorld.PawnsArrivalModeWorker_EdgeDrop,RimWorld.IncidentParms)
  at (wrapper dynamic-method) RimWorld.IncidentWorker_Raid.RimWorld.IncidentWorker_Raid.TryExecuteWorker_Patch1(RimWorld.IncidentWorker_Raid,RimWorld.IncidentParms)
  at (wrapper dynamic-method) RimWorld.IncidentWorker.RimWorld.IncidentWorker.TryExecute_Patch3(RimWorld.IncidentWorker,RimWorld.IncidentParms)
  at RimWorld.RoyalTitlePermitWorker_CallAid.CallAid (Verse.Pawn caller, Verse.Map map, Verse.IntVec3 spawnPos, RimWorld.Faction faction, System.Boolean free, System.Single biocodeChance) [0x000a5] in <1b9c4c73530448bcbb33283e1d4d7d05>:0
  at RimWorld.RoyalTitlePermitWorker_CallAid.OrderForceTarget (Verse.LocalTargetInfo target) [0x00014] in <1b9c4c73530448bcbb33283e1d4d7d05>:0
  at (wrapper dynamic-method) RimWorld.Targeter.RimWorld.Targeter.OrderPawnForceTarget_Patch1(RimWorld.Targeter,RimWorld.ITargetingSource)
  at RimWorld.Targeter.OrderVerbForceTarget () [0x0000d] in <1b9c4c73530448bcbb33283e1d4d7d05>:0
  at (wrapper dynamic-method) RimWorld.Targeter.RimWorld.Targeter.ProcessInputEvents_Patch2(RimWorld.Targeter)
  at RimWorld.MapInterface.HandleMapClicks () [0x0001a] in <1b9c4c73530448bcbb33283e1d4d7d05>:0
  at (wrapper dynamic-method) RimWorld.UIRoot_Play.RimWorld.UIRoot_Play.UIRootOnGUI_Patch2(RimWorld.UIRoot_Play)
  at (wrapper dynamic-method) Verse.Root.Verse.Root.OnGUI_Patch1(Verse.Root)
UnityEngine.StackTraceUtility:ExtractStackTrace ()
(wrapper dynamic-method) Verse.Log:Verse.Log.Error_Patch2 (string)
(wrapper dynamic-method) Verse.Root:Verse.Root.OnGUI_Patch1 (Verse.Root)
~When death is smiling at you, just smile on back.

Bozobub

#1
You can make some guesses (mods that affect drop locations is one) BUT a fast way is to:

  • Install a mod manager, such as Fluffy's Mod Manager, if you don't have one already (link to Fluffy's below).
  • Disable HALF your active mods (it doesn't matter which).  Of course, keep anything required for other mods to work, such as HugsLib.
  • Start a new game.  Do the errors appear?

    • If so, that half contains the error!  Go back to step 2, until there's only 1 mod left (plus any required mods , still).  That's the culprit.
    • If not, disable the half you had enabled, re-enable the half you just disabled, and go back to step 3.
Please note that this can fail, for extreme conflicts and/or bugs among several mods.  In THAT case, you'll simply have to go down your mod list, enabling a small number (say, 3-5) at a time, starting a new game each time, until you find the problem(s).  It's relatively foolproof but astonishingly tedious with a big mod list; the above method works rather quickly, give it a whirl before you do it the hard way.  Nine times out of ten, it'll pay off ^^' .

Note:  If you want to check for conflicts with a specific mod/group of mods, simply keep that set of mods active the entire time.  If the errors persist with all other mods disabled, this means that set has an internal conflict and/or bug(s).  You can isolate it using the same procedure.

Fluffy's Mod Manager on Steam: https://steamcommunity.com/sharedfiles/filedetails/?id=1507748539

GitHub: https://github.com/fluffy-mods/ModManager/releases
Thanks, belgord!

RawCode

System.MissingMethodException
==
mod for other version of game

RimWorld.PawnsArrivalModeWorker_EdgeDrop.RimWorld.PawnsArrivalModeWorker_EdgeDrop.TryResolveRaidSpawnCenter_Patch1
+
Patch1
==
code injection code

means that mod provide code injection that designed for other version of rimworld

sadly, you failed to provide complete log, so your only option to disable half of mods as long as needed to solve issue on your own.


Encrtia

Thanks guys, I appreciate the responses. Every patch, I normally do the iterative process of disabling half the mods to step-by-step figure out the new weak link, which I will have to do it seems. I was just checking if more experienced users have quicker ways than such given the game start-up times.

@RawCode, in regards to your comment of "you failed to provide a complete log", how do I obtain such? I'm presuming if I review that, I'll have a better chance at isolating the issue without the aforementioned brute force technique? Thanks for the example code snippets too! Really appreciate clarity to them.
~When death is smiling at you, just smile on back.

RawCode

Windows: %userprofile%\AppData\LocalLow\Ludeon Studios\RimWorld by Ludeon Studios\Player.log
Mac: Users/<YourUserName>/Library/Logs/Unity/RimWorld by Ludeon Studios/Player.log
Linux: /home/<YourUserName>/.config/unity3d/Ludeon Studios/RimWorld/Player.log

Canute

When you use hugslib mod too, at the log window you should see a button "Share logs" that upload modlist + logfile and you can post.
At the log window you see a button "Files" that allow you to open the log file, ...
The internet allow you to search for information like "Rimworld logfile location"
And maybe the 2. link from my signature help you abit to adjust your modlist.



Bozobub

If/when you identify the problem mod(s), remember that *changing the load order* can often resolve otherwise intractable issues.
Thanks, belgord!

RawCode

do you really think that shuffling mods around will change signature of vanilla internal method?

current version of Rimworld have internal sorting based on rules defined in About.xml for every mod, if mod have declaration "load after X", it does not matter what you do, that specific mod will load after X, ever if you put it very first in mod order.


Canute

RawCode, but some people ignore that or don't open Mods window and see there is anything red.
And i don't think steam follow the rules, when you first subscribe a mod and after that you subscribe the required mod.
Since i don't use steam i can't verify my theory why i saw soo many required mods below mods at so many modlist i looked at.