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

Cryogenics: restrict cryo pods to cryo meds, restore limited metabolism #1533

Merged
merged 7 commits into from
Jun 21, 2024

Conversation

whatston3
Copy link
Contributor

@whatston3 whatston3 commented Jun 17, 2024

About the PR

This PR addresses side effects of the Cryo Overhaul PR, and reverts most changes in behaviour to metabolism.

  1. Metabolism is once again limited (see point 4) to a fixed number of reagents per metabolizer (hereafter, organ).
  2. A new metabolism group was added, "Cryogenic", that contains all current cryogenic medicine.
  3. All existing organs that could metabolize Medicine have had Cryogenics metabolism added.
  4. Any organ that can metabolize cryogenic medicine can metabolize an unlimited number of them at once without counting against the number of processed reagents.
  5. Cryo pods now only administer cryogenics medicines, but maintain all efficiency and injection rate changes (2x as efficient, 0.25u/s draw per reagent in solution)

I have added versions of per-reagent SplitSolution functions (one with whitelist, one without) that are more consistent with other methods in the class.

Why / Balance

The change in behaviour from metabolizing a fixed number of things to an unlimited number of things affects the metabolism of food, of medicine, and of poisons. It removed most differences between species apart from arachnids metabolizing less frequently.

The goal is to keep cryo strong, but appropriately strong, and to avoid overreliance or abuse of cryo pods for non-cryo meds. I believe injections, pills, topical meds and bedrest should ideally all have a place in medical gameplay.

How to test

  1. Buy a Caduceus. Make sure it's fueled and prepare the atmos for cryo.
  2. Spawn a Urist McHands (human), place them on the stasis bed inside.
  3. Edit Solutions on the Urist. Add 20u of Inaprovaline, DexalinPlus, Kelotane, Cryoxadone, Aloxadone, Necrosol, Stelloxadone, Traumoxadone, Doxarubixadone, Opporozidone.
  4. Watch the solutions metabolize. Two of the first three should randomly drop 0.5u each metabolism update, but all of the cryogenic reagents should all metabolize at 0.5u per update.
  5. Spawn a bluespace beaker. Add 100u of Cryoxadone, Aloxadone, Necrosol, Stelloxadone, Traumoxadone, Doxarubixadone, Opporozidone, Ketchup, CarpoToxin, and DexalinPlus.
  6. Put the Urist McHands in the cryo pod.
  7. Examine the solution in the bluespace beaker and Urist McHands, insert it into the cryo pod.
  8. Only the cryogenic meds should be inserted (0.25u per second). Ketchup, CarpoToxin, and DexalinPlus should remain.
  9. Urist should receive 0.5u per second of all cryogenic meds being removed from the beaker.

Media

Testing metabolism: non-cryo meds are randomly metabolized if too many in solution, vs. consistently metabolized cryo meds
human_solution

Testing cryo pod extraction: only cryo meds are extracted, non-cryo reagents are left in the beaker
cryo_beaker

  • I have added screenshots/videos to this PR showcasing its changes ingame, or this PR does not require an ingame showcase

Breaking changes

Content.Shared.Chemistry.Components.Solution:

  • SplitSolutionEvenly has been renamed to SplitSolutionPerReagent, its parameters have not changed.
  • Added a public method, SplitSolutionPerReagentWithOnly.

Changelog

🆑

  • tweak: Organs once again metabolize a limited number of reagents at once.
  • tweak: Cryo pods now only extract cryogenic medicines from beakers.

@github-actions github-actions bot added Docs Improvements or additions to documentation YML C# FTL labels Jun 17, 2024
Comment on lines +58 to +59
// Frontier: keep a list of cryogenics reagents. The pod will only filter these out from the provided solution.
private static readonly string[] CryogenicsReagents = ["Cryoxadone", "Aloxadone", "Doxarubixadone", "Opporozidone", "Necrosol", "Traumoxadone", "Stelloxadone"];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't like this: frankly, it should be searchable by MetabolismGroup without LINQ.

Whenever the reagents get loaded from YAML, you could look through the effects, associate them with the metabolism groups they have effects for, and then access that set in some lifecycle call here to build this array.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would recommend not using a hard coded list. it will make it makes it harder to maintain given somebody might add, re-name, remove, update, something in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is that (as far as I know) there isn't a good, existing way to look it up. I can tell you what this should be - every reagent that can be metabolized as a Cryogenic drug.

Association's done from the individual reagents, and by the effects they have (can't think of an example of association here that isn't 1:1, but it's possibly 1:N off the top of my head). This isn't being stored at all in the MetabolismGroup, so we can't have a nice look up at runtime.

@github-actions github-actions bot added the Status: Needs Review This PR is awaiting reviews label Jun 17, 2024
@neuPanda
Copy link
Contributor

The goal is to keep cryo strong, but appropriately strong, and to avoid overreliance or abuse of cryo pods for non-cryo meds. I believe injections, pills, topical meds and bedrest should ideally all have a place in medical gameplay

cryo does not take away from those, the changes to the "potency" do not increase how much or how fast it heals it just reduced how much chem was used. the med bed is still very powerful as it cleans up damage across the board without any meds. the benefit to the future tech of cryo was that it saved on chems and allowed for safer use of cryo chems.
given cryo pods are only on 2 ships, and take time to get the patient prepped to go into them and then cool off before the chems can start working, a hypo spray is significantly faster and even an injection will lead to faster results. pills are easier to use on the go, and topicals need to be removed imo or made to where they don't work on anything above a certain damage threshold.

The change in behavior from metabolizing a fixed number of things to an unlimited number of things affects the metabolism of food, of medicine, and of poisons. It removed most differences between species apart from arachnids metabolizing less frequently.

what if rather than limiting the amount of things that can be metabolized, we limited how much can be metabolized.
example human can only process up to 2u per tick if you have 10 units in you that means you get .2 of each per tick if there are equal amounts of each. a lizard might be 1.5 a vulp 2.5 (just examples not actuals). this way each race is distinct (which they are not currently)
this would lead to concerns with binary effects like flavoral with speed however if we make it so binary effects are only triggered if metabolized in full (you only get the benefit if the metabolism consumes the .1) that would help with this

Copy link
Contributor

@dvir001 dvir001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working as intended

I like having my human blood stream suck ass with regents. 😢

}
else
{
splitSolution.AddReagent(currentReagent.Reagent, toTakePer);
RemoveReagent(currentReagent.Reagent, toTakePer);
Contents.RemoveSwap(i);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as I had mentioned in the private messages, it is bad practice to remove from an iterator while iterating threw it.

the argument of "but everywhere else does it" falls in line with "if they jump off a bridge would you"
quality can not be improved if it is ignored for consistently
that's not directed at you, but anybody and everybody who works on code
as developers it is our responsibility to protect quality where we can

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair, but we are also tied with upstream. If you want to move away from the code they have, alright, that's fine, but it must be done with intent. That is not the case here. I would believe that it is easier to maintain a set of solution splitting functions that look and act similarly than four and an odd duck.

Resources/Prototypes/Reagents/medicine.yml Show resolved Hide resolved
Comment on lines +58 to +59
// Frontier: keep a list of cryogenics reagents. The pod will only filter these out from the provided solution.
private static readonly string[] CryogenicsReagents = ["Cryoxadone", "Aloxadone", "Doxarubixadone", "Opporozidone", "Necrosol", "Traumoxadone", "Stelloxadone"];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would recommend not using a hard coded list. it will make it makes it harder to maintain given somebody might add, re-name, remove, update, something in the future.

@dvir001
Copy link
Contributor

dvir001 commented Jun 18, 2024

After looking into Upstream metabolism refactor (space-wizards/space-station-14#19383) we should stay away from making any metabolism code changed till it pass, if this PR revert most of them to upstream code this is actually good.

Refactor Metabolism and move it to Shared. Metabolism will now use chemical reactions limited by catalysts instead of it's own reaction logic. Metabolic effects will also no longer be defined on reagents and instead be defined as individual prototypes in YAML to make them easier to keep track of.

@neuPanda
Copy link
Contributor

Working as intended

I like having my human blood stream suck ass with regents. 😢

humans can metabolize .01 unit per tick. take that you smelly humans 😆

Copy link
Contributor Author

@whatston3 whatston3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revised. Fair points on the functions themselves.

Comment on lines +58 to +59
// Frontier: keep a list of cryogenics reagents. The pod will only filter these out from the provided solution.
private static readonly string[] CryogenicsReagents = ["Cryoxadone", "Aloxadone", "Doxarubixadone", "Opporozidone", "Necrosol", "Traumoxadone", "Stelloxadone"];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is that (as far as I know) there isn't a good, existing way to look it up. I can tell you what this should be - every reagent that can be metabolized as a Cryogenic drug.

Association's done from the individual reagents, and by the effects they have (can't think of an example of association here that isn't 1:1, but it's possibly 1:N off the top of my head). This isn't being stored at all in the MetabolismGroup, so we can't have a nice look up at runtime.

}
else
{
splitSolution.AddReagent(currentReagent.Reagent, toTakePer);
RemoveReagent(currentReagent.Reagent, toTakePer);
Contents.RemoveSwap(i);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair, but we are also tied with upstream. If you want to move away from the code they have, alright, that's fine, but it must be done with intent. That is not the case here. I would believe that it is easier to maintain a set of solution splitting functions that look and act similarly than four and an odd duck.

Resources/Prototypes/Reagents/medicine.yml Show resolved Hide resolved
@whatston3 whatston3 requested a review from neuPanda June 18, 2024 18:46
@dvir001 dvir001 merged commit 39591e9 into new-frontiers-14:master Jun 21, 2024
13 checks passed
FrontierATC added a commit that referenced this pull request Jun 21, 2024
@whatston3 whatston3 deleted the 2024-06-15-Cryo-balance branch July 2, 2024 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C# Docs Improvements or additions to documentation FTL Status: Needs Review This PR is awaiting reviews YML
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants