sumghai / Replimat

Distributed food replicator system for RimWorld
Other
11 stars 11 forks source link

Ideoligion food precepts #54

Closed stefment closed 2 years ago

stefment commented 3 years ago

Describe your idea: Some kind of functionality that creates meals that take into account ideoligion precepts. The replimat terminal could perhaps replicate meals with human meat if the colonist getting a meal had an ideolegion with "cannibalism precept"

Why do you think your idea would be a good fit for Replimat?: It seems like for now in order to satisfy food related ideoligion precepts i must still cook meals manually What alternatives/workarounds have you tried? i tried searching for similar ideas but couldnt find any

Declaration

I hereby verify that:

sumghai commented 2 years ago

This is going to be quite a difficult endeavor, as currently all meals produced by Replimats have no ingredients at all. I will also need to account for many different meals, recipes and edge cases from third-party mods.

I'll see what I can do.

stefment commented 2 years ago

I really should do a test but it seemed that the rimworld devs inadvertantly fixed this since because colonists no longer get a debuff from their ideologion if they eat a meal with no specified ingredients. If that is the case then that is a big improvement in itself

sumghai commented 2 years ago

Even if pawns are no longer bothered by meals lacking ideologion-prescribed ingredients, I still think it makes sense to cater for them, as Replimat Terminals are (in-universe) meant to allow users to tailor their meals to their exact specifications by voice command.

As per these last three commits, I've set up a basic system of generating a meal's ingredients according to their regular workbench recipes. Paradoxically, I'm initially disabling generation of humanlike and insect meat in 470e135, but this caters for the default non-ideo use case.

I've also had to handle condiments from VCE, since they are a special type of ingredient with no inherent nutrition, and would otherwise get ignored completely.

Tomorrow night I'll look into adding custom logic to cater for various food-related precepts by selectively replacing ingredients. For example, cannibals will get human meat in their meals, but only if the original recipe allowed meat in the first place (vegetarian fine and lavish meals won't retroactively get human meat added to them).

sumghai commented 2 years ago

Got a prototype of the ideologion-specific meal ingredient system implemented.

Human meat cannibalism works, as does the insect meat loved precept. Pawns with the meat-eating rancher precept will need to have their meal policy set to carnivorous meals only, because as previously mentioned, adding meat to vegetarian dishes is just silly.

Fungus precepts aren't quite working yet; sure, the Replimat does add fungus to meals when requested, but it's not reliably removing non-fungus plants. I'll need a bit more time to investigate why this is happening.

sumghai commented 2 years ago

Silly me, I should've used separate if statements for each precept rather than an if-else block.

In any case, this should be good to go for the next update now.