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

Smart gas vents, open/close with approximate derivative of external pressure #35489

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Quantum-cross
Copy link

@Quantum-cross Quantum-cross commented Feb 25, 2025

Add a virtual "internal valve" to the gas vents that open and close depending on the change in external pressure over time.

About the PR

Right now this is a super draft, just want to get some feedback.

Gas vents in this mode have a variable from 0.0 to 1.0 that represents how "open" the vent is from 0% to 100%, this can restrict the gas release flow. This value will get updated depending on the change of external pressure.

Additionally, the old lockout behavior would probably still be useful on shuttles and such where air is a super valuable commodity, as the strict lockout system is much more conservative.

Todo:

  • Clean up variable names, open/close distictions
  • Add air alarm UI to toggle "velocity based lockout" vs "static/strict lockout"
  • Ensure old mapped air alarms use the strict lockout behavior
  • Test minimum "open" value and measure how many mols get leaked compared to old lockout
  • Graph pressure values and "open" value over time for sanity checks
  • Test with larger room sizes (oasis junction)
  • add more todo items when I think of them

Why / Balance

I hate fixing depressurization when I'm atmos.

With power, when you fix it, the power comes back nearly immediately everywhere and everyone claps.

With atmos, when there is an issue, it takes so much time to fix it, and pressure needs to slowly equalize, and you have to literally click every single air alarm on the station until there's enough pressure to handle the drops via equalization when people open doors.

I feel like any time anyone gasps people beg to call for evac because atmos just cannot get pressure back fast enough.

Vents should be smart enough to detect if they are in vacuum or not...

Technical details

On every update, the gas vent will compare the external pressure with the last update, then the vent will "open" or "close" by an amount scaled to this difference (open if the pressure is increasing, close if the pressure is decreasing) and also scaled to an "acceleration" parameter. This acceleration parameter is currently multiplied by 10 for positive (opening) increases in order to minimize the effects of room pressure equalization ticks by the Monstermos system.

Media

smart-air-alarm.mp4

Requirements

Breaking changes

When it's finished I hope there won't be any breaking changes, I'd like to make it so that mapped air alarms default to the old behavior.

Changelog

TBD

… depending on the _change_ in external pressure over time.
@github-actions github-actions bot added size/S Denotes a PR that changes 10-99 lines. S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. labels Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. size/S Denotes a PR that changes 10-99 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant