Air alarm and firelock design

Posting here to compile design for air alarms and firelocks from Space Station 13 as well as improvements we want on that for our implementation.

I will be editing this post with the compiled discussion content from the posts below.

Space Station 13 Implementation:

Improvements:

firelocks should be removed i hate them grrr

Firelocks in /tg/

/// The door closed state
density = FALSE
///Tracks if the firelock is being held open by a crowbar. If so, we don't close until they walk away
var/being_held_open = FALSE
///Should the firelock ignore atmosphere when choosing to stay open/closed?
var/ignore_alarms = FALSE
///Type of alarm we're under. See code/defines/firealarm.dm for the list. This var being null means there is no alarm.
var/alarm_type = null
///Is this firelock active/closed?
var/active = FALSE
///The merger_id and merger_typecache variables are used to make rows of firelocks activate at the same time.
var/merger_id = "firelocks"
var/static/list/merger_typecache

///Overlay object for the warning lights. This and some plane settings allow the lights to glow in the dark.
var/mutable_appearance/warn_lights

///looping sound datum for our fire alarm siren.
var/datum/looping_sound/firealarm/soundloop
///Keeps track of if we're playing the alarm sound loop (as only one firelock per group should be). Used during power changes.
var/is_playing_alarm = FALSE
  • Auto names itself on startup based on the area it’s connected to.
  • Subscribes to power events to turn on and off the alarm sound.
  • Auto links into a group with adjacent firelocks so that alarm activations are synced.
  • Firelock examine text. It contains closed, opened, and bolted examines.
  • Interact
    • Hand interact
      • Does nothing if opened. Cannot be closed by hand (even with access)
      • If closed
        • Combat mode bashes the firelock
        • Else knocks on the firelock
    • Crowbar
      • After prying a door, as long as you’re adjacent to the firelock, it stays open. (on top of, adjacent, and diagonal when the adjacent is throw passable (e.g. Tables).)
        • Cancels when the player moves away, is no longer standing, or is deleted.
      • Right click opens/closes the door. If the alarm is active, the door will close again after 2 seconds.
    • Verbs
      • No tool:
        • Door closed:
          • AlienAdult or Silicon can open
          • Humans can knock or bash
          • Monkeys can attack
        • Door open:
          Silicons can close
      • Crowbar:
        • Close opened doors
        • Open closed doors
        • Open closed doors permanently with right click
    • AI and silicons can open/close firelocks. If the alarm is active, the door will close again after 2 seconds. - Aliens can only open firelocks. If the alarm is active, the door will close again after 2 seconds.
  • When activated:
    • Sets an active bool for auto closing.
    • Activates the area warning lights for the areas it’s connected to.
    • Sends an alarm event to the primary area. This goes to an area alarm manager which checks if this alarm was already set. If it was not set then it sends the alarm event to all interested entities.
      • The alarm event contains the fault triggering entity (this firelock) and the fault status (None, Manual (fire alarm pull), Automatic(firelock detection))
    • Plays a sound (Only on one of the firelocks in a group).
    • Shows lights on the firelock depending on the type.
      • Generic for fire alarm pull.
      • Hot for hotter than fire minimum temperature.
      • Cold for below human body cold damage threshold.
      • Lights are only shown when alarms are active, powered, and not ignore_alarms (Delay of 3 seconds after flipping fire alarm in an adjacent area off.).
  • Activates itself only when temperature is over the fire minimum temperature or below the human body cold damage threshold.
  • Processes activation when adjacent tiles send atmos calculated events and when turfs are changed or exposed.
  • When a fire alarm sends the all clear, crack open all connected firelocks and ignore_alarms for 3 seconds. Check for alarms afterward.
  • Doorjack emag opens door and sets emagged lights.
  • Closing firelocks will crush anything on the tiles that they’re closing on.
  • No bump/walk into to open.

I noticed that there’s no mention of the pressure difference detection that’s implemented in SS14. I want to share an important implementation detail that are sort of important in how we decide to handle this here.

  1. In the beginning we had “monstermos” instant spacing. As a result, the code that closes firelocks must be in monstermos, because otherwise by the time the update loop gets to checking firelocks, the whole station would have already been spaced.

  2. Either through crew members holding firelocks open or a bug, monstermos aggressively closes firelocks that could lead to spacing, leading to some extra doors being closed when they shouldn’t have been. This leads people to mistrust firelocks.

  3. Somebody PR’s temperature/pressure lights. As you will see in the existing code, they only function on already-closed doors.

  4. Somebody PR’s slow spacing.

So as you can see, the reason we have pressure/temperature lights implemented this way is because we’ve been layering thing on top of thing.

So an important takeaway is: the pressure/temperature different lights were only designed to work on doors already closed by monstermos. They never self-triggered based on the pressure difference in the firelock component, instead they were triggered by monstermos. And if we change them to actuate themselves based on pressure difference, that would break when instant spacing is turned on.

More testing in SS13. Air alarms will not activate if the power is out. Firelocks will keep the previous alert and if activated, auto-close even if the power is out.

Firelock lights will shut off, but the firelock will still auto-close.

So, turns out firelocks do everything from closing to opening, but only on temperature.

Air alarms are only alarms. They don’t actually control the firelocks.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.