Food related needs and traits

Started by jupiterLILY, August 18, 2019, 01:34:41 PM

Previous topic - Next topic

jupiterLILY

Hi Guys,

I'm taking my first proper stab at modding and I'm wondering how I'd go about creating a protein need and a need for vitamins/vegetables.

The idea is that this mod would complement/enhance mods like RimCuisine and VGP and work with the crops etc added.

I'm also interested in adding some traits like vegetarian, vegan, coeliac, meat lover and I'd love some advice on how I'd go about doing that.

My experience is limited to some super basic unity scripting and making small changes to existing mods.

There's a chance this project is entirely too ambitious for me at the moment but either way it's something I'd like to work towards and I'd love to be pointed in the right direction for resources/help.

;D

K

Adding new needs is a little bit painful, but possible. There's plenty of examples on GitHub of people adding needs to draw from. You'd also have to add new AI behavior for pawns to seek out meals that satisfy their needs as well.

As for adding dietary traits, I think you're getting ahead of yourself a little bit because that would likely depend on how you implement dietary needs. It's probably something best considered once you've got the framework in place.

The primary problem I see is actually assigning nutritional value to various foods. It's infeasible to do it by hand, since you want to support foods added by mods. This means that your mod will have to be able to independently judge the nutritional value of various mod-added foods automatically, which is going to be complicated, particularly if you want differentiated behavior between different foods. Is thrumbo meat just as nutritious as muffalo meat, for example. Judging the nutritional value of modded plants will likely be difficult as well.

If you can figure out how to do that then the rest is definitely possible, though time consuming.

jupiterLILY

Thanks so much, that's really helpful.

What about if the traits were independant/a separate mod?

I know that certain alien races have dietary restrictions, and animals can be carnivorous/herbivorous.

I thought it'd be more along the lines of if a pawn eats food from a certain category then they get the food poisioning hediff and a negative thought.

If you don't mind, could you please explain to me why I would need to assign a nutritional value to the foods? Is it so that I could have raw meat have more protein than things like mushrooms, lentils and dairy products? RimCuisne and VGP add about 30 crops each so I wouldn't mind individually assigning values for those and then having a blanket rule for everything else.