Smart gas vents, open/close with approximate derivative of external pressure #35489
+42
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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