Ludeon Forums

RimWorld => Mods => Releases => Topic started by: avilmask on March 20, 2019, 10:41:51 AM

Title: [1.0] Common Sense - basic AI tweaks
Post by: avilmask on March 20, 2019, 10:41:51 AM
Links for Common Sense 1.1.4 Mod: Steam Workshop (https://steamcommunity.com/sharedfiles/filedetails/?id=1561769193) | non-Steam GitHub (https://github.com/catgirlfighter/RimWorld_CommonSense)


Description:

Idea of this mod is to optimize some basic behaviors of colonist AI.

(https://i.imgur.com/Uj6ThmF.gif)
More visual examples on Steam page.

All behaviors, introduced in the mod, are optional and can be disabled right in the middle of on-going game.
This Mod supposed to be safe to install and uninstall whenever. But in rare cases some pawns can glitch out and freeze in place. Just draft and undraft them to reset their AI.

Highlights:
- fulfilling outdoors need. I didn't add any new recreational actions, instead I've tried to give colonists joy sources that they could perform outdoors. So if you have unique sources of joy, that placed "outdoors" ("unroofed" doesn't count as outdoors), colonists will prioritize them if they need some fresh air;
- when colonists are set to use drugs when their happiness is at set level, they often can take 3 or 4 dozes of a drug before their mood finally reaches a threshold (because mood doesn't recover instantly). This mod can prevent pawns from overusing drugs, taking into account potential mood growth;
- you can prevent pawns from stacking bad food (i.e. made of gross or inappropriate ingredients) with normal one, keeping it separate. Optionally you can allow ingredients that isn't "humanlike meat";
- colonists can take an opportunity to clean a room before operating a building. For example, going to sleep (yep, it counts as operating a building), or researching;
- colonists can clean rooms after tending to a patient. They don't do that if they have other jobs in queue (to prevent them from wasting time when they're queued to tend a couple of patients, or whatever else you could force them to do right after tending someone);
- colonists can switch to hauling if ingredients, that they're supposed to take for crafting, are not in a stackpile. It's useful if you don't like when your pawns pick that 10 pieces of steel in the middle of nowhere, instead of hauling 75 of it to the stockpile. Items, that have max. stack size of 1, don't count (ex. stone chunks);
- colonists can clean the room in between hauling to the crafting place and actual crafting, to save time;
- colonists can pick up all required ingredients all at once, and bring them to the crafting place, to save time;
- since for "picking up all at once" I had to make some simple inventory management mechanics, I've also made an option to manually mark items for unloading, so you can "ask" pawns to haul items from their inventory to the closest stockpile, as an alternative to dropping it on the ground;
- pawns don't drop on the ground items, that they took from their own inventory into hands and was interrupted in the middle of an action (no more dropping meals on drafting intensities);
- pawns can learn to stop taking more sweets than they can eat (no more unfinished chocolate in random places);
- pawns can prioritize close to spoiling ingredients over fresh ones, so none will go to waste;
- pawns can prioritize spoiling healroot and corpses (for butchering :P). The same reasoning as for ingredients;
- colonists will prefer finishing off the meals that gonna spoil soon. The closer meal is to spoiling, the more likely they're to chose it. Though colonists not gonna chose a simple meal, made of insect, over normal lavish meal anyway. It's under the same option as prioritization of ingredients.
- if colonist is on sleeping schedule, but can't sleep for some reason, he will act like he's on recreation;
- after topping off recreation, pawns will not try to take recreational activity until it's down to 80%;
- when on recreation, pawns will try to take spare meals and fill hygiene needs (with "dubs bad hygiene" mod on);

Non-AI changes (that probably gonna be separated into new mods soon):
- show full list of ingredients, allowed in a recipe, instead of vague "ingredients" (modded in "special recipes" usually look like "you need 1 ingredient, 1 ingredient, 1 ingredient and 1 ingredient);
- add random ingredients to randomly generated foods. Just for flavor. Because it's funny to wonder, where the hell did you get that simple meal, made of yorkshire terriers. Random meals never use "bad" ingredients, so they're safe.

Alright, no further plans for now.

Known incompatibilities:
- there's one problem with GiddyUp mod if cleaning before doing a job is enabled. Have now clue why (yet, I'll be looking into it), but mounted animals don't get released properly and stand around until get a command or something like that;

Mod powered by Harmony.
Chinese translation by chrisxlite;


Links for Common Sense Mod: Steam Workshop (https://steamcommunity.com/sharedfiles/filedetails/?id=1561769193) | non-Steam GitHub (https://github.com/catgirlfighter/RimWorld_CommonSense)
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: Canute on March 20, 2019, 12:53:29 PM
Hi,
if that all works like you describe it, it would be a hugh advancement at the AI behavior at some ways.

Quote- since for "picking up all at once" I had to make some simple inventory management mechanics,
Did you check the compatiblity with other inventory mods like PickUp&Haul and Combat Extended ?

In the case of your demo pic, ok it doing a surgery before instaling some prothetic. But when it need to tend wounds, did do a bleed out check before he start to clean the hospital so he don't run out of time ?:-)
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: avilmask on March 20, 2019, 02:36:48 PM
Quote from: Canute on March 20, 2019, 12:53:29 PM
Did you check the compatiblity with other inventory mods like PickUp&Haul and Combat Extended ?

In the case of your demo pic, ok it doing a surgery before instaling some prothetic. But when it need to tend wounds, did do a bleed out check before he start to clean the hospital so he don't run out of time ?:-)
PickUp&Haul I use myself, so can confirm there is no compatibility issues. Didn't play combat extended, and I had no reports about issues with it.
I don't let colonists to decide on their own, whom they should tend and in which order, if it's urgent, and they never clean rooms if there is another jobs in queue, so no, I had no urgent tending in mind. And it would be hard to do, because it would require to know, what's next job it will be after ending current one. Plus knowing a gimmick, it's easy to play around it. Also this behavior is optional and can be reverted to default if it causes inconvenience. If there is a mod, that allows to re-prioritize tending by urgency, I could make something up to prevent pawns from cleaning on some condition, for example if job is forced. With vanilla AI patients would bleed out anyway, since surgeon would likely go to watch TV or something :P
Each behavior is "optional", and it's possible to disable them individually, reverting to standard activity. That way you may avoid conflicts with other mods (don't forget to report it) or disable what you dislike (ex. many people think that using inventory is cheating).
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: emeraldmoonx on March 20, 2019, 03:01:07 PM
Looks good, hoping it works good with all my mods lol. Will be trying it today.
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: jager666 on March 20, 2019, 03:35:23 PM
How does this mod affect performance? Is there any known incompatibilities?
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: avilmask on March 20, 2019, 04:13:14 PM
Quote from: jager666 on March 20, 2019, 03:35:23 PM
How does this mod affect performance? Is there any known incompatibilities?
Changing priorities PROBABLY somehow impacts performance. I didn't add any new tickers or something. Nothing visible on my machine with 12 pawns.
No known incompatibilities. If you find any - don't be shy to report.
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: ertzuiop on March 20, 2019, 06:19:13 PM
Doubles in the settings.

[attachment deleted due to age]
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: avilmask on March 20, 2019, 07:03:54 PM
Quote from: ertzuiop on March 20, 2019, 06:19:13 PM
Doubles in the settings.
Updated to 1.1.1. Fixed it.
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: DiamondBorne on March 21, 2019, 04:23:18 PM
Superb mod. I probably able to remove more than a few rebundant mods with this, thanks.  :)
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: avilmask on March 22, 2019, 03:26:17 PM
Updated to 1.1.2:
- changed pawn priorities for sleeping schedule. Now they'll prioritize topping off joy need if they happen to wake up early;
- added an option to prevent colonists from taking joy activities if they're already topped off (after reaching 95%, they'll not start it again until it's down to 80%);
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: Canute on March 22, 2019, 04:30:57 PM
Quote- changed pawn priorities for sleeping schedule. Now they'll prioritize topping off joy need if they happen to wake up early;
Yeah, good thing.
Since many use Dub's hygiene mod, what's about to lets them use the toilet too.
And about food ?
So after they woke up, they clean themself, doing breakfirst (yes i know not everyone doing breakfirst) before they are going to work.
Nothing worse that a pawn is going to mine after the woke up, forget his lunchpackage and need to go home to eat.
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: avilmask on March 22, 2019, 05:26:44 PM
Quote from: Canute on March 22, 2019, 04:30:57 PM
Since many use Dub's hygiene mod, what's about to lets them use the toilet too.
And about food ?
So after they woke up, they clean themself, doing breakfirst (yes i know not everyone doing breakfirst) before they are going to work.
Nothing worse that a pawn is going to mine after the woke up, forget his lunchpackage and need to go home to eat.
I guess I could look into bad hygiene mod. Still not sure, how I feel about making tweaks for different mods :P
Nice touch about forgotten lunches, I thought about them at some point, too. I'll do something about that.
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: Marcus on March 23, 2019, 06:34:09 AM
Great mod, I like the options 'clean the room before sleep' and 'clean the surrounding before work' - no dedicated cleaners needed. I look forward to see more tweaks. Thanks!
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: Kobayashi on March 23, 2019, 02:06:43 PM
I like.

Now people can finally download common sense. Thank you
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: Fafn1r on March 23, 2019, 03:27:44 PM
Quote from: Canute on March 20, 2019, 12:53:29 PM
Did you check the compatiblity with other inventory mods like PickUp&Haul and Combat Extended ?
Quote from: avilmask on March 20, 2019, 02:36:48 PM
Didn't play combat extended, and I had no reports about issues with it.

No issues with CE. Not tested with both CE and PickUp&Haul, but they are still incompatibile for 1.0 anyway.
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: avilmask on March 24, 2019, 09:17:46 AM
Updated to 1.1.3:
- fixed a problem, when material of an item could change with "all components hauled together" on, because order of picking up could change due to path optimization (basically, whatever was closer to the pawn, it automatically become a main ingredient);
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: sidfu on March 25, 2019, 08:21:14 AM
for specfic mods u have it enact changes if it finds the mod enabled. for example dubs u would have if the mod enabled they would use the time in morning to shower/bathroom if they wake early.

wouldnt be much differnt than what u doing for joy but just the extra code to see if the mod is enabled
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: avilmask on March 25, 2019, 09:33:13 AM
Quote from: sidfu on March 25, 2019, 08:21:14 AM
for specfic mods u have it enact changes if it finds the mod enabled. for example dubs u would have if the mod enabled they would use the time in morning to shower/bathroom if they wake early.

wouldnt be much differnt than what u doing for joy but just the extra code to see if the mod is enabled
I didn't mean "how to do that", I meant "with my mod I change what different author intended in their mod". It becomes a QoL change "for a mod" that way. Usually things like that asked from a person that made it in the first place, not from a guy, who shuffles vanilla numbers. That's why it felt off to me.
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: avilmask on March 26, 2019, 05:38:57 PM
1.1.4
- when recreating, colonists will prefer taking spare meals if they don't have one;
- fixed a problem, due to which colonists would prefer herbal medicine over any other when doing surgery;
- added a special patch for "dubs bad hygiene" that tweaks assignment priorities (in a way, how joy need works now);
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: Tenshi~Akari on March 28, 2019, 09:56:49 AM
Hi, thanks for these tweaks! Unfortunately, I'm coming across this situation with this mod & Dub's Bad Hygiene at the moment...


AG started 10 jobs in 10 ticks. List: (Wait_MaintainPosture (Job_1371662)) , (washAtCell (Job_1371664) A=(85, 0, 118)) , (Wait_MaintainPosture (Job_1371665)) , (washAtCell (Job_1371667) A=(85, 0, 118)) (Wait_MaintainPosture (Job_1371668)) , (washAtCell (Job_1371670) A=(85, 0, 118)) (Wait_MaintainPosture (Job_1371671)) , (washAtCell (Job_1371673) A=(85, 0, 118)) (Wait_MaintainPosture (Job_1371674)) , (washAtCell (Job_1371676) A=(85, 0, 118)) (Wait_MaintainPosture (Job_1371677))  curDriver=JobDriver_WaitMaintainPosture (toilIndex=0) curJob=(Wait_MaintainPosture (Job_1371677)) lastJobGiver=null
Verse.Log:Error(String, Boolean)
Verse.AI.JobUtility:TryStartErrorRecoverJob(Pawn, String, Exception, JobDriver)
Verse.AI.Pawn_JobTracker:FinalizeTick()
Verse.AI.Pawn_JobTracker:JobTrackerTick()
Verse.Pawn:Tick_Patch2(Object)
Verse.TickList:Tick_Patch2(Object)
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:UpdatePlay()
Verse.Root_Play:Update()


This 10-tick bug happens when pawns are on the generated caravan event maps & attempting to bathe in any form, whether it be from any on-map water, wash tubs, etc.

It doesn't happen on any of my main colony maps, and before I added this mod, it didn't do this on event maps either. (Confirmed just a few minutes ago by removing the mod from the list, and pawns were back to washing on those maps without red errors.)

Any way you can check in on how the recent tweaks might be affecting this? I would like to keep using this mod for sure, but I know when pawns try to take care of their hygiene need during caravan events, that's going to be a small annoyance with them getting stuck like that until their need is high enough to move on to another task...
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: avilmask on March 29, 2019, 01:08:17 PM
Quote from: Tenshi~Akari on March 28, 2019, 09:56:49 AMI'm coming across this situation with this mod & Dub's Bad Hygiene at the moment...
Try to disable "recreational priorities" (that one, when pawns also change sleeping schedule to recreation if they're not sleeping atm). Report me if it does something (or not) if possible. I'll verify, what's up with that.
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: avilmask on March 29, 2019, 04:24:16 PM
Figured source of the problem, fixed it (1.1.4b).
I had to make a not ideal solution.
Problem is, there is some sources of washing that do not make a pawn completely clean (washing at a well or in open water, it maxes out at 0.69). But priority logic was "hm, I'm on free time and I'm not very clean (below 0.8 ). I should take a bath while I have a free time". Then jobgiver tries to finds something suitable, goes through bathes, then basins, finds nothing (close enough), and tries to find ANYTHING globally, gives a job that maxes out at 0.69. It's done immediately, and pawn comes bake to a priority loop. I could add an additional global scan operation to the ticker... But it's a bad idea for a whole lot of (performance) reasons. So I've just reduced required need level to 0.55 (what's awfully close to original number when sleep need is above 0.95). Not perfect... But better, than nothing, I guess?

Maybe sometime later I'll just add an additional variable to the "Need_Hygiene", that could tell "we should target for a lower number", using which pawn would be able to adjust priority checker after first job.
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: Canute on April 03, 2019, 03:13:14 AM
Someone just mention at another topic
QuoteIs there any chance of Pick Up And Haul being updated to include something that makes people pick up what they harvest?
But i think this is basicly an AI tweak ! :-)
So when Pickup&Haul mod is active, you can patch that the pawn pickup the harvest/choped stuff after a harvest before he looking for the next job.
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: avilmask on April 03, 2019, 09:47:04 AM
Quote from: Canute on April 03, 2019, 03:13:14 AMBut i think this is basicly an AI tweak ! :-)
So when Pickup&Haul mod is active, you can patch that the pawn pickup the harvest/choped stuff after a harvest before he looking for the next job.
Yes, I had that idea popping in my had from time to time. But it's still a separate mod material (it doesn't really fit "basic ai tweak" formula), and I had a lot of things that need to be polished in Common Sense, and still have. I'm on vacation for a month, during which I'll not be able to work on pretty much anything. After returning from vacation, I'm going to do some more polish on Common Sense, and after that I'll start working on new mods (but I think I'll try to realize that idea first).
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: Canute on April 07, 2019, 06:22:39 PM
I notice an odd thing, i didn't encounter before.
Sometimes pawn's sleep on ground even when they are assigned to a bed, no zone restriction, no blocked way to their bed.
When i just draft/undraft them they move to their bed.

I can't verify it so far that this AI tweaks let them do this, i just want made you sensitive for that if someone else got similar expierence.
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: ertzuiop on April 08, 2019, 02:36:02 PM
Quote from: Canute on April 07, 2019, 06:22:39 PM
I notice an odd thing, i didn't encounter before.
Sometimes pawn's sleep on ground even when they are assigned to a bed, no zone restriction, no blocked way to their bed.
When i just draft/undraft them they move to their bed.

I can't verify it so far that this AI tweaks let them do this, i just want made you sensitive for that if someone else got similar expierence.


I can confirm that, but its not this mods doing. That issue existed way before release of common sense.
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: Canute on April 08, 2019, 03:38:40 PM
I didn't encounter that problem before.
But maybe i found the issue, old version von SnapOut, but can't confirm it yet.

Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: LiteEmUp on April 09, 2019, 05:52:57 AM
so since this mod changes alot of ai tendencies, what mods out there will this mod is looking like a better replacement??

also any known incompatibilities so far??
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: avilmask on April 09, 2019, 07:01:25 PM
Quote from: LiteEmUp on April 09, 2019, 05:52:57 AM
so since this mod changes alot of ai tendencies, what mods out there will this mod is looking like a better replacement??

also any known incompatibilities so far??
Updated the top post, added incompatibilities information that I know of ATM.
There is no mods that do the same thing Common Sense does. Or is there? Because I didn't see any.
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: Roolo on April 10, 2019, 07:28:52 AM
First of all, nice mod! Saves a lot of micromanaging.

Quote- there's one problem with GiddyUp mod if cleaning before doing a job is enabled. Have now clue why (yet, I'll be looking into it), but mounted animals don't get released properly and stand around until get a command or something like that;

I'm the author of Giddy-up. Are you sure this is an actual issue, and not just a feature? Right now, when a pawn uses an animal to ride somewhere, and dismounts, the animal waits for a while, to allow the pawn to mount again if it wants to go back at some point. The animal is only "released" after a certain amount of time passes, or when a pawn is outside a certain range of the animal, or starts a job outside a certain range. Mounts can't mind-read if a ride back is needed at some point, so we'll have to do with simple checks like this (which I'll still finetune a bit more in the future).

Note that if the animal would be "released" immediately, this would make mounts feasible for one-way trips only, since animals would go back to their restrictred area immediately after the rider hops off, leaving the poor rider behind.

When the job destination is in a "forbid riding area", the animal won't wait, as these areas are often inside a players base, and in that case a ride back is often not needed. Using these areas is probably smart for things like hospitals and bedrooms, as it also prevents animal filth when pawn don't walk in with their mount. And to be honest, you don't want elephants in your bedroom or hospital.

Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: Chibisuke on April 10, 2019, 11:18:09 PM
Quote from: avilmask on March 29, 2019, 04:24:16 PM
Figured source of the problem, fixed it (1.1.4b).
I had to make a not ideal solution.
Problem is, there is some sources of washing that do not make a pawn completely clean (washing at a well or in open water, it maxes out at 0.69). But priority logic was "hm, I'm on free time and I'm not very clean (below 0.8 ). I should take a bath while I have a free time". Then jobgiver tries to finds something suitable, goes through bathes, then basins, finds nothing (close enough), and tries to find ANYTHING globally, gives a job that maxes out at 0.69. It's done immediately, and pawn comes bake to a priority loop. I could add an additional global scan operation to the ticker... But it's a bad idea for a whole lot of (performance) reasons. So I've just reduced required need level to 0.55 (what's awfully close to original number when sleep need is above 0.95). Not perfect... But better, than nothing, I guess?

Maybe sometime later I'll just add an additional variable to the "Need_Hygiene", that could tell "we should target for a lower number", using which pawn would be able to adjust priority checker after first job.

nice.. i didnt even realise it was because of this mod.. i just had a pawn stand at the basin/well washing up non stop. Basin would run out of water with him one washing session...:D...just 1 thing.. when i unstick the haul to stockpile for job bill..it doesnt seem to save and is back to being ticked when I next reload the game.
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: Canute on April 20, 2019, 03:38:28 AM
I got another idea for an AI tweak.
Some range/zone check for animal handler.
The pawn just wanted to train a hauling animal, the animal is faster then the pawn so the pawn followed the animal to the other side of the map and back.
Since i can't figuring out a good range/zone check that would prevent such a situation.
Why not let the animal pause the current task when the pawn start the movement to the animal. Obedience training ofcouse need to be done first.
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: whyareuhere on April 26, 2019, 02:16:42 PM
Hi, I got an issue with the activation of an AI (listed as a crafting task) where the colonist is supposed to haul the materials to the deactivated AI.

The colonist picks up the materials, but the dev mode cites an issue with the colonist's job driver manager and she ends up hauling the materials to the stockpile. I'll try to recreate it later to give the actual error code.
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: avilmask on April 28, 2019, 11:03:51 AM
I'm back from vocation, so I'll be fixing things soon.

Quote from: whyareuhere on April 26, 2019, 02:16:42 PM
Hi, I got an issue with the activation of an AI (listed as a crafting task) where the colonist is supposed to haul the materials to the deactivated AI.

The colonist picks up the materials, but the dev mode cites an issue with the colonist's job driver manager and she ends up hauling the materials to the stockpile. I'll try to recreate it later to give the actual error code.
It would be cool if you added at least a log message.
I had a report like that there (https://steamcommunity.com/workshop/filedetails/discussion/1561769193/1679190184055264352/), so kinda known issue. But so far all I know is some conflict with another mod I don't know about. At least, I have screenshots of a modlist that was used  :-\
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: avilmask on April 29, 2019, 02:53:03 PM
- fixed a problem with options not saving their enabled/disabled state.

Quote from: Roolo on April 10, 2019, 07:28:52 AM
I'm the author of Giddy-up. Are you sure this is an actual issue, and not just a feature?
It throws errors, and animal doesn't get out from this state without drafting (mind-controling) them. So, yeah.

Quote from: Canute on April 20, 2019, 03:38:28 AM
The pawn just wanted to train a hauling animal, the animal is faster then the pawn so the pawn followed the animal to the other side of the map and back.
Better solution for this is to stop animal and force it to wait instead :)
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: Chibisuke on April 29, 2019, 10:09:07 PM

Quote from: Canute on April 20, 2019, 03:38:28 AM
The pawn just wanted to train a hauling animal, the animal is faster then the pawn so the pawn followed the animal to the other side of the map and back.
Better solution for this is to stop animal and force it to wait instead :)
Please do :D on regular speed animals they normally catch up n have enough time to stop the animal. On some modded animal poor pawn is chasing the animal around the whole map n ignoring all other needs. This also kind of happens with Hospitality, where the pawn tries to interact with visitors who are helping with hauling and they chase the visitors around trying to interact. But it seems the jobgiver task for interacting is slower than the visitor pawn job designation for picking up n hauling, so they run off before the interaction can occur.
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: avilmask on May 13, 2019, 02:23:27 PM
About pawn keeping to pick up items into their inventory endlessly. It seems there was an issue with deep storage + pick up & haul combo, and it affected common sense as a side effect. So, it may be a solution, if you have trouble with it.
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: Sonsalt on July 07, 2019, 04:46:29 PM
Cheers, your mod is amazing, but it appears to have compatibility issues with Hospitality https://steamcommunity.com/sharedfiles/filedetails/?id=753498552&searchtext=Hospitality

Muffin 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_Patch2(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()


This is just one of the issues I noticed. Guests seem to have quite some problems with this mods
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: Canute on July 08, 2019, 03:08:46 AM
Since awhile i allways use common sense at my default modset together with Hospitality.
And never encounter such an error.
Since the error is about relax, do you use mod's that add new (special) recreation stuff ?
Maybe post the link you made with the "Share logs" button, that include the modlist.
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: BladeOfSharpness on July 09, 2019, 08:20:39 AM
Here is a common sense suggestion: don't unload stuff in the reverse order they were picked up, but (not I'm not asking to solve the travelling salesman problem) by dropping to the nearest stockpile stuff.
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: Canute on July 09, 2019, 08:55:52 AM
I think you speak in combination with Pickup&haul so pawn's got alot of stuff at their inventory.
It allready would help, if the stuff at the inventory would stack or be sorted.
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: BladeOfSharpness on July 09, 2019, 11:06:33 AM
Ah yes right, I forget that a few out there are not using this mod. Oh the joy of seeing your pawn moves 150 tiles to grab a smokeleaf joint and then do another trip to pick-up an adjacent meal.
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: Grabarz on July 16, 2019, 07:12:09 PM
Quote from: whyareuhere on April 26, 2019, 02:16:42 PM
Hi, I got an issue with the activation of an AI (listed as a crafting task) where the colonist is supposed to haul the materials to the deactivated AI.

The colonist picks up the materials, but the dev mode cites an issue with the colonist's job driver manager and she ends up hauling the materials to the stockpile. I'll try to recreate it later to give the actual error code.
[/b]

It would be cool if you added at least a log message.
I had a report like that there (https://steamcommunity.com/workshop/filedetails/discussion/1561769193/1679190184055264352/), so kinda known issue. But so far all I know is some conflict with another mod I don't know about. At least, I have screenshots of a modlist that was used  :-\


I got similar problem with Infinite Storage mod - colonist is taking resource and it should be delivered to workbench instead however colonist is moving back and forward near storage picking and dropping same resource forever in endless loop

Exception ticking Redhead (at (117, 0, 65)): System.NullReferenceException: Object reference not set to an instance of an object
at (wrapper dynamic-method) Verse.AI.Pawn_JobTracker.StartJob_Patch1 (object,Verse.AI.Job,Verse.AI.JobCondition,Verse.AI.ThinkNode,bool,bool,Verse.ThinkTreeDef,System.Nullable`1<Verse.AI.JobTag>,bool) <0x00d03>
at Verse.AI.Pawn_JobTracker.TryFindAndStartJob () <0x00245>
at (wrapper dynamic-method) Verse.AI.Pawn_JobTracker.EndCurrentJob_Patch2 (object,Verse.AI.JobCondition,bool) <0x004e5>
at (wrapper dynamic-method) Verse.AI.Pawn_JobTracker.StartJob_Patch1 (object,Verse.AI.Job,Verse.AI.JobCondition,Verse.AI.ThinkNode,bool,bool,Verse.ThinkTreeDef,System.Nullable`1<Verse.AI.JobTag>,bool) <0x00db3>
at Verse.AI.Pawn_JobTracker.TryFindAndStartJob () <0x00245>
at Verse.AI.Pawn_JobTracker.JobTrackerTick () <0x00406>
at (wrapper dynamic-method) Verse.Pawn.Tick_Patch1 (object) <0x001f3>
at Verse.TickList.Tick () <0x00487>

Verse.Log:Error(String, Boolean)
Verse.TickList:Tick()
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:UpdatePlay()
Verse.Root_Play:Update()
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: Sonsalt on July 19, 2019, 09:38:01 AM
This mod appears to have compatibility issues with the Hospitality.

It causes guests to just stand around and do nothing.
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: Canute on July 19, 2019, 10:06:14 AM
I don't think so.
I used many times both mod's and never got such a problem. So another mod must interfer too.
Do you have any error's at the logwindow ?
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: Sonsalt on July 19, 2019, 12:15:04 PM
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()
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: code99xx on July 20, 2019, 11:44:43 PM
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?
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: Canute on July 21, 2019, 02:28:29 AM
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.
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: Engreaved on July 24, 2019, 01:17:54 PM
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.
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: avilmask on September 23, 2019, 11:37:05 AM
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).
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: Pangaea on September 24, 2019, 03:13:52 PM
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.
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: avilmask on September 25, 2019, 06:12:17 AM
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.
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: Pangaea on September 26, 2019, 01:45:28 PM
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.
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: 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 (https://github.com/catgirlfighter/RimWorld_CommonSense/blob/master/Source/CommonSense/CommonSense/OpportunisticTasks.cs)

if (Settings.clean_after_tanding && condition == JobCondition.Succeeded && __instance.jobQueue != null &&
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: avilmask on September 27, 2019, 06:19:16 AM
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 (https://github.com/catgirlfighter/RimWorld_CommonSense/blob/master/Source/CommonSense/CommonSense/OpportunisticTasks.cs)

if (Settings.clean_after_tanding && condition == JobCondition.Succeeded && __instance.jobQueue != null &&
It's a misspell :)
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: 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
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: avilmask on September 30, 2019, 07:03:28 AM
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.
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: Canute on January 24, 2020, 04:25:48 AM
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.
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: avilmask on January 24, 2020, 10:44:41 AM
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.
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: Canute on January 24, 2020, 11:12:51 AM
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
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: avilmask on January 24, 2020, 11:18:38 AM
Quote from: Canute on January 24, 2020, 11:12:51 AM
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
https://gist.github.com/d36d4f420d879bd5382aab67a60e1b6f
This warning is normal and quite common. It happens because engine thinks that I USE a method before it's initiated, while I only just adding (injecting) it, not actually using. You can get this warning and with another complicated mods.
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: Canute on January 24, 2020, 11:33:03 AM
I tried it with Dub's mint menu/paint but didn't got any error.

Ok, i wait until the other one cleared up his error mess a bit more.
To use mod's can real be a pain for unexpierenced people, special when the mod list grow up.
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: sumghai on January 29, 2020, 05:52:25 AM
Hi avilmask - just a heads-up that Common Sense is partially-incompatible with my Replimat mod, as Replimat uses Harmony patches to modify the vanilla food utils and jobdrivers in such a way that adds Replimat Terminals as an additional food source for pawns.

If Common Sense placed in the mod order before Replimat, pawns are unable to use the Terminals.

The current workaround (which I have now documented in Replimat's forums thread and Steam Workshop description) is to load CS after Replimat.
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: LWM on January 29, 2020, 09:00:41 AM
@sumghai:

You can also specify when your Harmony patches are applied from your end:  https://github.com/pardeike/Harmony/wiki/Prioritiy-annotations

If you specify ...oh, interesting, I was going to say you could give it Priority.Low, but you could actually explicitly make it applied after CommonSense!
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: sumghai on February 02, 2020, 01:18:37 AM
Quote from: LWM on January 29, 2020, 09:00:41 AM
@sumghai:

You can also specify when your Harmony patches are applied from your end:  https://github.com/pardeike/Harmony/wiki/Prioritiy-annotations

If you specify ...oh, interesting, I was going to say you could give it Priority.Low, but you could actually explicitly make it applied after CommonSense!

I'll look into this when I have time, although I'm not confident whether or not this won't break existing behaviour, given that Dubs wrote a significant part of Replimat's source code.
Title: Re: [1.0] Common Sense - basic AI tweaks
Post by: Resurak on February 29, 2020, 03:17:48 AM
Hi! Will you update the github version to 1.1?