Difference between revisions of "User:Zamujasa/Mechanics"

From Space Station 13 Wiki
Jump to navigation Jump to search
Line 262: Line 262:




== Cyborg parts ==
== Cyborgs ==
oh no
 
Cyborg health display:
* Structural Integrity: ''total_brute_damage'' / ''total_max_hp''
* Circuitry Integrity: ''total_burn_damage'' / ''total_max_hp''
 
This can be very misleading, as readouts of "60%" and "50%" might ''look'' like half health, but in reality the actual damage is ''90%''!
 
Different parts also have different health pools. Damage is either targeted at a single part, or spread equally among all parts. If you have a Light Cyborg and hit it with 150 BRUTE damage in one tick (somehow):
 
* 150 damage ÷ 6 total parts = '''30''' damage per part
* Head: 50 → 20
* Chest: 75 → 45
* Left Arm: 25 &rarr; 0 (<span style="color: red;">Destroyed</span>)
* Right Arm: 25 &rarr; 0 (<span style="color: red;">Destroyed</span>)
* Left Leg: 25 &rarr; 0 (<span style="color: red;">Destroyed</span>)
* Right Leg: 25 &rarr; 0 (<span style="color: red;">Destroyed</span>)
 
There is no way to determine the individual remaining HP of a part beyond using a Cyborg Docking Station, with the sole exclusion of when that part hits 0 (because it ceases to exist).
 
 
=== Part stats ===
 
All of this is from the 2016 code, of course, and may be different.
 
{| class="wikitable"
|+ Cyborg parts
|-
! Part
! Type
! Max HP
! Notes
|-
! rowspan="5" | Head
| Light
| {{User:Zamujasa/T/NumberBar|50|max=350|bg=#ccc}}
| style="color: blue;" | Speed: +0.20
|-
| Antique
| {{User:Zamujasa/T/NumberBar|150|max=350|bg=#ccc}}
| style="color: blue;" | Speed: +0.20
|-
| Standard
| {{User:Zamujasa/T/NumberBar|175|max=350|bg=#999}}
|
|-
| Sturdy
| {{User:Zamujasa/T/NumberBar|225|max=350|bg=#666}}
| style="color: red;" | Penalty: +0.50
|-
| Heavy
| {{User:Zamujasa/T/NumberBar|350|max=350|bg=#333}}
| style="color: red;" | Penalty: +1.00
|-
! rowspan="2" | Chest
| Light
| {{User:Zamujasa/T/NumberBar|75|max=350|bg=#ccc}}
| style="color: blue;" | Speed: +0.20
|-
| Standard
| {{User:Zamujasa/T/NumberBar|250|max=350|bg=#999}}
|
|-
! rowspan="4" | Arms
| Light
| {{User:Zamujasa/T/NumberBar|25|max=350|bg=#ccc}}
| style="color: blue;" | Speed: +0.20
|-
| Standard
| {{User:Zamujasa/T/NumberBar|60|max=350|bg=#999}}
|
|-
| Sturdy
| {{User:Zamujasa/T/NumberBar|100|max=350|bg=#666}}
| style="color: red;" | Penalty: +0.50
|-
| Heavy
| {{User:Zamujasa/T/NumberBar|175|max=350|bg=#333}}
| style="color: red;" | Penalty: +1.00
|-
! rowspan="3" | Legs
| Light
| {{User:Zamujasa/T/NumberBar|25|max=350|bg=#ccc}}
| style="color: blue;" | Speed: +0.20
|-
| Standard
| {{User:Zamujasa/T/NumberBar|60|max=350|bg=#999}}
|
|-
| Tread
| {{User:Zamujasa/T/NumberBar|100|max=350|bg=#666}}
| Speed: +0.25 (and see below)
|}
 
Special notes for treads:
* Increases power drain by 2.5 units per tick, each
* If at least one tread is equipped, reduces ''penalty'' by &frac23; (~67%)
 
When determining a Cyborg's movement delay:
# If oiled, reduce ''delay'' by 0.5
# For each leg, if that leg is missing, increase ''delay'' by 2.5
#* If the corresponding arm is ''also'' missing, increase ''delay'' by a further 1.0
# Sum the ''penalty'' of all parts
# If at least one tread is installed, divide ''penalty'' by 3
# Add ''penalty'' to ''delay''
# Subtract total ''speed'' from ''delay''
# If the speed upgrade is equipped and active:
#* Reduce ''delay'' by 2.5 for each installed leg/tread part
 
Functionally:
* ''Light'' and round-start cyborgs will have a maximum HP of 225 and a +1.0 ''speed'' bonus
* Full ''Heavy'' Cyborgs will have a maximum HP of 1,150, a total ''penalty'' of 1, and a +0.5 ''speed'' bonus

Revision as of 21:38, 21 March 2019

Mostly based off the 2016 release since I'm not a coder.


Power

SMES units

Maximum capacity of 100,000,000 W (100 MW). Maximum input and output rates of 200,000 W (200 KW).

Charging

  • Charges using the terminal-side interface only.
  • Won't charge at all if input > available.
  • Won't use extra power if availableinput.

Discharging

  • Discharges using the cable-side interface only.
  • Will output exactly how much power is specified in output, even if not needed.
  • Attempts to reclaim unused power after discharging.
    • Basically, if it outputs 100,000 W but only 60,000 W is used, will try to remove 40,000 W and add it back to its storage.
    • Some notes on the wiki here suggest that this is kinda fucked up and can result in power dissipating into the void???
    • "Order" of SMES units is vaguely important. If two are outputting 100 KW (200 KW total) but only 150 KW is being used, only one of the SMES units will 'reclaim' that power.
  • The amount of power being actively used is shown as the "load". You can intentionally lower the output to spread the load across multiple units.

If you can figure out the priority of the SMES units, you can set them up like this, assuming a 70 KW average load with occasional telescience nerds:

  • Unit 1: Output 40,000 W
  • Unit 2: Output 40,000 W
  • Unit 3: Output 200,000 W

Assuming that all three SMES units are charging at 200 KW and the priority is right, unit 3 will stay fully charged most of the time but will handle excess load, while the former two stay fully powered indefinitely.

Not much of a reason to do this unless you like micromanaging things or ensuring that a loss of power doesn't cripple things.

APCs

Those little squares that regulate power for a room.

For automatic settings:

  • Equipment: Turns off at < 15% power (probably). Usually stuff like doors, computers.
  • Lighting: Turns off at < 30% power (probably). It's the lights.
  • Environment: Turns off when there's no power at all. Not a lot of things use this, though.
    • Fire alarms
    • Pipes
    • Power gloves (possibly)

Power gloves are weird because the code seems to check if you're on a powered/connected wire (as expected) but then chooses to use 50,000 W Environmental from the local APC and disregards the power in the wire completely. This may have been changed since the 2016 release since otherwise it makes hotwiring the engine kinda pointless.

The powernet keeps track of how many APCs are attached to it as numapc, and how much power is available to each (avail ÷ numapc = perapc).

When an APC draws or gives power to a cell, the amount (W) is multiplied by CELLRATE (0.002). The 2016 comments suggest this is supposed to be 2%, but 0.002 is 0.2%.)

Operation

APC operation is a little complex:

  1. If we have no cell at all, turn everything off and stop. Otherwise...
  2. Calculate power usage ((Equipment + Lighting + Environment) W) as usage.
  3. Draw usage from the cell.
  4. If there is excess power in the powernet, or perapc > usage ...
    • Restore perapc to the cell.
    • Add perapc to the powernet load.
  5. Otherwise, if (cell charge + perapcusage) ...
    • Restore perapc to the cell.
    • Add perapc to the powernet load.
  6. Otherwise, turn everything off.
  7. Auto-set options based on cell charge level.

Or in layman's terms:

  1. Remove usage from the APC's cell.
  2. Is the per-APC power allocation (perapc) higher than what we're using (usage)?
    • Yes: Draw that amount from the pnet and restore the perapc to the cell. (Basically: Cell doesn't discharge.)
    • No: Draw (usage - perapc) from the cell, and remove perapc from the powernet.

After determining if the area is powered, check if the cell should charge:

  1. If the cell is charging...
    • If there's excess in the powernet...
      1. Find whichever is lowest of the remaining capacity of the cell, perapc, or the cell's max capacity × CHARGELEVEL (0.001). The 2016 code comments suggest that 0.001 here is supposed to be 1%, but 0.001 = 0.1%. ?????
      2. Draw that amount from the pnet.
      3. Add that amount to the cell.
    • Otherwise, stop charging.
  2. Otherwise, if the cell is full, stop charging.
  3. Otherwise...
    • If the excess power > (the cell's max capacity × CHARGELEVEL), start the charge counter.
    • Otherwise, reset the counter.
    • If the charge counter is at 10, start charging and reset the counter.

In layman's terms:

  • If there's enough power to charge the cell...
    • If we're already charging, charge the cell more.
    • Otherwise, wait 10 ticks, and then start charging.
  • Otherwise, stop charging.

Power cells

Come in a few varieties:

  • 2,500: Standard APC cells.
  • 4,000: AI shell cells.
  • 7,500: Higher-capacity cells. Round-start Cyborgs and the AI start with these.
  • 15,000: Standard regular power cells, found all over the station. Comes in two special flavors:
    • Cerenkite: Recharges 2 per tick.
    • Erebite: Violently explodes if you look at it funny. Otherwise, charges 10 per tick.
  • Artifact cells can be anywhere from (15 ≤ x ≤ 1000) × 100, i.e. 1500 to 100,000. They always charge 50 per tick.


As noted above in the APC section, for the purposes of charging and discharging in APCs, the capacity is effectively divided by CELLRATE, 0.002 (i.e. multiplied by 500):

  • 2,500: 1,250,000 W capacity
  • 4,000: 2,000,000 W capacity
  • 7,500: 3,750,000 W capacity
  • 15,000: 7,500,000 W capacity
  • Artifact cells can range from 750,000 W to 50,000,000 W (!) and recharge 25,000 W per tick.
    • Putting one of these in an APC will power pretty much everything indefinitely except for the Telescience portal.


Given that an SMES unit stores 100,000,000 W, these little batteries aren't too shabby.

Power usage across the station

Eventually, the amount of power used by various components will be here.

Fun facts about power sinks, based on the 2016 code:

  • Can drain 200,000,000 W before exploding; basically, two full SMES units.
  • Drains up to 400,000 W from powernet per tick.
  • If powernet has < 400,000 W, starts draining up to 50 charge from APCs per tick until it reaches the limit.
    • This seems to be in cell units, not funny-watts like above.
    • A side effect of this is that the power sink will eat 25,000 W from a cell, but consider it as having eaten only 50.
    • It also considers any drain from an APC cell to be 50 units, even if the APC cell had less, though this doesn't matter as much since the effect APCs have on the limit is minimal.
  • At 190,000,000 W (95%), the power sink will start making some horrible noises. If you hear those, you should probably run.

If you're dealing with a power sink, dump an additional 400 KW into the grid above what you normally would, and the power sink should stop draining APCs — you'll lose a lot less power this way due to the above!

I should ask a coder if any of this has changed since, welp


Lights

Power usage

Power usage of a light: light.brightness × LIGHTING_POWER_FACTOR (40)

Type Brightness Power Use
Light tube 1.6 64 W
Light bulb 1.2 48 W
Emergency light 1.0 40 W
"Exit sign" (unused?) 1.3 52 W
Runway Lights 0.5 20 W
Tripod Light 1.5 60 W
Desk and lava lamp 1.0 40 W

Colors

General manufacturers can make replacement light tubes and bulbs in varying colors. Some pre-made light fixtures have different, unique lights, generally darker and crappier for ambience.

All replacement lights look the same and are only differentiated by their name, except for blacklights, which have a unique name. Maybe someone could patch making lights actually look like the color they generate! Maybe you!

Light tubes
Type Color
Regular
Red
Yellow
Green
Cyan
Blue
Purple
Blacklight1
Blacklight2
Light bulbs
Type Color
Regular
Red
Yellow
Green
Cyan
Blue
Purple
Blacklight1
Blacklight2
Emergency
Other
Type Color
Big bulbs

Notes:

  1. Due to a bug, this is what happens in the 2016 code. Specifically, due to a typo, color_r is assigned to twice, and color_b is left default.
  2. This is assumedly what it should be if the second color_r is changed to color_b.

This chart might actually be a little misleading, as the way light usually works in this game is that colors are subtracted from full-brightness, so e.g. a white light wouldn't remove any, while a red light would remove all blue and green coloring, rather than adding red everywhere.


Cyborgs

Cyborg health display:

  • Structural Integrity: total_brute_damage / total_max_hp
  • Circuitry Integrity: total_burn_damage / total_max_hp

This can be very misleading, as readouts of "60%" and "50%" might look like half health, but in reality the actual damage is 90%!

Different parts also have different health pools. Damage is either targeted at a single part, or spread equally among all parts. If you have a Light Cyborg and hit it with 150 BRUTE damage in one tick (somehow):

  • 150 damage ÷ 6 total parts = 30 damage per part
  • Head: 50 → 20
  • Chest: 75 → 45
  • Left Arm: 25 → 0 (Destroyed)
  • Right Arm: 25 → 0 (Destroyed)
  • Left Leg: 25 → 0 (Destroyed)
  • Right Leg: 25 → 0 (Destroyed)

There is no way to determine the individual remaining HP of a part beyond using a Cyborg Docking Station, with the sole exclusion of when that part hits 0 (because it ceases to exist).


Part stats

All of this is from the 2016 code, of course, and may be different.

Cyborg parts
Part Type Max HP Notes
Head Light
50
Speed: +0.20
Antique
150
Speed: +0.20
Standard
175
Sturdy
225
Penalty: +0.50
Heavy
350
Penalty: +1.00
Chest Light
75
Speed: +0.20
Standard
250
Arms Light
25
Speed: +0.20
Standard
60
Sturdy
100
Penalty: +0.50
Heavy
175
Penalty: +1.00
Legs Light
25
Speed: +0.20
Standard
60
Tread
100
Speed: +0.25 (and see below)

Special notes for treads:

  • Increases power drain by 2.5 units per tick, each
  • If at least one tread is equipped, reduces penalty by ⅔ (~67%)

When determining a Cyborg's movement delay:

  1. If oiled, reduce delay by 0.5
  2. For each leg, if that leg is missing, increase delay by 2.5
    • If the corresponding arm is also missing, increase delay by a further 1.0
  3. Sum the penalty of all parts
  4. If at least one tread is installed, divide penalty by 3
  5. Add penalty to delay
  6. Subtract total speed from delay
  7. If the speed upgrade is equipped and active:
    • Reduce delay by 2.5 for each installed leg/tread part

Functionally:

  • Light and round-start cyborgs will have a maximum HP of 225 and a +1.0 speed bonus
  • Full Heavy Cyborgs will have a maximum HP of 1,150, a total penalty of 1, and a +0.5 speed bonus