How Hard Would It Be to Add Food Preferences? - Waffle Explains It All (Patreon)
Content
It would actually be a pretty huge undertaking. Saying "All the programming would have to be is buffs based on what your sims eat and what they'll choose to make autonomously" is...like saying making beef wellington is just cooking beef in the oven.
Let's look at how preferences already work. We'll use Gardening as an example.
There are at minimum 23 tuning files specifically related to liking gardening, and another 12 for gardening decor. We'll ignore those.
On the most BASIC level, a preference is one of THREE traits. Likes, Dislikes, and No Opinion. So you need one of those for every single food item in the game.
There are 2,186 different files for specific food recipes. That includes versions that come from the Cafeteria, cupcake machine, ice creams, etc. Let's narrow it down JUST to basic cooking skill food. Not even including gourmet cooking.
That's still 835 files. But you do have to account for all 2,186 files if you want food preferences to work right, even if "ice cream" covers all ice cream and "cupcakes" covers all cupcakes.
Every single one of those files needs to be accounted for not just in the preference tuning, but also the preference tuning needs to be accounted for in the food itself.
Going back to gardening preference as an example, hundreds of files account for having that preference.
Every one of these interactions- and the hundreds above and below those pictured- accounts for the preference. When your Sim gets the buff for liking gardening while they do it, this is how it's handled- every single interaction checks for your preference and decides what to do.
On a basic level, you need a buff for liking, and a buff for disliking, the activity. You could get away with a generic "I don't like this food!" and "I like this food!" buff for the food preferences, so that's not so bad, but the food does have to account for and provide those buffs.
But because a food preference depends on the specific food, that means you need those traits I mentioned before- like/dislike/no opinion- for every single one.
For those 835 homestyle cooking recipes, that becomes 2,505 tuning files. For the 2,186 total food files, that's 6,558 traits. Of course, some of those are "duplicates". A lot of them, there aren't 835 foods in the game. I hope. But they do all need accounting for.
Again, if you made all ice cream fall under one preference, that knocks it down a peg. If you make the at home, cafeteria, bar, etc versions of one single type of food all count as "that one food", that also knocks it down a peg. But it's still a LOT.
How about Autonomy?
Back to gardening, all those gardening interactions, if enabled for autonomous, will test their autonomy. They test for gardening skill being at a certain level already. I'm not actually sure if anything else blocks autonomy for gardening, I can't find anything. In this case preferences don't worry about it, I guess?
But for food you have to account for it- why would your sim purposely make grilled cheese if they don't like it?
Let's look at how Lactose Intolerance works. There's a Fridge Cook Autonomously interaction. This is what Sims do when they choose to cook. It doesn't REALLY care what they cook- they pick at random from available food...unless they are Lactose Intolerant or Vegetarian. These have their own separate autonomous cooking interactions. When a Lactose Intolerant Sim goes to cook, they ping the fridge, and the fridge says "Hey, you're not allowed to use the normal autonomous cook interaction!" and instead they see that they can use the Lactose Intolerant one. Inside that interaction is a specific list of which foods they can pick from- the lactose-free ones. Easy enough, right?
Ok, now make a SEPARATE autonomous cooking interaction...for EVERY SINGLE FOOD PREFERENCE.
When your Sim goes to cook autonomously they'd need to follow this same format: Only interactions that contain foods they like or have no opinion on are available, and others are blocked. because of how cooking works, you'd need to have a separate possible interaction they could choose for every single food. The Lactose interaction has a list of all lactose-free foods, but if your sim likes grilled cheese, hamburgers, and dislikes everything else, the game won't have a separate tuning for the "likes grilled cheese and hamburgers" autonomous cooking, right? It'll have to make two separate "cook autonomous grilled cheese" and "cook autonomous hamburgers" interactions. When your Sim is hungry htey'd ping the fridge and it'd have to instantly sort through their preferences, to provide them HUNDREDS of possible interactions, to decide what they make.
Now, it's possible a new tuning type could make this simpler. It'd check the food preferences and only allow matching foods to work. But the current systems don't work that way.
That's also JUST for cooking...you need this system for grabbing leftovers, for getting food from a vendor, for ordering at a restaurant, for getting food from a cafeteria.
So we're up to:
-3 traits for every single food
-A new interaction for every single food on the fridge, OR an entirely new way for the game to determine which foods are valid for autonomous cooking, something that currently does not actually exist
-At least 2 new buffs for liking/disliking any given food, but a lot more if you want it to be more bespoke for each food
-Every single food item being updated to account for the above
But wait, there's more!
When you do a gardening activity and are happy, you might get a popup asking if your sim likes gardening. When you do this and are upset, you might get one asking if they don't.
Yep, you need that for every single food, too. "Wow, your sim is having a great time and eating [food they have no opinion on]! Do they really like this food?"
That, too, is handled in every single tuning for every single food. Again, you could simplify this down to be vague and say "This food" in the notification, but the game does have to specify which food it is when you choose if you do or don't actually like it, so that means a unique "Add this preference to this sim" tuning has to be made...for liking and disliking...for every. Single. Food.
And that's not getting into making new Wants for each type of food- if a sim likes it, they should want to eat it sometimes, yeah? That's a new Want for every single food that has to be accounted for. And the way Wants work is a set of them called a "Whimset". You dont just make the want- you make the "container" for it. That's another two tunings minimum for every food.
What about food lying around already? Food someone else made? Does the game know how to check for if the Sim would pick it up and eat it? Outside of lactose intolerance and vegetarianism...it does not. So you have to account for that, too!
There are ways they'd automate development of all these things, sure. But it's still a lot to account for.
Ultimately nothing is impossible, but it's important not to understate how complicated any given idea actually is- simply having the idea isn't the hard part, making it work is. There's a reason there are no food preference mods that cover every individual food.
"But Waffle! Modders have done it!"
Yes, they have! It's not impossible, just tedious. Helaene has a mod that adds food preferences. But they cover more broad categories- like regions (italian, chinese, etc). But guess what? If you pop that mod open you'll find the stuff I desribed above: Separate autonomy interactions for cooking. 3 separate traits for each preference. Buffs for each preference. New ways of handling cooking autonomy. New whims for food desires. New ways for the game to understand which foods count as "Italian" or "chinese". It's all in there- and I'm sure it was all very, very tedious to make.
Preferences are crazy complicated stuff! I thought it'd be fun to explain it, and it was!
You can see other entries in my Waffle Explains It All series here!
Files
Previews only