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

Cannabis extract overhaul #59386

Closed
wants to merge 24 commits into from
Closed

Conversation

onura46
Copy link
Contributor

@onura46 onura46 commented Jul 18, 2022

Summary

Balance "Add medical CBD extracts, rebalance cannabis extraction recipes and related drop rates"

Purpose of change

Adds medical-grade CBD extracts, disambiguates between extant THC extracts, modifies cannabis extraction recipes to be more consistent and realistic, and modifies drops for related items.

Describe the solution

TL;DR: This is an overhaul of the cannabis extraction system and many of its related items aimed at improving realism (somewhat) and consistency of some recipes. Please check "Additional Context" for research related to this PR and a breakdown of the extract crafting system.

"Medical-grade CBD extracts" have been added as an alternative to THC extracts. They are ~30% more potent as painkillers than their THC variants and do not cause you to get high, but also require the highest-end, closed-loop extraction equipment to produce (this was a gameplay-based decision to urge you to plant cannabis and seek out closed-loop extraction methods for renewable painkillers; realism sticklers, please be kind). They are not made from a different variety of cannabis plant, I'm sorry. (Realism sticklers... try not to think about it.) This could be changed with different varieties of cannabis in the future, but that was a little out of the scope of this PR.

All extract recipes have been changed for improved realism. Solvent usage has been changed to use more in open blasting recipes. Non-solvent-based recipes (rosin presses mainly, I'm thinking) are not in-game at the moment. Tool recipes have been changed to be slightly more realistic. I left the recipes for vacuum pumps and ovens. Even though they are mechanically pretty complex, better-than-improvised DIY solutions have been demonstrated online. Please check "Additional Context" for more information on this.

Filter paper is no longer craftable or deconstructable. Real-world filter paper is created in a factory process by treating not only paper, but fiberglass, plastic, nanocarbons, etc. with special chemicals to specifically define the width of its pores. No survivor should be able to craft it.

Item groups have been slightly changed. Plastic gaskets are now in "supplies_hardware" and filter paper is now a part of "tools_science".

NOTE: This PR still currently suffers from a bug (?) pointed out in #59230 and ethanol-based recipes currently return an entire stack (250) of ethanol per unit rather than 1 unit like they should. I'll edit this section of the code to fix this if required in the future.

This PR should also close #52743.

Describe alternatives you've considered

I'm torn between expanding the system and simplifying the process further by simply making one type of each: "CBD extract" and "THC extract". However, I hope the research here proves that there's enough depth to justify having slightly more options for a needy survivor. In real chemistry, the tools to extract cannabis oils are also used to extract many other essential oils, opening up another avenue for crafting advanced herbal medicines.

Certain item recipes could be changed individually, but this PR addresses numerous issues brought up elsewhere, notably #52743. Perhaps this PR doesn't even go far enough disambiguating THC and CBD cannabis plants for crafting purposes. This could be expanded upon in the future.

Currently there's also no way to collect used butane solvent back into a container from a closed-loop system, since butane is not yet a material in-game. This should probably be changed in the future, and the current way around this is to assume that the butane is trapped within the closed-loop system itself and recycled every time.

Testing

Tested on my own compiled version, confirming recipes appear as expected.

Additional context

Cannabis extraction in C:DDA can currently be performed with two solvents:

  • Butane: Boils off at room temperature over time or over low heat; can be used for cheaper, improvised extraction methods.
  • Ethanol: Requires heat to boil off; can be used for the largest, most efficient extraction methods.

Cannabis can currently be extracted into concentrates in C:DDA in two ways:

  • Open-loop extraction (open blasting): involves submerging cannabis in a pressurized container (a pipe with a clamp, in this PR) with butane solvent for a time. Solvent boils off into the air (which has the potential to cause explosions IRL and could in-game on critical failures in the future).
  • Closed-loop extraction: involves building or finding a closed-loop extraction system (small or large) and using either butane or ethanol as a solvent to extract the cannabinoids. If you use ethanol, this is used in the recipe then returned to you. If you use butane, it's simply a part of the closed-loop system itself and assumed to be recycled every time.

Cannabis extract is currently refined in C:DDA in two ways, by boiling off and by vacuum oven (this isn't super obvious, but is implied by which recipe and solvent you choose to use)

  • Boil off (butane): takes place at very low temperature (~90-100 degrees F) and normal atmospheric pressure over time, and results in less product in-game.
  • Boil off (ethanol): requires heat, is totally recycled as a byproduct in closed loop extractions, and can be used either on its own or in addition to a vacuum oven for further refining.
  • Vacuum oven: A special tool that lowers pressure inside it and applies low heat over a very long time to further refine concentrates into shatter. It requires a bowl made of aluminum foil (irl parchment paper works better). Closed-loop extraction methods using a vacuum oven result in the most product. Using a vacuum oven in Cataclysm is honestly kind of a flex because shatter recipes take 3 or 4 days to complete.

Therefore:

  • Ethanol solvent + Large closed-loop system + Vacuum Oven = Best Method
  • Butane solvent + No closed-loop system + No vacuum pump or oven = Worst Method

This system was created by @NastyNate2612 and further improved by @AtomicFox556, and I wanted to collect as much research as I could for anyone who might want to expand on this in the future:

Making BHO with an open-loop extraction method Part 1 (open blasting) (Video)
Making BHO with an open-loop extraction method Part 2 (vacuum pump + glass flask equivalent) (Video)
Making BHO in a small closed-loop extraction system with butane (Video)
Homemade vacuum pump recipe (Video)
Purging both butane and ethanol extracts in a vacuum oven (Video)
More info on vacuum ovens (Article)

@github-actions github-actions bot added [JSON] Changes (can be) made in JSON Crafting / Construction / Recipes Includes: Uncrafting / Disassembling Mods Issues related to mods or modding Mods: Innawood 🌲 Anything to do with Innawood mod Spawn Creatures, items, vehicles, locations appearing on map Game: Balance Balancing of (existing) in-game features. labels Jul 18, 2022
@onura46
Copy link
Contributor Author

onura46 commented Jul 18, 2022

This PR likely closes #52743 (which was already partially solved) and also affects one recipe in Innawood!

@github-actions github-actions bot added the astyled astyled PR, label is assigned by github actions label Jul 18, 2022
@github-actions github-actions bot added the json-styled JSON lint passed, label assigned by github actions label Jul 18, 2022
@github-actions
Copy link
Contributor

Spell checker encountered unrecognized words in the in-game text added in this pull request. See below for details.

Click to expand
  • You take a dab of some CBD shatter. It has a rich terpene flavor and you feel a slight tingle in your muscles as your pain subsides.

This alert is automatically generated. You can simply disregard if this is inaccurate, or (optionally) you can also add the new words to tools/spell_checker/dictionary.txt so they will not trigger an alert next time.

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jul 18, 2022
@AtomicFox556
Copy link
Contributor

AtomicFox556 commented Jul 18, 2022

Currently there's also no way to collect used butane solvent back into a container from a closed-loop system, since butane is not yet a material in-game. This should probably be changed in the future, and it means you don't get butane on your recipes like you can ethanol.

That's why I've originally made the "butane container" tools a requirement for crafting closed-loop extractors in #56703, assuming that the solvent is stored somewhere within the item. It only makes sense if you could recover all the solvent, which I was thinking is possible. If it's not possible, could add some solvent as a component requirement to extraction recipes themselves, to replace the consumed part of solvent.

@onura46
Copy link
Contributor Author

onura46 commented Jul 18, 2022

That's why I've originally made the "butane container" tools a requirement for crafting closed-loop extractors in #56703, assuming that the solvent is stored somewhere within the item. It only makes sense if you could recover all the solvent, which I was thinking is possible. If it's not possible, could add some solvent as a component requirement to extraction recipes themselves, to replace the consumed part of solvent.

Gotcha, I understand why that was in the recipe now. I kinda get the logic: there's a base amount of butane trapped within the system and recycled every run. Neither solution is true to reality. There's no harm putting it back in the recipe for now, I guess. I also put ethanol solvent byproduct at 1:1 cuz yeah, I suppose there's no reason to lose it. That's the whole point of a closed system, realistically.

Butane should only be used at the time of the recipe (a closed loop system is opened up between runs) and you should get butane back. Liquid butane really just needs to be added as a material for "byproducts" to work (along with fixing that other bug affecting byproducts). I just now tried hacking a way to not consume butane into the recipe with no success (["butane_tank", -1] creates a situation where you can use an empty tank to craft). I can look into adding the material in the near future.

@onura46
Copy link
Contributor Author

onura46 commented Jul 20, 2022

@AtomicFox556 Are there any other changes you would suggest making here (besides the extant stuff like the material issue) before I call this ready to merge? Do any recipes seem off? I think the extraction process is a little complex, so I appreciate feedback from anyone who understands what's going on. Thanks <3

@AtomicFox556
Copy link
Contributor

@AtomicFox556 Are there any other changes you would suggest making here (besides the extant stuff like the material issue) before I call this ready to merge? Do any recipes seem off? I think the extraction process is a little complex, so I appreciate feedback from anyone who understands what's going on. Thanks <3

I'd change extraction recipes making use of closed-loop systems to not consume butane by just not including butane in recipe, with the assumption being that butane is trapped within the system. Even if it's not how it's usually done IRL, it could be done like that and appears to be the most convenient way to do it as gas storage is a bit awkward at the moment.

@onura46
Copy link
Contributor Author

onura46 commented Aug 23, 2022

I'm gonna rework this a little, actually, because it wasn't the most well-conceived PR. It could probably be split up as well, because there are typo fixes, item group changes, and (definitely unnecessary) recipe additions all in one.

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 Crafting / Construction / Recipes Includes: Uncrafting / Disassembling Game: Balance Balancing of (existing) in-game features. [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions Mods: Innawood 🌲 Anything to do with Innawood mod Mods Issues related to mods or modding Spawn Creatures, items, vehicles, locations appearing on map
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"high quality distillate (heads)" recipe byproduct is excessive/inadequate
3 participants