Dock

### General Overview

A **Dock or Docking Port** is a block whose function is to connect a ship to another ship or to interact with a station.

### Ship to Station Docking

#### Docking at AI Stations

To be able to interact with a station, you have to be "docked" at this station. For a ship to be able to dock at a station it has to be equipped with docking ports. They always come with docking lane that have lights that look like a landing strip, so they are normally easy to find when close to a station. If your ship is close enough to the lane, you can active the stations tractor beams (Default [F]) to let yourself be pulled towards the dock until you are docked. This is normally slower than just flying towards the dock, but activating the tractor beam kills your velocity, so it can save you from crashing into the station. Alternatively, the transporter upgrade and transporter block can be used to avoid this docking procedure.

#### Docks on your own Stations

When interacting with owned stations one does not need to be docked, but can instead just fly as close as 0,3 km and interact with the station like any other owned ship. When editing a owned station, the number of docks can be seen in the stats. An owned station always needs at least one dock to be able to interact with NPC traffic and other players.

The dock creates a docking lane that is 60 units wide, regardless of the dock's size. The hitbox of the lane is effectively a 60 x 60 wide volume that goes out to about 440 units from the face of the dock. Geometry, or another docking lane, may touch this invisible 60 x 60 volume without invalidating the dock so long as it is not within it. The dock may also have geometry (such as armor plating or a vanity cover) up to, but not equal to, 1.5 units on top of the face of the dock, and also may be flush with geometry.

When first built, the dock will clear its docking lane of any objects that are within its 60 x 60 x 440 volume, including asteroids and wreckages.

Before version 2.0, the owned stations required a minimum of 2 docks. If there are less then docks will be spawned at the farthermost point from the center of mass.

The maximum of docks a station may have is 4, any additional docks will not be recognized as docking ports. Furthermore, NPCs and owned, automated ships will use those docks to trade with your stations.

Materials do not appear to have an effect on the dock's tractor beam strength, and while in station mode the tractor beam strength is the same regardless of the dock's volume.

### Ship to Ship Docking

Since the release of the Black Market DLC (Avorion version 2.0) it is possible to use the docking block on ships, which unlocks a lot of new options.

#### The Basics of Docking

The dock makes it possible to "merge" two objects together. These objects may be asteroids, containers, ships, or wreckages. The dock is only needed on the "parent" ship in order for objects to dock to it.

Objects docked to the parent ship can be moved and rotated by the parent ship, and the docked object's mass will affect the parent's speed and handling. Should the docked objects have engines or thrusters, they will not be used to "assist" in movement, but they can still use their turrets.

The dock has a hitbox with a size 20 x 20 x 40 units that is 1.5 units away from the face of the dock which is used to detect dockable objects. Anything outside of this hitbox is not detected. Should any geometry of the parent ship touch or be within this hitbox, the dock will be invalid and can not be used to dock to anything.

To actually dock to an object, you need to get close enough to the thing you want to dock so that a part of it is within the aforementioned hitbox. Then, activate the dock's tractor beams (Mouse steering: [C]; Keyboard steering: [Y]) and the object will be pulled towards the dock until it is docked to the ship. It can afterwards be released by pressing [C]/[Y] again, or [CTRL]+[C]/[Y] to undock all docked objects.

The strength of the tractor beams is determined by the dock's size. The larger the dock, the stronger are the tractor beams and the faster the object will be pulled towards the ship.

#### Advanced Docking

The amount of objects docked together is not limited, however objects cannot be chained together (such as ship1 to ship2 to ship3). If you wish to dock more than 2 objects together, everything be must docked to a single parent or root ship/station.

The dock pulls the object to be docked (asteroid, container, ship, wreckage, etc.) at the object's center of mass and pulls it towards the center of the dock block. Once geometry of the object touches the dock the object will snap into an orientation so that the block face touching the dock will be parallel to the dock's face, regardless of how much mass the docked object has or where the center of mass is. Note: The object ***will not*** dock together should geometry hit the ship anywhere other than the dock block and may bounce off in an unpredictable direction.

## Station to Station Docking

Docking stations together is also possible as of 2.0, and the docking rules are the same as with Ship to Ship docking: Some part of the "child" station to be docked must be within the 20 x 20 x 40 hitbox of the dock of the "parent" station in order for the dock to be able to see the child station. With that in mind, it is possible to make a "tow line" of any block (including framework) that the parent station can use to start the docking processes when the child station is much further away.

There are two caveats to keep in mind when doing station-to-station docking:

1. All ships must be in transport mode when docking. Stations in Station mode cannot dock to objects nor can other stations dock to them. They will also push any object (including stations you're trying to dock) far away from the dock making unnecessary frustration.
2. You can not chain stations together via docking. There can only be one parent station, but there may be multiple child stations.

#### Tips

* Since the dock pulls on the center of mass of objects, you should "balance" the child station so that its center of mass is in-line with the desired docking face. Heavy blocks (such as stone) placed far away from the center of mass moves the center of mass easily.
* Child stations do not need to have a dock block docked with the parent's dock to work.
* Save yourself the headache and do most of the pre-positioning with a suitable ship to act as a tug.
* The docking surface of the child can be a large flat blank hull to make docking easy. Not pretty, but easy.