Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seasonal Mutation EOCs #69591

Merged
merged 135 commits into from
Dec 16, 2023
Merged

Conversation

fairyarmadillo
Copy link
Contributor

@fairyarmadillo fairyarmadillo commented Nov 20, 2023

Summary

Features "Add several seasonal traits and EOCs and restore mutation photosynthesis"

Purpose of change

I wanted to add some new interesting mutant life simulation features, similar to the molting added in #65459

Describe the solution

  • Adds Seasonal Allergies, a trait that sometimes gives you hay fever. It applies it more frequently in the summertime and not at all in winter, in accordance with the common ragweed schedule. Antihistamines (currently present in cough syrup, also coming in tablet form in Better Boomer Barf #69555 ) prevent the effects. Seasonal Allergies is a human trait but it also gets the chimera and beast categories, to represent their mixed-up anatomies not really working perfectly together.
  • Adds Hay Fever, an effect that mildly reduces int and per, applies a stamina penalty, and makes you sneeze. Sneezing makes a small amount of noise, but doesn't wake you up like coughing. Sneezing also imposes a one-second effect that further penalizes dex and per and slows you down for just that one second.
  • Adds Seasonal Affective Disorder, a possible starting trait. Also gave it to Plant, Medical, and Elf. Troglobites lose this mutation because why would they be sad about the lack of sun?
  • Adds SAD and seasonal allergies to the general pool of random NPC traits, at 5 and 8 percent chance respectively. This reflects what google says about their prevalence in the general population. Also gave Reena Sandhu allergies because she seems meant to be loaded down with a bunch of minor issues like that.
  • Re-adds calorie gain from photosynthesis. Prior PRs underestimated the amount of energy a human-sized tree could produce by failing to account for the Leaf Area Index (see additional context section). A human/plant hybrid can't live off photosynthesis alone, but it helps enough that we ought to model it, and it will be important in the future when plant mutants can hibernate and just literally be a tree for a while.
  • Updates some very old code related to photosynthesis so that it now properly respects coverage and missing limbs. Trees generally want to be as naked as possible unless they have enough rotten meat to munch on.
  • Also applies some of this to sunburn, providing some mild relief for albinos and troglobites.
  • Removes chloromorphosis's OP calorie production and removes dead code related to its nonexistent activated ability. Also updates its description to make its function clearer and not an outright lie. Now it simply boosts phelloderm and roots while you're sleeping. In the spirit of its old description, it still helps you get sleepy if you're trying to sleep in soil.
  • Adds seasonal leaf color changes and die-off for Elf-A and Plant. Spring and summer leaves get the most nutrients, autumn leaves are the prettiest. In the winter, LEAVES goes dormant (like dead grass) while LEAVES2 and LEAVES3 fall off, leaving piles of leaves on the ground.
  • Plant mostly doesn't care about temperature, but the winter leaves mutations all keep you slightly warmer by reducing heat loss. This is mostly helpful to Elf, but it's a pretty small buff for them.
  • Photosynthesis scales with character size according to the proportional change in area.
  • Adds seasonal flowering for Elf-A and Plant. FLOWERS die off in winter and regrow in Spring, while ROSEBUDS are a bit more complicated. ROSEBUDS has been slightly debuffed and ROSEBUDS_SUMMER slightly buffed.
  • Adds fruiting for Plant. In the fall, ROSEBUDS_FALL produces a few fruits which can be harvested once by activating the mutation. Mutant Fruit is really gross, it's basically a teratoma, but it has a use besides grossing out the guys at the refugee center.
  • Add mutant seeds. You can get one of these a year (spells can't do variable results afaik) when you harvest your ROSEBUDS_FALL and deconstruct the resulting fruit. A mutant seed can be planted and after some time will grow a weird little tree.
  • Allows characters with Mycorrhizal Communion to "talk" to the weird little tree for a substantial morale buff.
  • Makes rain ponchos transparent. They do come in solid, but the cheap foldup kind I see IRL are most often clear. Now you can wear these and photosynthesize to your heart's content.
  • Makes plastic face shields and non-shaded eyeglasses transparent.
  • Makes all appropriate Magiclysm, AFS, and XEDRA Evolved, and MoM auras transparent.
  • seed_data in seed jsons can now optionally designate specific furniture for seeds to grow into. If left blank, seeds default to growing as they've always done. This is only used for the mutant seed for now, will be useful for future farming expansion (growing perennials, etc) as well as un-hardcoding Mycus at a later date.
  • Fixes some existing bugs that were preventing Elf-A from acquiring mutations within its category.
  • Fixes some existing bugs that were causing cyclical lupine mutation behavior, specifically with their ears and fur.
  • Adds summer and winter coats for lupine and ursine mutants. These have less protection but bring warmth down to just inside bear-able parameters for ursine.
  • Adds a small amount warmth for bark. Bark is how trees keep warm IRL and plant mutants aren't very good at wearing clothing.
  • Adds a json field, prevented_by, to mutations. This allows specific mutations to block others from happening, which is very useful for EOCs.

Describe alternatives you've considered

Out of scope for now, but planned:

  • Hibernation for frog, bear, plant, insect, gastropod
  • Two new flags, HALF_SWEAT and NO_SWEAT, for mutations. These flags will half or negate sweating. If the player has both, NO_SWEAT will win. Nearly all mammals sweat, with the notable exception of pigs, cetaceans, rhinos, and hippos, and some (mostly primates and horses) sweat as much as humans, so for now, HALF_SWEAT goes to SHAGGY_FUR, PHELLODERM, GRAY_FUR, SCALES, EPICUTICLE, PATCHWORK_SKIN, FEATHERS, COLORFUL/CAMOUFLAGE_SKIN, SLIMY, and LYNX_FUR. NO_SWEAT goes to THICK_SCALES, SLEEK_SCALES, CHITIN3, CHITIN_CARAPACE, and DOWN.
  • To go with the above, a panting mutation for bird, lizard, bear, wolf, cat, that adds some heat relief if the mouth is uncovered, for a slight increase in thirst.
  • Slimy can do similar with exposed skin.
  • Rework plants so that every planter type is a single piece of furniture that just gets data from the seed inside of it, which changes as it grows.

Testing

  • Mutated an ursine and lupine coat. Saw that they behaved as before outside of summer.
  • Experienced shedding as booth ursine and lupine in the summer.
  • Saw that the summer coats behave as expected, e.g. they take some of the burden off the mutant but also reduce protection, and that summer is still fairly difficult for these animals.
  • Attempted purification and mutating to some other skin type during summer, saw that this worked properly.
  • Mutated FLOWERS, ROSEBUDS, LEAVES, LEAVES2, and LEAVES3. Saw that they behaved as before in springtime.
  • Ran through two years worth of seasonal changes for each mutation to see that nothing gets messed up.
  • Attempted purification for each of the above mutations during each of its seasonal variations.
  • Grew and picked a mutant fruit.
  • Disassembled mutant fruit and checked nutritional values.
  • Checked that normal farming still works as before.
  • Planted a mutant seed, observed that it grew in the expected amount of time. Made sure the resulting tree properly keeps its seed data.
  • Tested each mutation combo to make sure there's no weird photosynthesis behavior
  • Tested wearing clothing over leaves, phelloderm
  • Tested cloudy days to make sure they're cutting production by half.
  • Tested different character sizes to make sure production is appropriately adjusted
  • Tested seasonal affective disorder in all 4 seasons. Make sure prozac works.
  • Tested allergies in all 4 seasons. Make sure benadryl works.
  • Tested albino and photosensitive to make sure they respect the new coverage system.

Additional context

Prior photosynthesis calculations failed to account for leaf area and plant's two extra vine limbs. They also didn't consider the size of the mutant. In general, a fully evolved humanoid plant mutant spending the day outside nude in summer should be getting around 250kcal due to having about 10 square meters of leaf area. This is thanks to effectively having five branches - the head, two arms, and two vine limbs. Vine limbs can be controlled consciously, so we can assume these stretch out to take in sunlight. The precursor mutation, vines, can't be controlled, so we'll assume they just sort of drape and run at half efficiency.

Let's talk photosynthesis.

Under ideal conditions at sea level, sunlight contains about 1 kilowatt, or 860 kcal of energy per square meter per hour. Of course plants don't actually eat sunlight, they convert it to glucose. Per https://en.wikipedia.org/wiki/Photosynthetic_efficiency they do so at <1% efficiency. This can be higher, but we'll assume our mutant hybrid plants aren't particularly great at it. 1% efficiency under ideal conditions would be around 69 kcal/day per square meter of photosynthesizing surface area.

Boston, MA has a average annual solar radiation value of 4.91 kilowatt hours per square meter per day (kWh/m2/day), or about 4224.7 kcal. Solar irradiance in winter can dip down to around 2.8 kwh. In summer it can go as high as 5.5, assuming ATAL values as plant leaves often tilt to face the sun. ( https://www.solarenergylocal.com/states/massachusetts/boston/ ).

With all that math in hand, we can assume that photosynthesis provides about 32 kcal per day (assuming full sunlight in ideal temperatures) per square meter of photosynthesizing surface area. This is higher in many plants, but as mutants are hybrids we'll say they're not the best at it. Phelloderm provides photosynthetic skin, and an adult human has around 2 square meters of surface area to their skin, but people are not optimally shaped for photosynthesizing. Thus we'll say that Phelloderm provides 1 square meter of photosynthesis if you're nude, or 32 kcal.

But trees don't use a single contiguous surface to photosynthesize, like a solar panel. They grow leaves in three dimensions throughout their canopy to vastly improve their surface area. Botanists account for this in broadleaf trees by finding the two-dimensional area of the canopy (pi r squared) and multiplying that by its leaf area index, which gives a rough estimate of what the plant has to work with in terms of photosynthesizing surface area.

Leaves1 grows leaves on the character's head which are described as "grasslike." Bermuda grass has a leaf area index of 3 to 6, generally averaging around 4 during sunnier seasons. (https://www.researchgate.net/figure/Leaf-area-index-of-Tifton-85-bermudagrass-Cynodon-spp-grown-at-Gainesville-FL_fig8_236594511). Assuming the human scalp is roughly one square foot, Leaf Area Index × Ground Area gives us 4 square feet of leaf area, or about 1.2 meters, giving us 38 more kcal - however, this grass is covering a small amount of our phelloderm, so we'll bump it down to 30 kcal. This means that Elf-A maxes out at about 62 kcal in the summertime, about the same as a small apple. That doesn't seem like much, but let's remember that this is a survival game, and at some point food will probably not be as easy to come by as it currently is.

Leaves3 grows leaves which are described as large and verdant on the character's head, arms, and vine limbs if present. A human's armspan is usually about the same as their height, so we'll give our mutant a six foot armspan, and say the vine limbs are about the same length. They're actually longer, as they can be used as long ropes when climbing, but I imagine they're thinner and it all works out to about the same. Our mutant, spreading out their arms and vines in full sun, has a crown area of about 2.54 meters.

Multiply that by the leaf area index of 4 and we get about 10.16 square meters. At 32 kcal per square meter, we can probably safely call that 352 kcal/day in optimal conditions. These leaves provide shade, so we can say that phelloderm runs at half capacity, adding only 16 kcal for a total of 368.

From here we can work backwards to get our values for Leaves2 and for mutants without vine limbs. For Leaves2 we can simply assume a lower leaf area index, say 3, and repeat our above calculation for a leaf area of about 7.62 square meters, or about 244 kcal/day, or 260 with phelloderm.

If the plant has five branches (head, arms, two vines), we can say that vine limbs in the above examples are providing 40% of the leaf area. For vines, we can half that. From there, we can work out how much our plant is eating in optimal conditions no matter what combination of mutations they have.

And so the expected values for a naked mutant in summertime would be:
PHELLODERM = 32 kcal/day
PHELLODERM+LEAVES1 = 62 kcal/day
PHELLODERM+LEAVES2 = 156 kcal/day (60% efficiency)
PHELLODERM+LEAVES2+VINES = 208 kcal/day (80% efficiency)
PELLODERM+LEAVES2+VINE LIMBS = 260 kcal/day
PHELLODERM+LEAVES3 = 221 kcal/day (60% efficiency)
PHELLODERM+LEAVES3+VINES = 295 kcal/day (80% efficiency)
PHELLODERM+LEAVES3+VINE LIMBS = 368 kcal/day

The method that was already in use is somewhat random, so in practice this varies a bit, but not enough to really matter.

These values are halved on cloudy days, and photosynthesis scales in efficiency with temperature due to being an enzymatic process. Caloric production from LEAVES2 and LEAVES3 falls an additional 10% during the fall. I planned to have it drop off more, but it looks like the preexisting calculations in the code already accounted for much of the seasonal dropoff, so this gets us our expected values.

Photosynthesis also tanks at temperatures over 40 degrees Celsius. High temperatures are actually way worse for it than low ones. I've coded this, but it will likely not be relevant most of the time. If it's a problem in tropicata I suggest adding a mutation there to fix it.

Since height and armspan are roughly the same in humans, we can simply multiply the mutant's leaf area by the proportional difference in average height if they happen to be a size category other than medium. This scales up quite well and is very punishing to small plants, which is what we'd expect.

image
Bear in early summer pre-shed (85f)
image
Bear in early summer post-shed (85f). This bear, if careful, is now able to survive the summer.

@fairyarmadillo fairyarmadillo marked this pull request as draft November 20, 2023 16:52
@fairyarmadillo fairyarmadillo changed the title seasonal EOCs Seasonal Mutation EOCs Nov 20, 2023
@github-actions github-actions bot added [JSON] Changes (can be) made in JSON Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies EOC: Effects On Condition Anything concerning Effects On Condition labels Nov 20, 2023
@github-actions github-actions bot added the astyled astyled PR, label is assigned by github actions label Nov 20, 2023
fairyarmadillo and others added 12 commits November 20, 2023 09:13
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…ocs.json

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…ocs.json

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…ocs.json

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…ocs.json

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…ocs.json

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…ocs.json

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…ocs.json

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…ocs.json

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot added the <Enhancement / Feature> New features, or enhancements on existing label Nov 20, 2023
@Spicyshadow
Copy link

I peronally have hay fever and can tell you that it does have a noticable impact on your stamina. It doesn´t impact how quickly you recover (unless it is really bad) but it does impact how far I can run. A small reduction ( -10%) to max stamina would be realistic.

My hay fever used to be far worse 10 years ago. To the point my body would act as if it really was sick. You could implement this as a far more severe version with far stronger effects:

  1. From my experience severe hay fever doesn´t affect vision much more than mild hay fever but it is very distracting. So PER debuff of -2.
  2. You do feel noticably more foggy and tired with severe hay fever the same way you feel when you have a normal fever. The other symtomes like itchy nose and eyes, sneezing and mucus blocking the scinuses causing mild headachs are very disctracting. So a -4 INT penalty.
  3. It does have a small but noticable effect on strength So a -1 STR debuff.
  4. The headachs from block scinuses can get pretty severe so maybe have a chance of those. These can be treated with normal pain medication.
  5. Al the mucus in your nose and airways will have a major impact on your stamina. I would liken it to mild astma. So think a -40% max stamina and a -30% stamina regen.

@fairyarmadillo
Copy link
Contributor Author

I peronally have hay fever and can tell you that it does have a noticable impact on your stamina. It doesn´t impact how quickly you recover (unless it is really bad) but it does impact how far I can run. A small reduction ( -10%) to max stamina would be realistic.

My hay fever used to be far worse 10 years ago. To the point my body would act as if it really was sick. You could implement this as a far more severe version with far stronger effects:

  1. From my experience severe hay fever doesn´t affect vision much more than mild hay fever but it is very distracting. So PER debuff of -2.
  2. You do feel noticably more foggy and tired with severe hay fever the same way you feel when you have a normal fever. The other symtomes like itchy nose and eyes, sneezing and mucus blocking the scinuses causing mild headachs are very disctracting. So a -4 INT penalty.
  3. It does have a small but noticable effect on strength So a -1 STR debuff.
  4. The headachs from block scinuses can get pretty severe so maybe have a chance of those. These can be treated with normal pain medication.
  5. Al the mucus in your nose and airways will have a major impact on your stamina. I would liken it to mild astma. So think a -40% max stamina and a -30% stamina regen.

Good thinking. I'm on vacation for a bit but I'll try something like this when I get back.

fairyarmadillo and others added 7 commits November 21, 2023 06:25
…ocs.json

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…ocs.json

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…ocs.json

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…ocs.json

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…ocs.json

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…ocs.json

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…ocs.json

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot removed json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Dec 15, 2023
@github-actions github-actions bot added the json-styled JSON lint passed, label assigned by github actions label Dec 15, 2023
@github-actions github-actions bot removed the json-styled JSON lint passed, label assigned by github actions label Dec 15, 2023
@github-actions github-actions bot added json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Dec 15, 2023
@Maleclypse Maleclypse merged commit 8e41c69 into CleverRaven:master Dec 16, 2023
20 of 25 checks passed
RenechCDDA added a commit to RenechCDDA/Cataclysm-DDA that referenced this pull request Mar 4, 2024
RenechCDDA added a commit to RenechCDDA/Cataclysm-DDA that referenced this pull request Mar 4, 2024
RenechCDDA added a commit to RenechCDDA/Cataclysm-DDA that referenced this pull request Mar 4, 2024
RenechCDDA added a commit to RenechCDDA/Cataclysm-DDA that referenced this pull request Mar 4, 2024
kevingranade pushed a commit that referenced this pull request Mar 6, 2024
kevingranade added a commit that referenced this pull request Mar 12, 2024
Removes calorie gain from photosynthesis as it was added based on flawed premises.

Removes a bunch of photosynthesis changes entangled with the calorie gain.

Removes the seasonal variation in leaves because it's already a huge amount of content for some very minor impacts and this is not a maintainable pattern.

Completes removal of fruiting and related features. It's broken and needs heavy rework if it will go in.
kevingranade added a commit that referenced this pull request Mar 12, 2024
Removes calorie gain from photosynthesis as it was added based on flawed premises.

Removes a bunch of photosynthesis changes entangled with the calorie gain.

Removes the seasonal variation in leaves because it's already a huge amount of content for some very minor impacts and this is not a maintainable pattern.

Completes removal of fruiting and related features. It's broken and needs heavy rework if it will go in.
kevingranade added a commit that referenced this pull request Mar 12, 2024
Removes calorie gain from photosynthesis as it was added based on flawed premises.

Removes a bunch of photosynthesis changes entangled with the calorie gain.

Removes the seasonal variation in leaves because it's already a huge amount of content for some very minor impacts and this is not a maintainable pattern.

Completes removal of fruiting and related features. It's broken and needs heavy rework if it will go in.
kevingranade added a commit that referenced this pull request Mar 12, 2024
Removes calorie gain from photosynthesis as it was added based on flawed premises.

Removes a bunch of photosynthesis changes entangled with the calorie gain.

Removes the seasonal variation in leaves because it's already a huge amount of content for some very minor impacts and this is not a maintainable pattern.

Completes removal of fruiting and related features. It's broken and needs heavy rework if it will go in.
kevingranade added a commit that referenced this pull request Mar 13, 2024
Removes calorie gain from photosynthesis as it was added based on flawed premises.

Removes a bunch of photosynthesis changes entangled with the calorie gain.

Removes the seasonal variation in leaves because it's already a huge amount of content for some very minor impacts and this is not a maintainable pattern.

Completes removal of fruiting and related features. It's broken and needs heavy rework if it will go in.
Maleclypse added a commit that referenced this pull request Mar 14, 2024
GuardianDll pushed a commit to GuardianDll/Cataclysm-DDA that referenced this pull request Aug 19, 2024
Psithief added a commit to Psithief/Cataclysm-DDA that referenced this pull request Sep 16, 2024
Fix player_display: false where it shouldn't be.
This was added in CleverRaven#69591 with seasonal mutations and should have been removed when the rest of those changes were removed.
Fris0uman pushed a commit that referenced this pull request Sep 16, 2024
Fix player_display: false where it shouldn't be.
This was added in #69591 with seasonal mutations and should have been removed when the rest of those changes were removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` <Documentation> Design documents, internal info, guides and help. <Enhancement / Feature> New features, or enhancements on existing EOC: Effects On Condition Anything concerning Effects On Condition Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. Items: Armor / Clothing Armor and clothing [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions Lore Game lore, in-game communication. Also the Lore tab. [Markdown] Markdown issues and PRs Mechanics: Enchantments / Spells Enchantments and spells Mods: Aftershock Anything to do with the Aftershock mod Mods: Magiclysm Anything to do with the Magiclysm mod Mods: Mind Over Matter Mods: Xedra Evolved Anything to do with Xedra Evolved Mods Issues related to mods or modding Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants