[Mod Request] Remove Lunchbox Meal Behavior (A.K.A. EAT AT THE FUCKING TABLE)

Started by MLG Samuelle, March 09, 2017, 05:27:20 PM

Previous topic - Next topic

MLG Samuelle

So, I have this Extremely Impressive main room, with a table and chairs and everything so pawns can eat there, and I have my freezer entrance right next to the dining area. I even have a separate stockpile in the freezer next to the door for food, and the dormitories are all close by. Unfortunately, this matters less than half the time, because right after my pawns eat their first meal of the day (if they decide to have breakfast, instead of skipping to step 2) they grab a meal from the freezer, go do something for 12 hours, eat their food right off the ground like a goddamm muffalo, and then go back into the main room for some chess. What I am asking is: could somebody please remove this feature before I rip my dick off out of frustration and throw it into orbit?

Apfelkuchenbemme

Before you do something to your main reproductive organ that you're (probably) going to regret, open the "Items_Food.xml" found under "\Steam\steamapps\common\RimWorld\Mods\Core\Defs\ThingDefs_Items".

Now go to the <ThingDef Name="MealBase" Abstract="True"> and add the line "<chairSearchRadius>999</chairSearchRadius>" under <ingestible>.

I can't find the "OrganicProductBase" for the life of me, so if you want this to work for raw animal products like milk and insect jelly, you'll have to add that line under <ingestible> for every animal product in the "Items_Resource_AnimalProduct.xml" (unless you'd find the "OrganicProductBase", of course).

BlueWinds

Quote from: Apfelkuchenbemme on March 10, 2017, 11:42:57 AM
I can't find the "OrganicProductBase" for the life of me, so if you want this to work for raw animal products like milk and insect jelly, you'll have to add that line under <ingestible> for every animal product in the "Items_Resource_AnimalProduct.xml" (unless you'd find the "OrganicProductBase", of course).

OrganicProductBase is right at the top of Mods/Core/Defs/ThingDefs_Items/Items_Resource_RawPlant.xml.

MLG Samuelle

Quote from: Apfelkuchenbemme on March 10, 2017, 11:42:57 AM
Before you do something to your main reproductive organ that you're (probably) going to regret, open the "Items_Food.xml" found under "\Steam\steamapps\common\RimWorld\Mods\Core\Defs\ThingDefs_Items".

Now go to the <ThingDef Name="MealBase" Abstract="True"> and add the line "<chairSearchRadius>999</chairSearchRadius>" under <ingestible>.
You are a god
I can't find the "OrganicProductBase" for the life of me, so if you want this to work for raw animal products like milk and insect jelly, you'll have to add that line under <ingestible> for every animal product in the "Items_Resource_AnimalProduct.xml" (unless you'd find the "OrganicProductBase", of course).

You are a god

Apfelkuchenbemme

Quote from: BlueWinds on March 10, 2017, 04:38:26 PM
OrganicProductBase is right at the top of Mods/Core/Defs/ThingDefs_Items/Items_Resource_RawPlant.xml.

Thanks! I had misread "Name" as "ParentName" ...

Anyways, if you want this to work for raw food such as milk and vegetables, too and you're too lazy to add the <chairSearchRadius> for every raw plant - and animal foodstuff, you'll have to add the following lines to the "OrganicProductBase" found under the path that BlueWinds has posted above:

    <ingestible>
    <chairSearchRadius>999</chairSearchRadius>
    </ingestible>

faltonico

Does it means that with <chairSearchRadius>999</chairSearchRadius> each pawn will look for a table/chair in that huge radius? I don't know if that's going to have a negative impact on performance, the more pawns you have.
Why not to assign a table for your pawns to go to, before they start looking for any food? In that case you just have to make sure your stockpile is next to said table. They will have to ignore the one they are carrying for it to work.
It would have to change vanilla behavior => when hungry do not look for food, go to your table (or just go to the kitchen, i think it might be easier); when there, look for food; when you get the food then look for a table; if you have food problems and the pawn gets to the designated table (or the kitchen) and you have no food it will go find food wherever it is, and then eat it on the floor if it was too far from a table. If there is no designated table (or kitchen) it will look for food wherever he is at the moment.

Apfelkuchenbemme

Quote from: faltonico on March 14, 2017, 02:23:08 AM
Does it means that with <chairSearchRadius>999</chairSearchRadius> each pawn will look for a table/chair in that huge radius? I don't know if that's going to have a negative impact on performance, the more pawns you have.
Why not to assign a table for your pawns to go to, before they start looking for any food? In that case you just have to make sure your stockpile is next to said table. They will have to ignore the one they are carrying for it to work.
It would have to change vanilla behavior => when hungry do not look for food, go to your table (or just go to the kitchen, i think it might be easier); when there, look for food; when you get the food then look for a table; if you have food problems and the pawn gets to the designated table (or the kitchen) and you have no food it will go find food wherever it is, and then eat it on the floor if it was too far from a table. If there is no designated table (or kitchen) it will look for food wherever he is at the moment.

Well, it isn't exactly a "delicate" solution, but yes it forces your pawn to simply look for a chair within a radius of 999 tiles. Considering that the max size for a map is 400x400, this search radius will cover the entire map.

I don't think this would cause performance issues in terms of how well your game runs since every crafting station has a default search radius for materials of 999. However, if your designated eating room only contains like eight chairs but you have 20 pawns and all of them get hungry at the same time, they are going to look for other chairs all over the map, since you can't forbid chairs in the vanilla game. But chairs aren't really a problem in my colonies because every room gets outfitted with a short table and a chair when I get around to it, so they don't have to walk far.

I have just destroyed all chairs in my newest colony except for the seven at the dining table and when I told all of my 13 colonists to eat, the first seven ate sitting on a chair while the others just ate standing a few tiles from where they picked up their food. Since this behaviour wouldn't be any different if you assinged a "proper dining table" to your colonists and more people want to eat at once than there is room at the table, I'd say that the <chairSearchRadius> is by far the most simple solution for this problem.

faltonico

@Apfelkuchenbemme
To be fair, if they all start searching at the same time, pawns will eat without a table when they don't have enough chairs, even with the increased 999 radius. And the real deal is not so much the negligible -3 debuff (not so much for fucked up pawns though), but the fact that they don't get the buff for eating in a impressive dining room if they eat anywhere else than your lovely dining room. i do too place tables at their workplaces because i can't prevent them from doing that.

But anyway, i can barely play because of performance issues (i just created a new colony waiting for Rimushima), if you can guarantee that it would not hurt performance I'll gladly start cranking up that radius for the moment.

Apfelkuchenbemme

As for the impact on performance with the <chairSearchRadius>, think about it this way:

As far as I've understood the code so far, your pawn's hunger-meter gets to a certain threshold so your pawn gets the job "JobGiver_GetFood". Your pawn then looks for the "most preferable" food, so he would of course love lavish meals the most while some meals only get touched when your pawn is so malnourished that he looks for "desperate_only"-level of food. Once the pawn has gotten his hands on the most preferable food available, he looks for a chair - by default in a radius of 25 tiles - and then walks over there to eat; the chair is reserved by your pawn for this time.

With a <chairSearchRadius> of 999, literally everything in this behaviour except for the <chairSearchRadius> is the same as it would be with the vanilla <chairSearchRadius>.

I don't see how this would have any effect on performance at all.