vgstation13 icon indicating copy to clipboard operation
vgstation13 copied to clipboard

Cryotheum

Open malfunctioning-ai opened this issue 1 year ago • 41 comments

Adds a new gas, Cryotheum.

  • [x] Cryotheum spawns icy tiles when loosed and under 32F (0C) and when enough of it is in the air to be visible. These icy tiles have a low-ish chance to slip on them when not walking and smoothly send you flying across the ice until you hit a tile without ice or a wall. The speed you travel on the ice slowly decreases as you continue travelling and is also based on your movespeed. These icy tiles slowly harden if below 0C and slowly melt when above 0C, so even after the gas is scrubbed you may be dealing with slippery floors until you turn up the heat.
  • [x] Add the Cryotheum Resonator, a machine which converts oxygen into cryotheum using a fair bit of power. However, it requires a bit of cryotheum (enough for it to be visible) in order to work, as it "spreads" the properties of cryotheum to other oxygen molecules. This means you'll have to setup a system that won't suck it all out at once. Orderable from cargo, a bluespace crystal must be stuck in for it to work. Better crystal = faster, and the artificial bluespace crystal the cargo order comes with is fairly slow. A small tank of cryotheum to get you started can also be ordered from cargo. Also, emagging it makes it run a tiny bit faster, at the risk of side effects...
  • [x] Add three reactions that control the properties of the gas - 1. Cryotheum reacts with itself in the presence of plasma, destroying itself but cooling down its surroundings. This self-reaction depends on there being enough plasma to catalyze it. 2. Cryotheum also dissipates when above 0C, scaling linearly up to 2200K or around 2000C when it will evaporate instantaneously. 3. Oxygen, in the presence of cryotheum, slowly dissipates (around half of a room's oxygen will dissipate after 8 mins) and releases a bit of cold, down to around -40C. This essentially just keeps freshly produced gas and floods chilly enough to be annoying.
  • [x] Edit all hardcoded systems that look at various gas types to instead look at XGM gases, including air alarms, gas sensors, and other things.

Closes #20082

🆑 rscadd: Added a new gas, Cryotheum! This mysterious cold gas can only be produced through a "cryotheum resonator", a bluespace machine that can be ordered through cargo. It has a number of reactions with various gases, most importantly that it dissipates in the presence of plasma, but consumes a lot of heat in the process (making everything cold!).

malfunctioning-ai avatar Nov 11 '23 05:11 malfunctioning-ai

i like there being a new gas but maybe this would be better as water vapor as its something more physically grokable and consistent with it making ice and wet floors and could tie nicer into phase change stuff in the future

one thing to consider is that all the station air is currently bone dry at 0% humidity

Cool, new engine soon? Or cryotheum-powred TEG giving more power? Minecraft up in this

Securitymain avatar Nov 11 '23 11:11 Securitymain

What is cryotheum supposed to be? Plasma is clearly an organic compound, cause when it burns it releases CO2. Is Cryotheum a fancy oxygen compound, cause it makes N2O with nitrogen? The extremely low heat capacity it has (3x smaller than O2) gives me some ideas for flammenwerfers and dudebombs, so this is very cool.

Eneocho avatar Nov 11 '23 11:11 Eneocho

Do you slip on the cryotheum ice even with magboots on? Do galoshes stop the slipping? If nothing else, requesting the capboots to stop you from slipping, cause they use spikes on the floor to stay up, and that's very similar to spiked anti slip shoes.

Eneocho avatar Nov 11 '23 11:11 Eneocho

A gas named cryotheum should definitely have some kind of interaction with cryo chambers.

brndd avatar Nov 11 '23 14:11 brndd

>Bluespace Crystal Resonator

Why not just make a new miner?

ValkyrieSkies avatar Nov 11 '23 14:11 ValkyrieSkies

Why not just make a new miner?

Miners are boring, whereas gas reactions give atmos and engineers something to actually do.

brndd avatar Nov 11 '23 14:11 brndd

This definitely shouldn't be available from a gas miner. (An adminspawn only miner would be okay) I like this being something atmos techs have to actually produce themselves! The conversion of oxygen to cryotheum seems a little too simple, though. Maybe have the reaction require a catalyst, or another gas, or a set temperature. It would force techs to do some tinkering.

gurfan avatar Nov 11 '23 17:11 gurfan

another thing with making this H2O is that you could produce it and split it back and forth between H2 and O2 and turning into ice below 0C and liquid water above 0C makes sense as the gas itself condensing and freezing and boiling instead of generating ice

In my mind Cryotheum is indeed an anomalous space magic form of oxygen that behaves differently because it's from another dimension or something. And I agree the water vapor thing makes more sense, but then it makes less sense to give water vapor massive cooling properties. My main focus isn't the "lol flood" thing, I deliberately made that just slippery floors so it's less destructive than plasma (although if it's super cold that still kills people effectively from sheer coldness). After this I want to add an interesting atmos machine that requires alternating between very hot and very cold temperatures, so cryotheum serves as a more complex but more effective method than spamming space pipes to cool a large amount of gas.
I will also have to think about the way of acquiring this gas and how exactly it will cool things before moving onward. Oh and making it give bonuses to a cryo tube is a great idea I didn't think of.

malfunctioning-ai avatar Nov 11 '23 18:11 malfunctioning-ai

water boiling engines when

nuclear power

Eneocho avatar Nov 11 '23 21:11 Eneocho

Examples of the Cryotheum Resonator. Currently it converts 1/4/10 mols of oxygen into cryotheum every 2 seconds while active on the tile it sits on. There must be enough cryotheum already on the tile for it to work, so there'll be a way to order a small tank of cryotheum from Cargo to get it started. Emagging it makes it work 5x faster, but there's a 0.2% chance every 2 seconds to have a 75% to spawn a portal designed to flood and a 25% chance to spawn a permanent supermatter sea nearby. demonstration.webm bluespace.webm

malfunctioning-ai avatar Nov 12 '23 11:11 malfunctioning-ai

Miners are boring, whereas gas reactions give atmos and engineers something to actually do.

Pretty fair point, I'll cede that.

Examples of the Cryotheum Resonator. Currently it converts 1/4/10 mols of oxygen into cryotheum every 2 seconds while active on the tile it sits on. There must be enough cryotheum already on the tile for it to work, so there'll be a way to order a small tank of cryotheum from Cargo to get it started. Emagging it makes it work 5x faster, but there's a 0.2% chance every 2 seconds to have a 75% to spawn a portal designed to flood and a 25% chance to spawn a permanent supermatter sea nearby. demonstration.webm bluespace.webm

The emag stuff feels very overkill imo. Just the portals alone feel like enough already, the 5x speed and bluespace seas are kinda just silly on top of that.

ValkyrieSkies avatar Nov 12 '23 12:11 ValkyrieSkies

A few things:

  • Does cryotheum interact with people by itself like how plasma/co2 are toxic to breathe or is it inert besides the cooling interaction it has with n2?
  • You could add the ice tiles from snaxi's frozen core as an overlay, to very obviously denote that these tiles are frozen from cryotheum exposure, cause the puddle overlay is kinda hard to notice with the cryotheum taking using up visual space.
  • The sprite for cryotheum doesn't really fit with the rest of the gases (both plasma and n2o being "snowlike").
  • Don't like the idea of needing an emag to actually use the thing semi-properly, though I've been tinkering with the idea of some device that makes a permanent bluespace sea around itself as a catastrophic failure, so that's cool at least.
  • Despite being cool, do not use bluespace seas as a casually achievable bad outcome. It should be a catastrophic event that maybe spawns bluespace seas (and even then, pretty rare), not a simple emagging.
  • You could make it so emagging the resonator inverts its polarity and makes plasma instead, and since it'd be in an oxygen rich environment, it'd quickly turn into a plasmaflood. This would still require some effort on the emagger's part, as the current implementation floods everywhere for you for free.

Eneocho avatar Nov 12 '23 14:11 Eneocho

hows the performance on the gas reaction checking?

i recommend porting the essence of the reagent reaction code in https://github.com/vgstation-coders/vgstation13/blob/893c7b4867e1e86c07b9873bc15591367d0418c1/code/modules/reagents/Chemistry-Holder.dm#L402 and https://github.com/vgstation-coders/vgstation13/blob/893c7b4867e1e86c07b9873bc15591367d0418c1/code/modules/reagents/Chemistry-Holder.dm#L433 and https://github.com/vgstation-coders/vgstation13/blob/893c7b4867e1e86c07b9873bc15591367d0418c1/code/modules/reagents/Chemistry-Recipes.dm#L5 to try to make it easier to work with and possibly more efficient

The current performance is "acceptable but won't scale above 10 reactions very well". With 10 reactions I saw both the caching and the actual reaction each taking about as much cpu time as our beloved thermal dissipation caramel making functions, so about 2x that. With 1 reaction it was about 1/10th of 10 reactions (duh), so quite good. Currently I have two reactions - the reaction that turns Nitrogen and Cryotheum into N2O and the one that dissipates cryotheum when above 0C. There's are more things I can do to improve it though, so I'll be doing that. Chemistry reaction code isn't terribly useful for gas reactions unfortunately.

malfunctioning-ai avatar Nov 13 '23 03:11 malfunctioning-ai

Should be ready for review now. I still need to add some small things like cargo crates with some new stuff and new sprites but the heavy coding part is essentially done.

malfunctioning-ai avatar Nov 17 '23 18:11 malfunctioning-ai

i still dont like how it generates ice from dry air but the gas reaction system is cool and i like all the gas generalizations

maybe go through the cases mentioned in #20082 and see if it can be closed

Yes it should fix all the things in #20082. I don't think there's any machine that lets you pick from multiple gases that I didn't convert to automatically read from XGM. And no this won't affect toxins bombs at all.

malfunctioning-ai avatar Nov 17 '23 22:11 malfunctioning-ai

nice, please add Closes #20082 to the pr body in that case

not sure but maybe that spawn() was in there to prevent infinite loops of signals triggering each other on the same tick or something... could be good to check

If it was causing infinite loops then the spawn wouldn't even help that, it would just cause the infinite loop to tick every 0.2 seconds.

malfunctioning-ai avatar Nov 18 '23 05:11 malfunctioning-ai

Are you really slipping a completely unrelated and annoying air alarm chirping feature into this pr?

falcon2346 avatar Nov 18 '23 11:11 falcon2346

Seconding that complaint. Make the chirping a separate PR.

Eneocho avatar Nov 18 '23 12:11 Eneocho

Me and the atmos tech after the chirping gets merged https://www.youtube.com/watch?v=4zoQfqPnMA8

Eneocho avatar Nov 18 '23 12:11 Eneocho

Fine, I'll move it out.

malfunctioning-ai avatar Nov 18 '23 18:11 malfunctioning-ai

code/ATMOSPHERICS/components/binary_devices/MSGS.dm, line 92, column 44:
warning: field access requires static type: "name"
- code/ZAS/XGM.dm:5:17: add a type annotation after /list here

ShiftyRail avatar Nov 18 '23 23:11 ShiftyRail

Alright, I think it's balanced enough to be ready. I've done everything I wanted to change - probably missed some things given the size of it all admittedly though. And I plan on balancing more in future PRs. I also added a third reaction: Oxygen + Cryotheum as Catalyst = Cold down to -40C or so. This consumes only a very tiny amount of the oxygen - 0.15% is used every tick, so only in long floods will you notice that the oxygen in the halls is missing. This also helps oxygen in the oxygen->cryotheum chamber start off at a cooler temperature, since I was noticing the problem of pumping a shitload of 20C oxygen in to be converted result in the entire chamber being like 19C due to cryotheum's low specific heat. Also helps floods be chilly, since you can't acquire too much cryotheum and even at absolute 0 mixing 2% cryotheum with 98% station atmosphere just resulted in 18C.

malfunctioning-ai avatar Nov 19 '23 22:11 malfunctioning-ai