Go Back
Atmosia - Subframe Doc
==============
SUBFRAME GUIDE
==============
An AINFA (Atmosia Information Agency) production; message @Ilya246 (@ilya246:matrix.org) or @routerchain (@router:kde.org, router@irc.libera.chat or email route@baseduser.eu.org) for invite, or if you have questions

# Subframe: What it is and how to use it

Subframe (or subtick) is a field of Atmos (well, not really - you'll see later) research that has started sometime in 2023.
It allows for the fastest and most efficient setups yet available, for infinite gas storage, and may potentially have other undiscovered applications.
Here, you can learn how to use it.
-# Unless you're on Wizard's Den servers, where this technique has been patched for "high-pressure" (>4500kPa) applications.

## But what really is subframe?
The core of it is that devices don't update simultaneously; every half-second, the game goes through all atmos devices and updates them sequentially. Subframe is about utilising this.
Specifically, it's possible to get devices to update in a specific order.
The creators of this document (and anyone who knows subframe well, really) wouldn't recommend doing this on MRP.
* To clarify, the legality depends on the server. Some consider this an exploit (Delta-V, Grimbly Station, The Den, etc.), while some consider it a necessary sacrifice for fluid gameplay (Funky Station).
  * This shouldn't be considered a guide on where you can do this. Ask the admins if you're really in doubt.

### "Update"?
Yes. Devices do not work continuously, they do their function every time they update. This means that, say, pumps transfer the gas they're supposed to all at once every 0.5s and not over time.
The scale of those "all at once" updates is determined by how much work the device has to do to "catch up" with the time it was doing nothing. So, when updating, a pump will instantly do the work it should've done over the past 0.5s.

## An interjection
(TL;DR: if the output is below 4500kPa and the input is below 4000L of volume, filters can instantly move all the gas from the input to the output)

We have to note an oversight in how volumetric pumps work. Note that a gas filter is also a volumetric pump and can be used as such on its "None" setting.
Volumetric devices calculate how much volume they would pump in the 0.5 second timeframe they need to "catch up" on during the update. This means that, per update, they would attempt to grab as many liters as half of their set L/s value from their input.
However, they do not. As a mechanic, there exists atmos speedup, which causes every atmos device to work 8 times faster than specified. This means that a volumetric's pump real maximum speed is 1600 L/s, and a filter's - 8000 L/s.
For filters, that's 4000L per update. Why does this matter?

To understand that, we have to learn what a pipe node is. Every single piece of a pipe (200L), ending of a pump, radiator, etc. (2 per: yes, they hold 400L total), or a filter/mixer (3 per, 600L total) is a pipe node. Even heaters are a pipe node.
Adjacent (the nodes of a single pump, radiator, filter, mixer, etc. do NOT count as adjacent; however, specifically manual/signal valves are an exception and are essentially a normal pipe when open) nodes join into a pipe network, or pipenet.
One pipenet is essentially a single continuous pipe. Putting gas at one end of it is equivalent to putting gas at the other. The shape or length does not matter. It is a single volume. Individual pipe nodes do not store gas, only the entire pipenet.
-# Yes, gas analyzers quite literally lie to you and divide shown mole/volume values by the amount of nodes in the targeted pipenet.

Now back to how volumetric pumps work. Consider what happens when the amount it attempts to pump is higher than the volume of the source pipenet. It will attempt to move all of the source pipenet's gas to the output pipenet.
Now, you should remember that normally, pumps and filters stop working when their output is above 4500kPa.
But this check only triggers if the output is above 4500kPa before it updates. It can pump the output from a pressure below that to a pressure above that just fine. And this has no limit.
This means we can pump an arbitrary amount of gas from a pipenet to another, as long as the input's volume is below 4000L (remember: gas filters on "None" are essentially faster volumetric pumps) and the output's pressure is below 4500kPa.

This is not directly related to subframe, but it is the core concept utilised in modern subframe setups.


## Where does subframe come in?
In using this as an infinite gas storage. We spoof the update order to be like this (refer to example blueprint lower in this section):
1. Gas is injected into the left pipe. This should not bring the **central pipes** above 4500kPa.
2. The filter going from the right pipe to the left pipe fills it with the entirety of the right pipe's gas.
3. The right pipe's gas, now mixed with the newly injected gas, is entirely moved back to the right pipe.
This repeats.
This is an infinite gas storage. The fact that we use filters also allows us to siphon gases from it on demand; however, it will clog if there's insufficient filtered output.
Of course, you can (and should) just use another subframe loop to store the filtered output - see sorting-based construction.

The arrows in the loop are gas filters here.

 ┌<┐
>┴>┘


In addition, some *logic circuits* may take advantage of subframe. In more detail, this is described as "runic" atmos or simply "runes" - but can also refer to the subtick field as a whole.
These were originally pioneered by a character named Zifnab Idleton on the Frontier servers, sometime in early 2024 - but are out of scope for this document. (Suffice to say, don't do this on MRP unless you know the admins are cool with it.)

# Building subframe pipelines
And now, let's explain how can you causes devices to be updated in the order you want.
Every grid has its own list of atmos devices, and update order picks devices from that list in order.
Removing or unanchoring an atmos device essentially "crosses out" its item on the list. We also remember that we crossed out this item last.
Adding an atmos device will add it as an item to the end of the list, unless we remember a crossed-out item exists, in which case it will overwrite the crossed-out item instead.
If we overwrite a crossed-out item, and, when we crossed out that item, another item was already crossed out, we will remember said item as the "current" crossed-out item instead.

Basically: devices update in the order they are built, but if devices were removed or unanchored, newly built devices will take their place in the update order instead.
This means someone unanchoring or deleting a device on the same grid while you're building something can mess up your update order.

## Direct construction
Use an RCD or steel sheets to construct the following schematic:
(█ are plasma/oxygen sources, ┮ is a mixer, > and < are filters)

  ┌<┐
█┮┴>┘
 █

in the order of:

  ┌2┐
01┴3┘
 0


To ensure it works, pump 0.01 kPa of oxygen through the mixer, and put a heater on the output of the filter placed 3rd. (Some non-pipestack servers will require you to branch off one of the pipe nets to place a heater.)
If it works, the pressure in one of the loop halves will steadily increase. If not, it won't. Use a gas analyzer to look for this.
If you observe it not working, see the other construction methods below.
Note: you **cannot** use 4500 kPa at any point. We have established this earlier, due to the default behavior of volume pumps - if the pressure is ≥4500kPa, filter 2 will not be able to pump.

## Sorting-based construction
This method is best used anywhere past 5-20 minutes of the shift, ***and where you can't construct any more devices***. To start off, how *do* we determine update order?
We have to employ a consequence of update order. In a perfect world, a linear filter design like this:

>>>


would store no pressure (so long as the third filter is attached to a sink.) This is the "natural" state of a sorted filter loop.
Let's expand it, for brevity:

█>─>─>█
or
█1─2─3█

If update order were to start off as 1-3-2, the way we'd notice this is by following the order.
1→3: in order, no pressure
2→sink: presumably in-order, we can't know for sure
3→2: out of order - a bubble forms, let's say 0.1 kPa of oxygen


So if you were to gas-analyze the central filter, you'd *see* a physical 0.1 kPa bubble between the central, and the last filter. These filters are definitely **out of order**, and you need to:
1. Unanchor them
2. Swap them (**by pulling**, as picking up might mess up weird internal hashmap order)
3. Reanchor and activate
4. Repeat until all filters are sorted


### You have just performed an algorithm called bubble sort.
And it's frankly the simplest way to get subframe going reliably. There are only two gotchas, though:
* It's possible that there will *still* be a bubble in the same location. This suggests that the atmospherics tick **ends** at one of these filters. In this case:
  * Involve a fourth filter. You only need a continuous row of 3 to continue.
  * Try deconstructing and reconstructing a filter. In some cases, this is just straight up faster.
  * YOLO and just don't give a shit if a pipe net successfully fills beyond 4500 kPa.
* This requires a non-zero amount of time to perform.
  * Which is why the actual method you see used by some Atmos Techs ingame is the building method found to work by Ilya246 in 2025.I: simply keep unanchoring then immediately reanchoring the filters until the setup works.
		* If you have questions as to why it works, we do too. If you find out, let us know in the AINFA Discord. *This guide won't write itself.*
  * CEs and other Atmosians will look at you like you're from another planet - until you show them the result.

Now, move the central filter to where the ***2*** filter is in our upper method:

  <
> > 

and connect them like so:

 ┌<┐
>┴>┘

You now have a subframe chamber. Mixer not included - but the third filter on the *input* allows you to do all sorts of chicanery involving the mixer - even setting it to 4500 kPa for ease of use.

## Brute-force construction
Some servers hosting Goob Station-derived forks or Einstein Engines code might allow you to use **RPDs** as a method of construction. **This is huge, because:**
* RPDs bypass **most pipe stacking rules.**
* They're faster.
* They're *cheaper* (until you run out of RCD ammo)
* They're more robust than the construction menu.
* They allow you to place devices **where normal device stacking would tell you to sod off.**
* Deconstructing with a RPD **refunds charges** (info date: 2025.III), and non-CE welders don't refund **welding fuel**.

You start off with a *hybrid* of a directly built chamber and an ordered one:

   ┌<┐
█┮>┴>┘
 █

Then, you analyze where the bubbles are, and where they *shouldn't* be. If you find it - place a filter - and turn it on.
* Repeat until you have a working subframe.

This is an ***extremely fast*** method, however, it's also ***extremely unreliable***. You can end up with a working subframe on *minute 2* of a round, which is absolutely critical if you just got nuclear war declared on.
However, it's also simple. We don't advise you do this in production, but if duty calls for it, spam away.

# Practical example: Tritium cooker
Normally, tritium production runs into issues. Setups clog or lose out on production speed due to pump/injector limits or the need to filter waste.
How about we just stop caring about the limits?
Subframe allows us to do just that.

You should note that gas reactions (aka gas fires, etc.) also happen during updates, but only after devices have updated. Additionally, the tritium fire reaction is ordered to happen before the tritium production reaction.
This means freshly made tritium needs another atmos update to start burning. If we extract it in the next atmos update, we can prevent it from burning at all. Zero tritium burnt. And subframe storage loops have a period of 1 update.
Just what we need.

However, having zero tritium burn can prove problematic too, since plasma needs temperature to burn. And tritium that doesn't burn doesn't help with raising the temperature.
This is why you have to intentionally not filter some tritium in the beginning to raise the temperature and let plasma burn properly.


Here's one variant of setup, involving two subframe chambers connected directly:

       ┌┐G-... (G - passive gate facing outwards, ... - wherever you want a supply of tritium, possibly distro)
       VΛ
       ├┘ <--- (*) (read below)
   (*) Λ
    └→┌<┐
  █┮─>┴>┘
   █↑
    └ also equiv. 4000L, ≤4499.99 kPa (*)
    

* You can stack up to 16 pipes here. If you're not sure why or if you need it, don't do it, as it decreases the amount of pipe nodes you can attach to that loop side.

This design - if you excuse the crude representation of **stacked pipes** - allows you to in theory go up to 2200 mol/s of tritium production... at 1680K.
* Why the stacked pipes? So that we can pump more gas into the input without causing the pressure to go above 4500kPa, and input gas faster, as pressure is inversely proportional to volume.
	* You should only stack the pipes if you know you need them, however. Even without them you can achieve high production rates.
You'll also be required to sort the second storage subframe, unfortunately - but in some cases you might get lucky and see *throughput* by measuring the 3rd and 4th filter in a row. Or 4th and 5th.
* Throughput is 4*measured tritium mol in a gas analyzer (2x for filter frequency, 2x for 2 pipe nodes).

If you input an ideal ratio of 2.5P:1O (see: allofatmos.txt), the chamber is **bound to get hotter**, so in reality, you should monitor your gas input - as you won't be able to sustain 2200 mol/s for long.
It will **have** to drop to not clog up your chambers.

Here's another involving radiators:

   █
   Λ <--- can be expanded to more volume,
   ║            radiators work only *once* per tick - **do not stack**
  ┌<┐
█┮┴>┘
 █


## (Special Tritium) Operation
So, you've built your tritium chamber. Let's dig into how you could maximize output. I'm going to be assuming your mixer's output is 400L, just like the sorted "proper" design. For the naive 5-pipenode design, just stop at 2000-ish kPa.

First of all, I hope you've taken your haloperidol. Second, follow these steps:
1. Input 100 kPa of 1P:99O until you see the temperature go above 1643.15K. Your filters should be set to "None" at this point.
2. Double the pressure, and wait until the temperature stops dropping.
3. Double the pressure again - repeat step 2 until 4500 (or 4499.99) kPa injection (mixer pressure).
  * Optionally, let it burn into water vapor if you want to run a TEG off of a single burst of water. See below.
4. Set the relevant filter to **Tritium** (once comfortable). Lower the oxygen percentage (80% or so should work) until the temperature isn't dropping anymore, if it was, and wait for the chamber to have a large (>5000mol is fine) amount of oxygen.
	* From here on, watch that the plasma concentration stays below 1% of what oxygen is. If it doesn't, decrease the plasma ratio or injection.
5. Set the mixer to 71.42857% plasma and 0.01 kPa for a start.
6. If you *haven't already* (or don't plan to, and will ignore this step), build your subframe storage. The 0.01 kPa injection should allow you to **sort filters safely** even though the chamber is technically running.
7. Ramp up the injection to your heart's content.

(maybe 2 methods of operation then - i was using full 2200 mol/s throughput blueprint, and 100% oxy kinda controllable because one thing happening)

## Optional considerations

AINFA reminds you to wear your atmos firesuit or hardsuit for full fire protection.
If the gas miners aren't enough for you, for the absolute highest throughput, you'll likely want to store a bunch of oxygen while you're building tritium. Most gas miner setups aren't *perfect*, but they'll get you there eventually.
Storing is usually a pain in the rear without subframe - so put a subframe buffer *on* the oxygen line. After all, *you're* Atmos.
Additionally, if you're scared of a runaway clog, you can set the mixer to 11% plasma to let the inlet oxygen cool your burn to ~1700K. *Very nice* if you struggle with attention.
If you have an RPD on you and you have a massive army entering Atmos to kill you - just place a passive vent on the chamber. Sure, it'll clog, but you'll be safe. (- router)
* Also, if you're burning an army, remember to use your atmos remote to bolt all entrances. The firelocks too. (- Ilya246)
If you're using a second subframe loop to store tritium (and you should), you can attach a connector port to one of the filters and set it to tritium for a moment to fill the connector port with massive amounts of it.
* You can also flash-freeze it once you filter it all out - unanchor into a windowed/holofanned tile, and fire extinguisher it. Useful for mass frezon - just make sure to use a **portascrubber** to collect it.
* A way to make such a setup reusable is an exercise left to the reader. You'll need to output the tritium into a pipenet with a pump before the connector port and a pump back into the loop.
You could theoretically use both halves of the subframe as input halves, but we haven't experimented with that yet. It should theoretically work. (- Ilya246)

# The TEG

If you like making tritium, why not weaponize its power for a TEG that lasts you several weeks or months? You'll need a **single** subframe storage for this.
So, to remind ourselves, here's our basics:

   ┌<┐
█┮>┴>┘
 █

The TEG has two loops - hot and cold. However, much like the GarTEG, we won't be needing overkill cooling to power the station.
There's many ways to build the TEG itself - but one way is to directly vent the hot water vapor that we'll be using into space (as opposed to re-injecting it into storage, which is more efficient).
Let's explore the venting part:

    █ ┌Λ
    [≡]║
    Λ └┘
   ┌<┐
█┮>┴>┘
 █

In this example, we have a tritium chamber almost *directly* connected to the TEG. Here's the caveat, we only use the burn chamber *once*.

## Operation
0. Ensure your TEG's cold loop actually has plasma. Do *not* use other gases.

1. Input 100 kPa of 1P:99O until you see the temperature go above 1643.15K.
2. Double the pressure, and wait until the temperature stops dropping.
3. Double the pressure again - repeat step 2 until 4500 (or 4499.99) kPa injection (mixer pressure). So far, standard.
4. Start increasing the plasma percentage slowly (keeping 1% plasma content) until 9.615% plasma. (Exact: 9.(615384)%)
  * Even though this is 100%/(10 O/T + 0.4 O/P), you might encounter oxygen is dropping. If this is the case, tune it until it *isn't*.
5. After achieving the desired water vapor amount, burn away all the oxygen by increasing the plasma percentage.
  * You should have 2000 mols in total (500 mols if 4-pipenode storage net) left by the end (if planned for tritium).
6. Once you've burned away your oxygen, shut the mixer off and filter it all into the 4th filter, which should be **inactive** at this point.
7. Set the 4th filter (TEG input) to 0.00001 L/s. Increase until supply matches demand.
8. Use the subframe chamber for something else.

# Conclusion
Subframe is a marvelous oversight/bug/exploit no matter how you look at it for engineering purposes. It's already on its way out, but if you ever feel like you miss subframe, hop into SS13. In SS13, subframe is alive and well - save for the atmospheric speedup.

...Oh yeah, and it's not just Atmos.
### Linkables
If you ever dabble into building logic gate designs with that spare steel and LV cable of yours, keep in mind that logic gates have their *own* update order. It'll make the difference between your logic gates working 30 times a second, and 15.
You can't actually change the update order without changing the logic gate type, but it sure as hell annoys people if you link a 60hz clock to a door bolting. BUZZ-BEEP-BUZZ-BEEP..

---

With this knowledge in your hands, you should be able to construct more elaborate designs *on the fly*. If you can't, feel free to re-read this document, or drop into the AINFA for rigorous help.
*"Our crack team of on-call Atmosians will be able to train you on the spot. Name a station, and we'll turn that hunk of space debris into a Cargo field trip." -Zed Seven, Atmospherics Director*