Vectorial1024/EliteBionicsFramework

True Unification with CONN

Closed this issue · 4 comments

Latest news from CONN:

https://steamcommunity.com/sharedfiles/filedetails/changelog/2045064990

image

All body part HP increases are now handled by the Elite Bionics Framework. This is an optional dependency.

This is a good news for all of us because we have one less thing to worry about.

At first glance from my side, what this means is that the Framework is now trying to find something which does not exist, and is throwing errors. This is bad! For the moment, it should be safe to ignore the errors.

It does cause an issue with Pawnmorpher enabled. Specifically when any pawn receives damage, be it Pawnmorpher or normal human.

Exceprt
[V1024-EBF][ERR] Failed to apply Harmony patches for V1024.EBFramework. Exception was: HarmonyLib.HarmonyException: Patching exception in method static System.Reflection.MethodBase EBF.Patches.Unification.CONN.PreFix_CONN_GetMaxHealth::TargetMethod() ---> System.Exception: Method static System.Reflection.MethodBase EBF.Patches.Unification.CONN.PreFix_CONN_GetMaxHealth::TargetMethod() returned an unexpected result: null
  at HarmonyLib.PatchClassProcessor.RunMethod[S,T] (T defaultIfNotExisting, T defaultIfFailing, System.Func`2[T,TResult] failOnResult, System.Object[] parameters) [0x00117] in <255414689d344b1385ae719f6cce8c55>:0 
   --- End of inner exception stack trace ---
  at HarmonyLib.PatchClassProcessor.ReportException (System.Exception exception, System.Reflection.MethodBase original) [0x0010f] in <255414689d344b1385ae719f6cce8c55>:0 
  at HarmonyLib.PatchClassProcessor.Patch () [0x00093] in <255414689d344b1385ae719f6cce8c55>:0 
  at HarmonyLib.Harmony.<PatchAll>b__10_0 (System.Type type) [0x00007] in <255414689d344b1385ae719f6cce8c55>:0 
  at HarmonyLib.CollectionExtensions.Do[T] (System.Collections.Generic.IEnumerable`1[T] sequence, System.Action`1[T] action) [0x00014] in <255414689d344b1385ae719f6cce8c55>:0 
  at HarmonyLib.Harmony.PatchAll (System.Reflection.Assembly assembly) [0x00006] in <255414689d344b1385ae719f6cce8c55>:0 
  at HugsLib.ModBase.ApplyHarmonyPatches () [0x0009a] in <4a46802aeab646ab99159f7eecb6b57e>:0  
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 39)

[HugsLib] initializing V1024-EBF
[HugsLib] Quickstarter generating map with scenario: Crashlanded
[V1024-EBF]  Elite Bionics Framework has detected some mods using the unmodified GetMaxHealth() method, which violates the EBF protocol. The author(s) of the involved mod(s) should adopt the EBF to clarify their intentions.
For now, the unmodified max HP is returned.
The detected mod comes from: Pawnmorph 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 39)

Unloading 5 Unused Serialized files (Serialized files now loaded: 0)

Unloading 51 unused Assets to reduce memory usage. Loaded Objects now: 17235.
Total: 196.357000 ms (FindLiveObjects: 1.018300 ms CreateObjectMapping: 0.856900 ms MarkObjects: 194.345700 ms  DeleteObjects: 0.135600 ms)

Initializing new game with mods:
  - brrainz.harmony
  - Ludeon.RimWorld
  - UnlimitedHugs.HugsLib
  - kikohi.cybernetic
  - V1024.EBFramework
  - erdelf.HumanoidAlienRaces
  - OskarPotocki.VanillaFactionsExpanded.Core
  - tachyonite.pawnmorpherpublic
Exception while generating thing set: System.NotImplementedException: Called a stub before reverse patching is complete.
  at EBF.EBFEndpoints.GetMaxHealthWithEBF (Verse.BodyPartRecord record, Verse.Pawn pawn, System.Boolean useCache) [0x00024] in <1a408bf1a56444d19b17de295ca2ee29>:0 
  at EBF.VanillaExtender.GetMaxHealth (Verse.BodyPartDef def, Verse.Pawn pawn, Verse.BodyPartRecord record) [0x00000] in <1a408bf1a56444d19b17de295ca2ee29>:0 
  at (wrapper dynamic-method) Verse.DamageWorker_AddInjury.Verse.DamageWorker_AddInjury.ReduceDamageToPreserveOutsideParts_Patch0(Verse.DamageWorker_AddInjury,single,Verse.DamageInfo,Verse.Pawn)
  at Verse.DamageWorker_AddInjury.ApplySpecialEffectsToPart (Verse.Pawn pawn, System.Single totalDamage, Verse.DamageInfo dinfo, Verse.DamageWorker+DamageResult result) [0x00000] in <3cca3e6203e64b109fd8ce21f7120d03>:0 
  at (wrapper dynamic-method) Verse.DamageWorker_AddInjury.Verse.DamageWorker_AddInjury.ApplyDamageToPart_Patch1(Verse.DamageWorker_AddInjury,Verse.DamageInfo,Verse.Pawn,Verse.DamageWorker/DamageResult)
  at (wrapper dynamic-method) Verse.DamageWorker_AddInjury.Verse.DamageWorker_AddInjury.ApplyToPawn_Patch0(Verse.DamageWorker_AddInjury,Verse.DamageInfo,Verse.Pawn)
  at Verse.DamageWorker_AddInjury.Apply (Verse.DamageInfo dinfo, Verse.Thing thing) [0x00013] in <3cca3e6203e64b109fd8ce21f7120d03>:0 
  at (wrapper dynamic-method) Verse.Thing.Verse.Thing.TakeDamage_Patch2(Verse.Thing,Verse.DamageInfo)
  at Verse.HealthUtility.DamageUntilDead (Verse.Pawn p) [0x00085] in <3cca3e6203e64b109fd8ce21f7120d03>:0 
  at RimWorld.ThingSetMaker_MapGen_AncientPodContents.GenerateSlave () [0x000a3] in <3cca3e6203e64b109fd8ce21f7120d03>:0 
  at RimWorld.ThingSetMaker_MapGen_AncientPodContents.Generate (RimWorld.ThingSetMakerParams parms, System.Collections.Generic.List`1[T] outThings) [0x00067] in <3cca3e6203e64b109fd8ce21f7120d03>:0 
  at RimWorld.ThingSetMaker.Generate (RimWorld.ThingSetMakerParams parms) [0x00019] in <3cca3e6203e64b109fd8ce21f7120d03>:0  
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 39)

Unloading 0 Unused Serialized files (Serialized files now loaded: 0)

Unloading 0 unused Assets to reduce memory usage. Loaded Objects now: 22187.
Total: 287.435600 ms (FindLiveObjects: 1.832200 ms CreateObjectMapping: 1.881000 ms MarkObjects: 283.659700 ms  DeleteObjects: 0.062400 ms)

Exception ticking Calvin (at (112, 0, 109)): System.NotImplementedException: Called a stub before reverse patching is complete.
  at EBF.EBFEndpoints.GetMaxHealthWithEBF (Verse.BodyPartRecord record, Verse.Pawn pawn, System.Boolean useCache) [0x00024] in <1a408bf1a56444d19b17de295ca2ee29>:0 
  at EBF.VanillaExtender.GetMaxHealth (Verse.BodyPartDef def, Verse.Pawn pawn, Verse.BodyPartRecord record) [0x00000] in <1a408bf1a56444d19b17de295ca2ee29>:0 
  at EBF.Patches.PostFix_HediffInjury_BleedRate.PostFix (Verse.Hediff_Injury __instance, System.Single& __result) [0x00042] in <1a408bf1a56444d19b17de295ca2ee29>:0 
  at (wrapper dynamic-method) Verse.Hediff_Injury.Verse.Hediff_Injury.get_BleedRate_Patch2(Verse.Hediff_Injury)
  at Verse.HediffSet.CalculateBleedRate () [0x00070] in <3cca3e6203e64b109fd8ce21f7120d03>:0 
  at (wrapper dynamic-method) Verse.HediffSet.Verse.HediffSet.get_BleedRateTotal_Patch1(Verse.HediffSet)
  at Verse.Pawn_HealthTracker.HealthTick () [0x003f7] in <3cca3e6203e64b109fd8ce21f7120d03>:0 
  at (wrapper dynamic-method) Verse.Pawn.Verse.Pawn.Tick_Patch1(Verse.Pawn)
  at Verse.TickList.Tick () [0x0015c] in <3cca3e6203e64b109fd8ce21f7120d03>:0  
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 39)

Exception ticking Calvin (at (112, 0, 109)): System.NotImplementedException: Called a stub before reverse patching is complete.
  at EBF.EBFEndpoints.GetMaxHealthWithEBF (Verse.BodyPartRecord record, Verse.Pawn pawn, System.Boolean useCache) [0x00024] in <1a408bf1a56444d19b17de295ca2ee29>:0 
  at EBF.VanillaExtender.GetMaxHealth (Verse.BodyPartDef def, Verse.Pawn pawn, Verse.BodyPartRecord record) [0x00000] in <1a408bf1a56444d19b17de295ca2ee29>:0 
  at EBF.Patches.PostFix_HediffInjury_BleedRate.PostFix (Verse.Hediff_Injury __instance, System.Single& __result) [0x00042] in <1a408bf1a56444d19b17de295ca2ee29>:0 
  at (wrapper dynamic-method) Verse.Hediff_Injury.Verse.Hediff_Injury.get_BleedRate_Patch2(Verse.Hediff_Injury)
  at Verse.HediffSet.CalculateBleedRate () [0x00070] in <3cca3e6203e64b109fd8ce21f7120d03>:0 
  at (wrapper dynamic-method) Verse.HediffSet.Verse.HediffSet.get_BleedRateTotal_Patch1(Verse.HediffSet)
  at Verse.Pawn_HealthTracker.HealthTick () [0x003f7] in <3cca3e6203e64b109fd8ce21f7120d03>:0 
  at (wrapper dynamic-method) Verse.Pawn.Verse.Pawn.Tick_Patch1(Verse.Pawn)
  at Verse.TickList.Tick () [0x0015c] in <3cca3e6203e64b109fd8ce21f7120d03>:0  
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 39)

~~ repeated many times ~~

Extended "unmodified GetMaxHealth" log message
[V1024-EBF]  Elite Bionics Framework has detected some mods using the unmodified GetMaxHealth() method, which violates the EBF protocol. The author(s) of the involved mod(s) should adopt the EBF to clarify their intentions.
For now, the unmodified max HP is returned.
The detected mod comes from: Pawnmorph
UnityEngine.StackTraceUtility:ExtractStackTrace ()
Verse.Log:Error (string)
EBF.EliteBionicsFrameworkMain:LogError (string)
EBF.Patches.Prefix_BodyPart_GetMaxHealth:PreFix (Verse.BodyPartDef,single,Verse.Pawn)
(wrapper dynamic-method) Verse.BodyPartDef:Verse.BodyPartDef.GetMaxHealth_Patch1 (Verse.BodyPartDef,Verse.Pawn)
Pawnmorph.BodyUtilities:GetPartNormalizedHealth (Verse.BodyPartRecord,Verse.Pawn,bool)
Pawnmorph.BodyUtilities:GetPartHealthMultiplier (Verse.Pawn,Verse.BodyPartRecord)
Pawnmorph.HPatches.HediffPatches/PainOffsetPatch:Postfix (Verse.Hediff_Injury,single&)
(wrapper dynamic-method) Verse.Hediff_Injury:Verse.Hediff_Injury.get_PainOffset_Patch1 (Verse.Hediff_Injury)
(wrapper dynamic-method) Verse.HediffSet:Verse.HediffSet.CalculatePain_Patch1 (Verse.HediffSet)
Verse.HediffSet:get_PainTotal ()
RimWorld.PawnCapacityWorker_Consciousness:CalculateCapacityLevel (Verse.HediffSet,System.Collections.Generic.List`1<Verse.PawnCapacityUtility/CapacityImpactor>)
(wrapper dynamic-method) Verse.PawnCapacityUtility:Verse.PawnCapacityUtility.CalculateCapacityLevel_Patch1 (Verse.HediffSet,Verse.PawnCapacityDef,System.Collections.Generic.List`1<Verse.PawnCapacityUtility/CapacityImpactor>,bool)
Verse.PawnCapacitiesHandler:GetLevel (Verse.PawnCapacityDef)
Verse.PawnCapacitiesHandler:CapableOf (Verse.PawnCapacityDef)
Verse.Pawn_HealthTracker:ShouldBeDeadFromRequiredCapacity ()
(wrapper dynamic-method) Verse.Pawn_HealthTracker:Verse.Pawn_HealthTracker.ShouldBeDead_Patch0 (Verse.Pawn_HealthTracker)
Verse.Pawn_HealthTracker:CheckPredicateAfterAddingHediff (Verse.Hediff,System.Func`1<bool>)
Verse.Pawn_HealthTracker:WouldDieAfterAddingHediff (Verse.Hediff)
(wrapper dynamic-method) RimWorld.AgeInjuryUtility:RimWorld.AgeInjuryUtility.GenerateRandomOldAgeInjuries_Patch1 (Verse.Pawn,bool)
(wrapper dynamic-method) Verse.PawnGenerator:Verse.PawnGenerator.GenerateInitialHediffs_Patch3 (Verse.Pawn,Verse.PawnGenerationRequest)
(wrapper dynamic-method) Verse.PawnGenerator:Verse.PawnGenerator.TryGenerateNewPawnInternal_Patch0 (Verse.PawnGenerationRequest&,string&,bool,bool)
(wrapper dynamic-method) Verse.PawnGenerator:Verse.PawnGenerator.GenerateNewPawnInternal_Patch1 (Verse.PawnGenerationRequest&)
Verse.PawnGenerator:GenerateOrRedressPawnInternal (Verse.PawnGenerationRequest)
(wrapper dynamic-method) Verse.PawnGenerator:Verse.PawnGenerator.GeneratePawn_Patch1 (Verse.PawnGenerationRequest)
RimWorld.Faction:TryGenerateNewLeader ()
RimWorld.FactionGenerator:NewGeneratedFaction (RimWorld.FactionGeneratorParms)
(wrapper dynamic-method) RimWorld.FactionGenerator:RimWorld.FactionGenerator.GenerateFactionsIntoWorld_Patch0 (System.Collections.Generic.List`1<RimWorld.FactionDef>)
RimWorld.Planet.WorldGenStep_Factions:GenerateFresh (string)
RimWorld.Planet.WorldGenerator:GenerateWorld (single,string,RimWorld.Planet.OverallRainfall,RimWorld.Planet.OverallTemperature,RimWorld.Planet.OverallPopulation,System.Collections.Generic.List`1<RimWorld.FactionDef>,single)
HugsLib.Quickstart.QuickstartController:ApplyQuickstartConfiguration ()
HugsLib.Quickstart.QuickstartController/<>c:<InitiateMapGeneration>b__7_0 ()
Verse.LongEventHandler:RunEventFromAnotherThread (System.Action)
Verse.LongEventHandler/<>c:<UpdateCurrentAsynchronousEvent>b__27_0 ()
System.Threading.ThreadHelper:ThreadStart_Context (object)
System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object)
System.Threading.ThreadHelper:ThreadStart ()

The EBF.Patches.Unification.CONN.PreFix_CONN_GetMaxHealth::TargetMethod() error occurs once the world is generated/loaded. And as a side note, with this error RimHUD breaks: HUD elements disappear, health tab draws blank, UI Z-levels/draw areas get screwed.

Full log with error. Log without CONN with the same situation.

The bug with CONN is now staging. Imma just group it with other bugfixes that I can find here.

It does cause an issue with Pawnmorpher enabled. Specifically when any pawn receives damage, be it Pawnmorpher or normal human.

I think what happened was that, since the CONN patching failed, it caused some other patches to fail, and eventually, the core functions of this mod (which relies on patches) failed also. In other words, it was probably a secondary error.

The update in response to CONN should also fix this.

The update is live. The CONN error is no more.