[1.0] Common Sense - basic AI tweaks

Started by avilmask, March 20, 2019, 10:41:51 AM

Previous topic - Next topic

Sonsalt

When guests are present, this is what appears

Sheep did not get a relax job.
Verse.Log:Error(String, Boolean)
Verse.Log:ErrorOnce(String, Int32, Boolean)
Hospitality.JobGiver_Relax:TryGiveJob(Pawn)
Verse.AI.ThinkNode_JobGiver:TryIssueJobPackage_Patch2(Object, Pawn, JobIssueParams)
Verse.AI.ThinkNode_PrioritySorter:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage(Pawn, JobIssueParams)
Hospitality.ThinkNode_FilterGuestRooms:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage(Pawn, JobIssueParams)
RimWorld.ThinkNode_Duty:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Conditional:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Tagger:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Subtree:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage(Pawn, JobIssueParams)
RimWorld.ThinkNode_JoinVoluntarilyJoinableLord:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.Pawn_JobTracker:DetermineNextJob_Patch4(Object, ThinkTreeDef&)
Verse.AI.Pawn_JobTracker:TryFindAndStartJob()
Verse.AI.Pawn_JobTracker:EndCurrentJob_Patch1(Object, JobCondition, Boolean)
Verse.AI.Pawn_JobTracker:JobTrackerTick()
Verse.Pawn:Tick_Patch2(Object)
Verse.TickList:Tick()
Verse.TickManager:DoSingleTick()
ZombieLand.Verse_TickManager_TickManagerUpdate_Patch:SingleTick(TickManager, Int32)
Verse.TickManager:TickManagerUpdate_Patch1(Object)
Verse.Game:UpdatePlay()
Verse.Root_Play:Update()


Sheep has a null area!
Verse.Log:Error(String, Boolean)
Verse.Log:ErrorOnce(String, Int32, Boolean)
Hospitality.JobGiver_Relax:CheckArea(Pawn)
Hospitality.JobGiver_Relax:TryGiveJob(Pawn)
Verse.AI.ThinkNode_JobGiver:TryIssueJobPackage_Patch2(Object, Pawn, JobIssueParams)
Verse.AI.ThinkNode_PrioritySorter:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage(Pawn, JobIssueParams)
Hospitality.ThinkNode_FilterGuestRooms:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage(Pawn, JobIssueParams)
RimWorld.ThinkNode_Duty:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Conditional:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Tagger:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Subtree:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage(Pawn, JobIssueParams)
RimWorld.ThinkNode_JoinVoluntarilyJoinableLord:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.Pawn_JobTracker:DetermineNextJob_Patch4(Object, ThinkTreeDef&)
Verse.AI.Pawn_JobTracker:TryFindAndStartJob()
Verse.AI.Pawn_JobTracker:EndCurrentJob_Patch1(Object, JobCondition, Boolean)
Verse.AI.Pawn_JobTracker:JobTrackerTick()
Verse.Pawn:Tick_Patch2(Object)
Verse.TickList:Tick()
Verse.TickManager:DoSingleTick()
ZombieLand.Verse_TickManager_TickManagerUpdate_Patch:SingleTick(TickManager, Int32)
Verse.TickManager:TickManagerUpdate_Patch1(Object)
Verse.Game:UpdatePlay()
Verse.Root_Play:Update()

code99xx

#46
There is a small issue ive been having lately.

All my pawns have highest priority for bed rest so when they get injured they, in theory, should go to bed to rest and heal/be tended by a doctor.
Ive noticed tho that with this mod they will prioritize cleaning their room first? I had one pawn that was badly injured from a raid that decided to first clean the room he was sleeping in before laying in bed which in his case he was in a temporary large bunk (took him a bit to clean)

He came very close of bleeding to death.

This may be an issue with your mod or with some other mod i have installed (i have a ...a few)

Ideas?

Canute

The author promise at last for surgery the pawn's don't clean when the patient is bleeding out. But i don't know if it is the case for patient too.
I am unsure if i encounter such similar thing at my playthrough too and i used this mod since it came out.
But i encounter some races with their own logic and pawn's from that race liked to do regular work with wounds instead to goto hospital beds.

Engreaved

Quote from: avilmask on March 20, 2019, 10:41:51 AM
Common Sense



Man, it works good. My colony thrills now. No more retardness. U r savior.

avilmask

#49
Sorry for getting drifted away from ludeon page of my mod. Didn't play the game for awhile, and then I kinda forgot that I have more than a steam page for a mod :P Still, my github version is always on par with steam version. Maybe I should unlock issues tab on github, because I actually get notifications from git, unlike ludeon forum (changed some settings in my profile. I hope now they gonna work).

Pangaea

Quote from: code99xx on July 20, 2019, 11:44:43 PM
Ive noticed tho that with this mod they will prioritize cleaning their room first? I had one pawn that was badly injured from a raid that decided to first clean the room he was sleeping in before laying in bed which in his case he was in a temporary large bunk (took him a bit to clean)

He came very close of bleeding to death.

I had this very same issue and it annoyed me. Coupled with the other idiocy of people refusing to stay in bed in hospital... gah!

Thankfully there is a solution to this problem. Go into the mod settings and turn off the option of people cleaning their workstations before using it. For some reason that includes people going to bed too, including when they are bleeding to death and would prefer to clean the hospital instead of living.

avilmask

#51
Quote from: Pangaea on September 24, 2019, 03:13:52 PM
I had this very same issue and it annoyed me. Coupled with the other idiocy of people refusing to stay in bed in hospital... gah!

Thankfully there is a solution to this problem. Go into the mod settings and turn off the option of people cleaning their workstations before using it. For some reason that includes people going to bed too, including when they are bleeding to death and would prefer to clean the hospital instead of living.
I remember that issue. It was fixed this or last month. Now injured pawns (that need tending) ignore cleaning opportunities.
Also there was added a limit on how much pawn should clean, base value is 5 patches of filth, but can be changed in mod settings.

Pangaea

Quote from: avilmask on September 25, 2019, 06:12:17 AM
I remember that issue. It was fixed this or last month. Now injured pawns (that need tending) ignore cleaning opportunities.
Also there was added a limit on how much pawn should clean, base value is 5 patches of filth, but can be changed in mod settings.

Thanks for the pointer, I must have had an older version then. From the changelog it was fixed in v.1.1.12. According to the mod thingy in-game I had 1.1.10.

But then I downloaded the new one and it's still listed as v1.1.10 in-game, despite the files being from yesterday and git saying v1.1.17. I fiddle about a little, and see that About/Manifest.xml says 1.1.10, which is probably where the Mod Manager looks. Can you please update that file?

Anyway, with the new version this shouldn't a problem any more, so thank you. It was pretty frustrating.

Fantastic mod, though. The game is so much more sensible with it :P

Think this is a classic case of: once you have played with Common Sense + Pick up and Haul, you can't go back.

Pangaea

Small query:

Noticed this when looking through some changed files. Is the incorrect spelling actually correct in code terms, or should it be "tending" ?

From OpportunisticTasks.cs

if (Settings.clean_after_tanding && condition == JobCondition.Succeeded && __instance.jobQueue != null &&

avilmask

#54
Quote from: Pangaea on September 26, 2019, 01:57:19 PM
Small query:

Noticed this when looking through some changed files. Is the incorrect spelling actually correct in code terms, or should it be "tending" ?

From OpportunisticTasks.cs

if (Settings.clean_after_tanding && condition == JobCondition.Succeeded && __instance.jobQueue != null &&
It's a misspell :)

Think3r

Dear avilmask,

would you please create "releases" in Github when you added new features or fixed bugs? Then, I'd get notified. I don't use Fluffys Mod Manager as it lacks the overview of the Vanilla mod window.

Greetings

avilmask

Quote from: Think3r on September 28, 2019, 07:37:09 AM
Dear avilmask,

would you please create "releases" in Github when you added new features or fixed bugs? Then, I'd get notified. I don't use Fluffys Mod Manager as it lacks the overview of the Vanilla mod window.

Greetings
Alright, I'll try to make something happen.

Canute

avilmask,
someone just post this logfile
https://gist.github.com/HugsLibRecordKeeper/d5fb23e2a74faf91a710202f40851c14
Error while instantiating a mod of type CommonSense.CommonSense: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.
  at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
  at System.Reflection.Assembly.GetTypes () [0x00000] in <filename unknown>:0
  at Harmony.AccessTools+<>c.<TypeByName>b__1_0 (System.Reflection.Assembly x) [0x00000] in <filename unknown>:0
  at System.Linq.Enumerable+<CreateSelectManyIterator>c__Iterator12`2[System.Reflection.Assembly,System.Type].MoveNext () [0x00000] in <filename unknown>:0
  at System.Linq.Enumerable.First[Type] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback) [0x00000] in <filename unknown>:0
  at System.Linq.Enumerable.FirstOrDefault[Type] (IEnumerable`1 source, System.Func`2 predicate) [0x00000] in <filename unknown>:0
  at Harmony.AccessTools.TypeByName (System.String name) [0x00000] in <filename unknown>:0
  at CommonSense.PatchBadHy+JobGiver_UseToilet_GetPriority_CommonSensePatch.Prepare () [0x00000] in <filename unknown>:0
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0
  at Harmony.PatchProcessor.RunMethod[HarmonyPrepare,Boolean] (Boolean defaultIfNotExisting, System.Object[] parameters) [0x00000] in <filename unknown>:0
  at Harmony.PatchProcessor.PrepareType () [0x00000] in <filename unknown>:0
  at Harmony.PatchProcessor..ctor (Harmony.HarmonyInstance instance, System.Type type, Harmony.HarmonyMethod attributes) [0x00000] in <filename unknown>:0
  at Harmony.HarmonyInstance.<PatchAll>b__9_0 (System.Type type) [0x00000] in <filename unknown>:0
  at Harmony.CollectionExtensions.Do[Type] (IEnumerable`1 sequence, System.Action`1 action) [0x00000] in <filename unknown>:0
  at Harmony.HarmonyInstance.PatchAll (System.Reflection.Assembly assembly) [0x00000] in <filename unknown>:0
  at CommonSense.CommonSense..ctor (Verse.ModContentPack content) [0x00000] in <filename unknown>:0
  at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (object,object[],System.Exception&)
  at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
  at System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
  at System.Activator.CreateInstance (System.Type type, BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes) [0x00000] in <filename unknown>:0
  at System.Activator.CreateInstance (System.Type type, System.Object[] args, System.Object[] activationAttributes) [0x00000] in <filename unknown>:0
  at System.Activator.CreateInstance (System.Type type, System.Object[] args) [0x00000] in <filename unknown>:0
  at Verse.LoadedModManager.CreateModClasses () [0x00000] in <fil

Does this error mean Common sense try to patch Dub hygiene but that mod isn't active.

avilmask

#58
Quote from: Canute on January 24, 2020, 04:25:48 AM
avilmask,
someone just post this logfile
https://gist.github.com/HugsLibRecordKeeper/d5fb23e2a74faf91a710202f40851c14
...
Does this error mean Common sense try to patch Dub hygiene but that mod isn't active.
Hm, not supposed to happen. I make play tests without bad hygiene, and never had any issues, since changes supposed to be applied ONLY if mod is present. I guess I should take a look into it.

Could you please try to use the mod ALONE? To be sure that nothing else interferes with the mod.

Canute

Like i said, someone not me.
https://ludeon.com/forums/index.php?topic=50107.0

Just test it myself, not these error but a warning
Tried to use an uninitialized DefOf of type StatDefOf. DefOfs are initialized right after all defs all loaded. Uninitialized DefOfs will return only nulls. (hint: don't use DefOfs as default field values in Defs, try to resolve them in ResolveReferences() instead)
Verse.Log:Warning(String, Boolean)
RimWorld.DefOfHelper:EnsureInitializedInCtor(Type)
RimWorld.StatDefOf:.cctor()
System.RuntimeMethodHandle:GetFunctionPointer(IntPtr)
System.RuntimeMethodHandle:GetFunctionPointer()
Harmony.ILCopying.Memory:GetMethodStart(MethodBase, Exception&)
Harmony.ILCopying.Memory:DetourMethod(MethodBase, MethodBase)
Harmony.PatchFunctions:UpdateWrapper(MethodBase, PatchInfo, String)
Harmony.PatchProcessor:Patch()
Harmony.HarmonyInstance:<PatchAll>b__9_0(Type)
Harmony.CollectionExtensions:Do(IEnumerable`1, Action`1)
Harmony.HarmonyInstance:PatchAll(Assembly)
CommonSense.CommonSense:.ctor(ModContentPack)
System.Reflection.MonoCMethod:InternalInvoke(Object, Object[], Exception&)
System.Reflection.MonoCMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
System.Reflection.MonoCMethod:Invoke(BindingFlags, Binder, Object[], CultureInfo)
System.Activator:CreateInstance(Type, BindingFlags, Binder, Object[], CultureInfo, Object[])
System.Activator:CreateInstance(Type, Object[], Object[])
System.Activator:CreateInstance(Type, Object[])
Verse.LoadedModManager:CreateModClasses()
Verse.LoadedModManager:LoadAllActiveMods()
Verse.PlayDataLoader:DoPlayLoad()
Verse.PlayDataLoader:LoadAllPlayData(Boolean)
Verse.Root:<Start>m__1()
Verse.LongEventHandler:RunEventFromAnotherThread(Action)
Verse.LongEventHandler:<UpdateCurrentAsynchronousEvent>m__1()

https://gist.github.com/d36d4f420d879bd5382aab67a60e1b6f