RimWorld

RimWorld

39 ratings
Photosynthesis Gene
   
Award
Favorite
Favorited
Unfavorite
Mod, 1.4
File Size
Posted
Updated
190.227 KB
6 Dec, 2022 @ 10:06am
11 Feb, 2023 @ 9:56am
4 Change Notes ( view )
You need DLC to use this item.

Subscribe to download
Photosynthesis Gene

Description
This is a mod that adds 3 variants of a photosynthesis gene.
They will help pawns survive with less food.
They will still have to eat, just less and will face restrictions if they haven't seen the sun in a while.

Why
This was mainly made for role-play reasons for my ent-colony and as an exercise.

How this works
Your pawn is given an additional need (for sunlight) and a permanent hediff (for chlorophyll).
The sunlight need will raise whenever on a tile that is at least 51% lit (so sunlamps work).

If the need is above 50%, the chlorophyll will start growing, if not it will shrink.
At its earliest stages, the chlorophyll will harm the user (increasing food consumption rate, reducing consciousness and move speed as well as causing pain).
Later on the negative effects will subside and only a hunger rate multiplier will stay (currently up to 70%/50%/0% with the weak/medium/extreme variant).

This does not currently influence pawn behavior (e.g. they don't seek out brightly lit spaces when the sunlight need is low).

If you have any ideas about how to balance this, please let me know!
Most of what the chlorophyll is doing can be changed in the XML, so feel free to modify.

Yes, the extreme variant lets you achieve a 0% hunger rate. Yes that is as broken as it sounds, so use with caution.
I've added the extreme one, as people asked for it and who am I to judge?

Overview
Impact of the Chlorophyll at various stages,
always "hunger rate offset"/"pain"/"consciousness"/"movement":

variant\stage
withered
waning (at 0.1)
patchy (at 0.3)
chipped (at 0.5)
healthy (at 0.7)
weak
1.5/.2/.9/.8
1.25/.1/.9/.8
1/0/.9/.8
.8/0/1/1
.7/0/1/1
medium
2/.3/.7/.4
1.5/.2/.8/.6
1/.1/.9/.8
.7/0/1/1
.5/0/1/1
extreme
(probably very broken)
5/.5/.5/.2
2/.3/.7/.5
1/.2/.9/.7
.5/.1/1/.9
0/0/1/1

E.g. medium chlorophyll that is currently in the waning stage (between 0.1 and 0.3 severity) is applying a hunger rate factor of 150%, 20% pain, 80% consciousness and 60% movement.
Better put your plants in the sun!
38 Comments
maknahr  [author] 24 Oct, 2023 @ 12:59am 
Thank you for your input! Please feel free to edit the related XML files to modify the metabolism costs on your end.

I found them all very powerful especially when food is scarce e.g. when playing in a desert or on ice sheets. The underlying issue is that this gene mainly modifies the hunger rate, while genes are mainly balanced around just that, so in my opinion this will always be unbalanced and very situational.
hottt3 23 Oct, 2023 @ 9:01am 
I see. Now I get it. In all honesty, I still think that these genes are not balanced in terms of their cost. Taking into consideration their downsides - like "reducing consciousness and move speed as well as causing pain", the necessity of being under the sun, and the only upside is being less food consumption, these genes should cost at least 0 metabolism, if not positive. Especially if you start the game as a neolithic tribe, with zero tech no lamps no bionics no painkillers etc. (Like I did).
This is my opinion of course. Thanks again for your work!
maknahr  [author] 23 Oct, 2023 @ 8:05am 
Thank you for clarifying. As you noticed the trait "Wimp" (caused by the "Extra pain" gene) is decreasing the pain shock threshold from usually 80% by 50% down to 30%, which incidentally is exactly the amount of pain the medium gene causes when in the withered state.

I am not going to change this in the mod itself as I personally think that that's just funny and a good story.

However, I can recommend three things to resolve this on your end if you ever encounter this again:
1. Put the medical beds in a space with daylight, either by placing them outside, below holes in the ceiling or by placing down a sunlamp next to them.
2. Get this pawn a "Painstopper" implant. That is a good idea regardless of my gene with this kind of pawn.
3. Changing the amount of pain the medium Gene causes down to at least 29% by editing the related XML in your modfolder. (I am not going to explain where this can be found or how exactly to do that, please search for it by yourself.)
hottt3 21 Oct, 2023 @ 2:43pm 
Now it occurred to me, what if he fell down because he also had the "Extra pain" gene and the Wimp trait? Such pawns are more susceptible to pain?
hottt3 21 Oct, 2023 @ 1:58pm 
He just fell on the ground, "downed". I had to rescue him, and then he was lying on the medical bed, didn't get up, other pawns had to feed him.
maknahr  [author] 21 Oct, 2023 @ 1:09pm 
Thank you for the feedback!

Can you clarify how he went unconscious? The medium variant reduces consciousness at most by 30%, so this can never bring down a pawn on its own. Any unmodified pawn needs to fall below 30% consciousness in total to become unconscious.
hottt3 18 Oct, 2023 @ 10:34am 
Thanks for the mod. Yet I must say that it is not balanced (IMHO). My pawn, who had the gene "never sleeps", and who was most of the time (at least half of the time) working outside, went unconscious, and I didn't even know how to bring him back to life. He had the medium variant.
I had to remove this gene with editor. (Now I'm happy.)
maknahr  [author] 1 Sep, 2023 @ 8:05am 
No problem!

The assemblies are needed (or were generated) because this mod does things at runtime (like setting the correct HeDiff for each Gene or handling the sunlight need as that is depending on the tile the pawn stands on every X ticks).
This goes beyond what is possible with simply adding or editing XMLs.
Additionally, DLLs as "construct" are needed because this game runs in C# which needs to get its source code compiled to do anything (meaning you can throw out the source directory, because it's just decor, I opted to include it, because I was to lazy to upload this project properly to git and I wanted the source code to be freely available).

If you are on Windows, check out the Rimworld Wiki for modding tutorials. Some of it is dangerously outdated, but this should be enough to get you going.
If you are on Linux like me, you can take a look at the following tutorial to get started:
https://www.arp242.net/rimworld-mod-linux.html
Nefilol Seflll 31 Aug, 2023 @ 12:31pm 
This is kind of stupid to be bugging you about but, it's on my mind so figured to ask.


I redownloaded this after having wiped my mods to check in its folders to see the size of its custom textures because i'm making my own genes and needed to know the size that the gene icons typically are.

While doing so, i saw extra folders i didn't expect, namely that you use some sort of program for something?
And an assemblies.dll?

I'm curious about what these do and what the program was used for, because as a new modder, it might be important later on.
maknahr  [author] 14 Aug, 2023 @ 11:32pm 
Sorry, no update as of yet.