Skip to content

Need a pipe network simulation #35

Open

Description

@ArtisticRoomba

Scopecreep hell, let's get started.

We need a pipe network simulation in order to bring us up to parity with SS14's AtmosphereSystem. There are a lot of issues with the current implementation in SS14, but here are the two big ones that we need to solve:

  1. Pipe networks in SS14 are simply just extremely large single GasMixtures that flow across device boundaries/network splits to other GasMixtures. This means that, in a network, the addition and removal of gas is instant no matter the size of the network, so gas can be instantly transported from one side of the station to the other. There are no pressure fronts or gradients.

  2. Devices that operate on a pipe network perform their operations on the network one at a time. This is a big problem as a lot of bugs and/or confusing behavior occurs due to the order of operations of devices.

Here is some more info on the topic that I've written in the past:

All Atmospherics mechanics should be intuitive and easy to understand, with a focus on creating a quasi-realistic simulation of real-world atmospheric systems. Devices and mechanics should do what you expect them to do at face-value, coming from real-life experiences. The player should not need to care, or even be aware, about the underlying mechanics, code, or abstractions that Atmospherics performs or runs on.

More Info on Device Ordering

Atmospherics and its technical design should not create a situation where players rely on or need to be aware of an internal implementation detail. An implementation detail in this context is a programming decision or internal behavior that should be hidden from the player.

Learning and taking advantage of implementation details often requires knowledge of how Atmospherics simulates the environment on a technical level. This is very hard for any new player to learn and should not be the intended way for mechanics to be communicated/learned in Atmospherics.

Taking advantage of these implementation details often lead to unintended gameplay that is hard to balance when considering all players, ex. players producing tons of gases or bypassing certain mechanical restrictions. For this reason, circumstances where players can take advantage of an implementation detail should be removed.

In the case where players were heavily reliant on the implementation detail to meaningfully progress or have fun in Atmospherics’ gameloop, the behavior should be substituted with mechanics that make sense to the player and respect their expectations.

Atmospherics does not process devices all at the same time, rather devices are queued for update and processed one at a time.
This can lead to the following circumstance:

Imagine a line of filters, like in a station recyclernet, all connected in series:

flowchart LR;
    inlet(Net Input) -->
    f1[Filter 1] -->
    f2[FIlter 2] --> 
    f3[Filter 3] -->
    outlet(Net Output)
Loading

In this instance the filters are updated in order from F1 → F2 → F3.
Now let's introduce \( n \) mols of gas in the inlet and process an atmostick.
The following would occur:

  • Atmospherics would process the first filter first. This first filter will take the gas and deposit it in the inlet of the second filter.
  • Atmospherics then processes the second device, which is the second filter. The second filter then moves the gas to the third filter.
  • Atmospherics processes the third filter which moves the gas to the outlet.

In this instance, we've just processed \( n \) mols of gas through three filters, all in one atmostick.

Now imagine that the filters are updated "out of order" where F1 → F3 → F2.
The following would occur:

  • Atmospherics processes filter 1 and moves gas from the inlet to filter 2.
  • Atmospherics now processes filter 3. Nothing happens because filter 3 has no work to do.
  • Atmospherics processes filter 2 which moves gas to filter 3. However, we've already updated filter 3 in this tick, so filter 3 cannot do anything until the next atmostick.

In this instance, we did not process any gas at all, and have to wait a second atmostick in order to fully process \( n \) mols of gas.
In more complex setups, this type of behavior can add up and impede the flow rate of a setup.

This isn't fun for players at all, as a player not aware of this implementation detail is missing out on a high flow setup.
Players attempting to recreate their setups might see different behavior from round-to-round, all because the device order didn't line up right.

As such, update-order behavior should be improved to the point where players do not need to be aware of Atmospherics' processing order. This is a very hard problem with multiple solutions due to the nature of accurately simulating a massive gas network with many sources and loads.

As such, we need to develop some type of solver that processes the network and its devices all at once. Things getting processed one-at-a-time is off the table.

I've poked around here and there, I think the solution that comes closest to what we want is something like the Pandapipes solver. They have docs on their solver, you can find it here. While pandapipes is open source, their solver is not licensed under MIT or MIT-compat, however you can't copyright mathematics, so the mathematics of their solver is something we can possibly analyze and re-implement in C#.

Activity

  1. added
    enhancementNew feature or request
    ParityItem would bring the sim up to parity with another simulation.
    Scope: CoreSimItems related to the core simulation.
    on Aug 24, 2026
  2. added this to the v0.1.0 milestone on Aug 31, 2026
  3. Roudenn commented on Sep 6, 2026

    @Roudenn
    Contributor

    I've started working on a separate sim that would allow to be used as a universal solution to replace SS14's NodeGroup system and at the same time make simulation of pipe networks possible, the repo is up at https://github.com/Roudenn/Nod3r
    Currently it only supports registration and addition/removal of nodes, plus the necessary types.
    This separate sim requires Numos chunks to be abstracted into a separate package in order to be finished, which ArtisticRoomba implied that this can happen for the 0.2.0 release

    @ArtisticRoomba can you please create the 0.2.0 milestone and move this issue here? Since old pipe networks from SS14 can be handled with simple GasMixtures, this can be handled later

  4. ArtisticRoomba commented on Sep 6, 2026

    @ArtisticRoomba
    OwnerAuthor

    This issue is required for v0.1.0 release, the action of switching over Numos' chunking and pipenet handling (not sim) would be after v0.2.0 is entered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ParityItem would bring the sim up to parity with another simulation.Scope: CoreSimItems related to the core simulation.enhancementNew feature or request

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions