Submarine Editor

You can help the Barotrauma Wiki by updating it.

* Notes: Needs to be up to date with the current steam version.

The **Submarine Editor** is a modding tool that can be used to expand the core game by creating your own submarines, wrecks and outposts (NEW!). The custom creations can be shared in the Steam Workshop. The submarine editor is included within the main game and is accessible from the main menu under "Customize". At the moment the editor is only available in English. The process of building a fully playable submarine or functional monster can be quite involved and, unfortunately, in-game tutorials or documentation are not available yet. Aside from this Wiki, you may be able to find help through the following links:

FakeFish guide to the Submarine Editor

Barotrauma Discord Server

Barotrauma Forums

## Basics

In Barotrauma a submarine is constructed from rectangular Hulls, designating areas that are inside the submarine. Water will not "spawn" inside of Hulls. The next step is to surround the Hull with structural objects to give collision surfaces to walk on and stop water from entering the Hull. Usually a submarine is made up of multiple Hulls separated by internal walls and floors, with doors and hatches to travel between them, and the ensemble of Hulls enclosed by Shell structures.

From this bare minimum watertight structure, there are several vital systems required for a fully functional submarine.

### Power

*See also: Nuclear Reactor*
Almost all submarine systems require power. Currently the only power source available to submarines is the Nuclear Reactor, fed by Fuel Rods which must be manually loaded into the reactor. The resulting output power can be wired to other systems, usually via Junction Boxes

### Oxygen

*See also: Oxygen Generator*
While the Hulls are empty of water, they are not automatically full of air. To prevent suffocation within the submarine, an oxygen generator must be powered and connected to an immediately accessible vent. Vents must be connected directly to the oxygen generator by links. Vents linked to other vents will not transfer air or water as of v0.10.6.2 therefore they must be connected to an oxygen generator to work properly.

### Navigation

*See also: Navigation Terminal*
Submarine movement is controlled by the Navigation Terminal, and achieved by two separate components: the Engine and Ballast Pumps. The engine is required for movement in the x direction (horizontally), while ballast is required for movement in the y direction (vertically).

### Docking Port

*See also: Docking Port*
A Docking Port is required for submarines to dock at outposts.

### Spawnpoints

*See also: Spawnpoint*
At least one character Spawnpoint is required for a submarine to be useable.

## Interface

The buttons on the top part of the editor interface, from left to right, are Back, Open..., Save, Test, Toggle visibility, Previously used, (The name of your edit), Add submarine, Edit mode, Wiring mode, Generate waypoints, and Info.

At the top left, there is a panel listing the number of Items, Structures, Walls, Lights, and Shadow-casting lights in your edit. These numbers provide a general metric for the complexity of your file. The numbers will turn from green to red as they reach a level with significant (anticipated) performance impact.

Along the bottom is the Entity Menu, which can be toggled open and closed with the arrow button at the top of the menu. This is where you will find the components to create your edit. You can filter components using the textbox in the center of the Entity Menu and by selecting a category on the right. From left to right the categories are All, Structure, Decorative, Machine, Equipment, Electrical, Material, Misc, Alien, Wrecked, Thalamus, ItemAssembly, and Legacy.

After selecting an object, clicking in the editor window will place the object. Right clicking will cancel object placement. Clicking the name of an object will select it for placement.

Adjustment of an object's position can be done by clicking and dragging the object. A finer degree of movement can be accomplished by selecting the object and using the arrow keys. Additionally, holding shift will ignore the grid when placing an object using the mouse.

### Top Toolbar

#### Back

This button opens a dialogue box asking "Are you sure you want to return to the main menu? All your unsaved progress will be lost," with the options of "Yes" and "Cancel". Selecting yes will bring you back to the main menu, cancel will keep you in the submarine editor.

#### Open...

This button opens the load menu, with the options to "Delete", "Load Autosave", "Cancel", and "Load" a selected file, with a textbox to search the list of available files. The available files are broken into "Submarine", "Outpost" (although this may be empty), "Outpost Module", and "Wreck". The files are all ".sub" files and are located at "...\Barotrauma\Submarines", "...\Barotrauma\Content\Map\Outposts", and "...\Barotrauma\Content\Map\Wrecks" respectively. Once a file is selected, it can be deleted to be removed from the game, or loaded into the editor to be edited. This is different from "Add Submarine".

#### Save

This button opens the save menu, with text fields "Name" and "Description", a dropdown menu for "Submarine type", the settings "Shuttle" and "Hide in menus", and the "Required content packages". The save menu also has a "Preview Image" which can be automatically generated using the "Create" button or can be picked from your files using the "Browse..." button. Finally, the save menu has "Cancel" and "Save" buttons, which cancel or confirm your save respectively.

##### Submarine Type

With the submarine type "Submarine" selected, the "Price", "Class", "Recommended crew size" and "Recommended crew experience" characteristics appear. Everything is determined by you except the price, which is automatically calculated by the editor itself (but you can still set the price manually if you are so inclined).

With the submarine type "Outpost module" selected, the "Module type", "Allow attaching to", "Location types", "Gap positions", "Maximum count", and "Commonness" characteristics appear. These options allow you to define what type of module you have created, the types of other modules it may be connected to, which types of campaign map locations this module can be generated in, where the gaps in the hull of the module are (defining where other modules connect to this one), how many instances of this module can be generated at one outpost, and how likely this module is to be found in an outpost.

With the submarine type "Outpost" or "Wreck" selected, you have no additional characteristics to edit.

Regardless of submarine type selected, your file will be saved to "...\Barotrauma\Submarines" as a ".sub" file.

#### Test

This button allows you to test your edit by spawning you and 2 crewmates into the .sub file in an otherwise empty ocean. If there are no spawnpoints present in your edit, you will receive an error message. Simply type "spawnpoint" into the filter textbox in the Entity Menu, click on the Spawnpoint, and place it within your edit. You will spawn as a Captain with standard spawn gear, so make sure to put the spawnpoint in a safe location.

#### Toggle Visibility

This button opens a menu to allow you to choose which types of entities are visible in the editor. The options from top to bottom are "Lighting", "Walls", "Structures", "Items", "Waypoints", "Spawnpoints", "Links", "Hulls", "Gaps", and "Thalamus". This button can be useful when trying to fine tune different aspects of your edit, without disturbing other layers.

#### Previously Used

This button opens a small window which shows the history of previously placed objects.

#### History

This button opens a drop-down menu which shows the edits you have made and allows you to jump back to specific edits. The history is cleared when exiting the editor.

#### Add Submarine

This button adds another submarine into the current submarine file. This button is NOT equivalent to "Open...Load" as the added submarine is non-editable and will simply appear as a green outline with a cross at the added file's origin. This tool can be used for adding things such as smaller vessels, escape pods, or detachable sections into your current edit. For example, if you open the Kastrull submarine file, you will see the Kastrull's Drone at the bottom right of the editor as a green outline. The drone is attached to the Kastrull by clicking on the Kastrull's bottom docking hatch and then holding space while clicking on the green cross of the drone. You can test the success of this addition using the "Test" button. The Kastrull spawns with its drone attached. Note that this combination requires docking hatches oriented in a matching way, ie. a ship with only a top docking hatch cannot be connected to a ship with only a top docking hatch,a ship with a horizontal hatch cannot be connected to a ship with a vertical one, etc.

#### Edit Mode

This button puts the editor into "Edit Mode" (default mode). In this mode you can spawn and delete items. You can open/interact with items by pressing "E" or right-clicking the item and selecting "Open". More on this mode in the Editor Tools section.

#### Wiring Mode

This button puts the editor into "Wiring Mode". In this mode you gain a new menu on the left which contains every color of wire available in the game as well as an inventory where you have a screwdriver equipped. This mode allows you to wire power and signals between devices in your edit. More on this mode in the Editor Tools section.

#### Generate Waypoints

This button will generate waypoints for AI navigation around the submarine based upon the layout of hulls, gaps, doors, hatches, and ladders. If you want your ship to be compatible for playing with bots you should double-check your waypoints after they have been generated. Every point on the ship you want the AI to access should be within character's reach of a waypoint. Connect waypoints by left-clicking on a waypoint, holding space, and then left-clicking the waypoint you want to connect it to. Pay special attention to the waypoints outside of the ship, as the auto-generated waypoints tend to intersect with the collision boxes of the railguns and coilguns, as well as being dangerously close to the propeller.

#### Info

This button displays the information about the submarine and character editors. Hopefully someday in the future this will contain official documentation and tutorials.

## Editor Tools

### Edit Mode

In edit mode, the user can spawn and delete entities using the Entity Menu. Items can be selected and placed in containers by holding the item over the container, holding shift, then releasing the item once the desired container is highlighted. Additionally, containers and appropriate items can be opened by mousing over them and pressing "E" or right-clicking them and selecting "Open". Once the inventory of the container is open, items can be selected from the Entity Menu and placed in inventory slots. Individual items can be placed by clicking once, multiple items can be placed by clicking and dragging over the inventory slots. This is especially useful when filling items with the same item multiple times, such as with shotguns, harpoon guns, and revolvers.

### Entity Menu

The entity menu contains almost every item that can be found in the game. They are organized into different categories that can be selected via buttons in the top right corner of the menu. Users may filter items in the selected category by using the 'Filter' textbox on top of the menu.

##### All

The 'All' category displays items from all categories.

##### Structure

The 'Structure' category contains walls, fins and some decorative elements specific to a submarine's hull.

##### Decorative

'Decorative' items include background walls, signs and decorations.

##### Machine

The 'Machine' category contains functional devices.

##### Equipment

'Equipment' are items that can be carried, handled and/or equipped by characters.

##### Electrical

Items that relate to storing and distributing power and signals are found in the 'Electrical' category. This includes batteries, wires, lamps and logic components.

##### Material

The 'Material' category contains items used primarily in crafting.

##### Misc

The 'Misc' category contains items that don't fit into any other category.

##### Alien

The 'Alien' category is for items specific to the alien ruins.

##### Wrecked

The wrecked versions of items are in the 'Wrecked' category.

##### Thalamus

The 'Thalamus' is a special category comprised of items related to the Thalamus creature.

##### ItemAssembly

Multi-item assemblies saved in the editor are found under 'ItemAssembly'.

##### Legacy

The 'Legacy' category contains legacy items that aren't officially supported, but remain in the editor to preserve compatibility with older creations.

#### Linking

Links are used to associate two objects together within your edit. To link one object to another, select either object, hold space, then select the other. To unlink two objects, select one of them and repeat the process.

If an object can be linked with another object, the details will be presented in yellow text in the Object Properties underneath the object name. The object properties will prompt you to "Hold space and click with the mouse to link to another item" and will then specify "Allowed links". Sometimes you will attempt a space-click to link 2 objects together which are not allowed to be linked and no link will appear, while other times the link will appear in red. If you believe 2 devices should be able to be linked but you are not seeing the link appear, you may not have Links visible under the "Toggle Visibility" menu. When 2 objects are successfully linked, the link appears green.

Examples of items that can be linked are vents to oxygen generators (a necessity), coilgun, railgun, and depth charge loaders to their respective weapons (also necessary), and containers to nearby fabricators or deconstructors or other containers. Linked objects have a special object property called "Display Side By Side When Linked". This can be useful when trying to see if you have the material to craft a certain item in a fabricator. When done successfully, the link should turn purple. However, this property can also result in inventory menus overlapping and can be frustrating in practice, so best not to go overboard and link 3 large cabinets together. A special case of linking is when a room in your edit is not defined by a single rectangle. This can be overcome by placing many hull objects, linking them, and then placing gap objects between the hull objects to create one large hull.

### Wiring Mode

*See also: Wiring*

In wiring mode, you gain a new menu on the left which contains every color of wire available in the game as well as an inventory where you have a screwdriver equipped. Clicking a wire from the menu will add it to the other hand of the player, allowing you to wire power and signals between devices in your edit. Wire nodes can be created by selecting an existing, placed wire with left-click, then "CTRL"+left-clicking on a straight portion of the wire. These nodes can then be dragged around the ship to make your wiring look neater (or worse, it's not a science). Right-clicking a wire node will delete it. Objects cannot be spawned or moved while in wiring mode. Unfortunately this includes very useful and commonly wire-dependent electrical components and sensors. Use "CTRL+1" to quickly switch to Edit Mode and "CTRL+2" to switch back. (More shortcuts in the Shortcuts section)

#### To (Re)wire a Device

Pressing "E" on a device in Wiring Mode allows you to rewire the device, opening up a new panel with various electrical input and output pins, depending on the device. When this panel is opened with a wire in your hand, the wire will appear on the panel. If not, you can click on the desired color of wire while the device wiring panel is open and the wire will appear on the panel. Click and drag the end of the wire to the desired pin to secure one end of the wire to the device. Right-click or press "ESC" to leave the device wiring panel. Now you can move to the device you want to connect the other end of the wire to, dragging the wire behind your cursor. Mouse over the desired device and again press "E". Again the wire in your hand will appear on the panel, drag the wire to the desired pin to secure the wire. When the wire pops into place, you will see a label generated beside the wire telling you the name of the device (and pin) the other end of the wire is connected to. To remove a wire from a pin, press "E" to bring up the wiring panel, then click and drag the end of the wire off of the undesired pin, but still on the panel. To remove the wire completely, drag the end of the wire off of the wiring panel.

### Object Properties

After an object has been placed, the user can select it and edit its properties. See items, and installations for more specific information.

## Submarine Design Considerations

### Flood Management

*See also: Maintenance#Flooding*
Hull breaches are an almost inevitable occurrence in gameplay. Submarines can be designed to help manage flooding and mitigate its damaging effects. By designing a submarine to have several compartments, flooding can be localized, limiting damage to the power grid and disturbances to submarine buoyancy. Doors can be specifically wired to close automatically, or to have their state linked to a signal from a water detector. Indicators warning of high water levels on the opposite side of a door can prevent accidental flooding as well.

#### Bilge Systems

There are a variety of ways to set up a bilge system, but they always require a pump connected to a power source. Except for large submarines, only one pump is usually required. Effective bilge systems usually have the following characteristics:

* The bilge pump will be located near the bottom of the submarine, where water naturally tends to accumulate.
* The power source for the bilge pump will be elevated above the pump. This keeps the pump working even as water accumulates.
* The bilge room is separated from neighboring rooms by doors, or can only be entered from above.

More advanced bilge systems may feature automated bilging, remote activation, connection to the ballast system and/or flood doors.

### Navigation

*See also: Connection Panels#Steering*
Navigation is usually done via a Navigation Terminal. The navigation terminal must be wired to send signals to the engine and ballast pumps to be effective.

#### Engines

Engines are used to adjust the horizontal acceleration of the submarine. Engine power requirements and effectiveness can be specifically modified by changing the engine properties.

#### Ballast Systems

Ballast systems are used to adjust the rate of descent/ascent of the submarine. Ballast systems generally involve two or more pumps, connected to a power source. A larger ballast room means the submarine can ascend or descend more quickly. If the ballast room is too small or if there is not enough pumping power, the submarine will respond slowly to vertical navigation instructions.

### Submarine weapons

*See also: Railgun*

There are four components to a properly functioning submarine weapon system: the turret, the controller, a loader, and at least one supercapacitor. The turret should be on the outside of the submarine, with its range of rotation appropriately set to limit the potential for accidental hull damage (this can be done through changing the object properties). The gun controller is attached to the ceiling and is wired to the railgun. Submarine weaponry is powered exclusively by supercapacitors (rail- and coilguns have very high power requirements, which only supercapacitors can deliver). Generally, only one supercapacitor is needed per turret. Supercapacitors usually receive their energy directly from the power grid and must be charged like batteries. Weapon loaders must be linked to the corresponding turret in the same way that vents are linked to the oxygen generator in order for the weapon to use ammunition and work.

### Hulls and Gaps

Hulls must be defined for every discrete space which can hold air or water in the submarine. If a space is not contained by the hull, the game will assume it is the outside ocean. The hull object is found under the "Structure" menu. The hull should be dragged to at least include the interior of a room and half of the space of the surrounding walls, floor, ceiling, and entryways (including doors and hatches).

Gaps connect hulls together and allow the game to determine how water and air should flow between rooms. Gaps should only be manually placed for cases where two hulls are adjacent to each other and will not be connected by a door or a hatch. Door and hatch gaps are automatically generated when a submarine is loaded into the editor, or at the start of gameplay.

### Power Grid

*See also: Nuclear Reactor*
Submarines are powered by at least one nuclear reactor, which must be connected indirectly to all of the powered objects within a submarine via junction boxes. If too much power flows through a junction box (or if the power delivered to a junction box far exceeds its load) for a sustained period of time, the box can blow a fuse or even explode and cause a fire. The power delivered by the reactor to all of the junction boxes it is immediately connected to is the amount required by the most energy demanding junction box. In general, power requirements for different paths in the grid should be about even, and the impact of power fluctuations when a machine becomes active or shuts down should be minimized.

#### Backup Power

*See also: Battery*
Batteries are a source of backup power. Backup power can be used to keep critical systems (such as the oxygen generator) going for a short time when the reactor shuts down or fails. Batteries also can be used to prevent power outages by absorbing excess energy from a junction box.