Skip to content

Instantly share code, notes, and snippets.

@Tsunder
Forked from ignomen/POWER.md
Last active October 15, 2023 00:17
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tsunder/22ab87a3d8679ca24ff9f089d8921838 to your computer and use it in GitHub Desktop.
Save Tsunder/22ab87a3d8679ca24ff9f089d8921838 to your computer and use it in GitHub Desktop.
POWER or: How I Learned to Stop Worrying and Love the Reactor

POWER or: How I Learned to Stop Worrying and Love the Reactor

This is a beginner and intermediate guide to powering subs.

The information in this guide is up to date as of July 2021.

This guide is a work in progress. There will be sections that are incomplete.

BASIC GUIDE

1. Vocabulary
2. The Very Basics
3. Overloading and undervolting
4. Batteries
5. Pumps and engines
6. Basic wiring techniques
7. Example basic power grids

INTERMEDIATE GUIDE

8. Battery buffers and load balancing
9. Signals and logic
10. Relays!
11. Intermediate wiring techniques
12. Example intermediate power grids
13. Hands-on with the reactor
14. Reactor controllers

BASIC GUIDE

The way power works in Barotrauma is very different from how power works in the real world.

1. Vocabulary

To start, I'll provide you some key vocabulary terms. Use this section as a reference.

Some of the terms presented in this guide are my own, and I use them throughout the guide.

Not all of the terms in the guide are shown here, but each is formatted as inline code to make scanning and understanding the guide a little easier.

A full glossary will be available at the end of the guide at some point.

Without further ado:

power source -- Power in Barotrauma comes (directly or indirectly) from a power source, typically a reactor.

power grid --The different elements that convey or use that power make up the power grid. There can be more than one power grid, each with more than one power source, and grids can be broken or otherwise modified in-game.

Junction boxes -- serve to extend the power grid beyond the reactor. They are chained together, one by one, and can diverge, or even loop (in certain circumstances). We’ll cover more on wiring practices later.

Load -- The power demand of the grid is called Load and the power that is being supplied is simply called Power. You can see this when you look at junction boxes or the reactor in game.

The individual items on the grid, be they junction boxes, machines, or other pieces, make up nodes. They all communicate with the power source via wire connection.

Of nodes, those that need power to perform some job are endpoints. As the name suggests, endpoints occur at the ends of the power grid. Examples could include engines, lamps, or pumps among others.

2. The Very Basics

For the BASIC GUIDE, we’ll assume our power source is a reactor. Our reactor has fuel, it is on, and it’s been set to automatic control. We’ll cover reactors in detail toward the end of the guide.

Power does not flow in Barotrauma as would electricity in a real world electrical circuit. In fact, it doesn't flow at all.

So what does power do? It talks.

It may help you to see the grid as a telephone network:

The power source talks to every node in the grid. It wants to know how much power all of the endpoints need, and it also tells the nodes how much power it is giving the grid to satisfy that need. Nodes, then, also talk to the power source.

Power in Barotrauma is just an information exchange. It is a constant conversation between the nodes in the power grid.

When the grid is broken, perhaps because a wire is disconnected or a junction box goes down, everything after the break is no longer able to communicate with the power source, and ceases to be a part of the grid until the problem is remedied.

3. Overloading and undervolting

Junction boxes can be overloaded. Overloading occurs when there is significantly more Power than Load on the grid.

By default, overloading occurs at two times Power over Load. For example, if the grid demands 1000 KW of power but it’s receiving 2000 KW of power, every junction box on the grid will begin to overload. Overloading will rapidly damage junction boxes and may cause them to combust.

Endpoints can be undervolted. Undervolting occurs when the grid has less Power than Load.

Endpoints have a field for minimum voltage. By default, most have a minimum voltage of 0.5, meaning they expect Power to be at least fifty percent of Load. Pumps have a default minimum voltage of 0.3, so expect Power to be at least thirty percent of Load.

When the grid is undervolted, each endpoint compares the Power and Load of the grid to its minimum voltage. If minimum voltage is not met, the endpoint generally stops working. Some machines continue to operate when undervolted, but less effectively. An example would be fabricators, which operate at reduced speed. Another example would be engines, which output less thrust.

Each undervolted endpoint checks if there’s at least enough Power across the whole grid to meet its own minimum voltage requirement--the endpoints do not compete for Power; Power is a single shared value.

Note that when undervolted an endpoint does not stop demanding power, as once the grid supplies enough power to meet the minimum voltage requirement, the endpoint will turn back on.

For example, assume we have three endpoints and each has a minimum voltage of 0.5, or fifty percent. Two endpoints demand 500 KWs each and the third demands 10 KW (for a total 1010 KW Load), but the grid only supplies 500 KW. The grid is undervolted, and 500 KW Power is less than fifty percent of 1010 KW Load. None of the endpoints would have sufficient power to operate. If the grid supplies 600 KW Power, the grid is still undervolted, but all three endpoints would have sufficient power because 600 KW is more than fifty percent of Load.

In another example, we have two endpoints. The first demands 1000 KW and has a minimum voltage of 0.2, or twenty percent. The second demands 1000 KW and has a minimum voltage of 0.5, or fifty percent. Load is therefore 2000 KW. When Power is at least 400 KW, the first endpoint will be powered, and at 1000 KW the second will be powered as well.

4. Batteries

Batteries both demand power and supply it; in this sense they are endpoints and they are power sources. Batteries straddle the line between two power grids--a battery demands power from one grid, and it supplies power to a second grid.

The nodes on the supply grid do not communicate with and are not aware of the nodes on the demand grid, and vice versa. Only the battery is aware of both, but the battery communicates with both grids separately.

@jvriesem
Copy link

jvriesem commented Mar 2, 2022

This is excellent! I'd love to hear more about this. This is the low-level info I need!

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