Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
The system for connectable tilemap objects.
For technical documentation on this system use the link below.
Connectables are a sub-system of Tilemaps which use adjacency connection scripts to replace models depending on the status of neighboring tiles.
This works by using several differently shaped models and replacing them depending on any adjacent tiles with the same type of connectable (see the Tilemap document for more details).
Different types of connectables have different ways they allow or don’t allow connections.
As a result, we use several unique mathematical scripts known as “adjacency connectors” to handle the connection logistics.
Types of connectables are manually defined by an ID known as a “generic type” (ex. wall, table, wire, cable, etc.). When properly assigned, this ID makes sure different types of connectables properly connect to themselves but not other types of connectables.
In addition to generic types, some connectables may even have a “specific type” ID. The specific type is used to distinguish different variants of the same type of connectable. The best example is having multiple material-based table variants (wood & metal), the specific type could be used to prevent connections between different variant types while maintaining connections between the same variant types.
It should also be noted that objects will only connect if they are connected to the tilemap, removing them from the tilemap will disconnect any connections to it. Some objects can be bolted to / unbolted from the tilemap (tables, girders, sofa, etc.), while others also have ways to be attached / detached to the tilemap.
Basic connections use the “Basic Adjacency Connector” script and are ultimately the simplest connection type.
These basic shapes are defined below:
O - A variant with no connections.
U - A variant with 1 connection, to the north.
I - A variant with 2 connections opposite of each other, 1 to the north and 1 to the south.
L - A variant with 2 connections adjacent to each other, 1 to the north, and 1 to the east.
T - A variant shaped like a “T”, with 3 connections, 1 to the south, east, and west.
X - A variant shaped like a “+”, with 4 connections, 1 to the north, east, south, & west.
These pieces can be rotated to create many various shapes. This works fine for objects that do not have corner connections (pipes, cables, etc.), but this won’t suffice for objects that do (tables, walls, etc.) because it will leave gaps where the corners meet.
Cables
These heavy-duty high-voltage cables are only used between station engines and related machinery.
Two “I” shapes can cross each other while maintaining separate circuits; they do not have a junction box like the similar “X” shape.
Though similar to wires, wires are more complex (see the “Wire Adjacency Connection” section for more details).
Conveyor Belts
Currently, these do not use a “T” or “X” shape so we can either add those or resolve how a straight piece may connect in such a situation as seen in the image (these may need to get their own unique adjacency connector in the future).
HE Pipes
Heat Exchange Pipes don’t require an “O” shape.
They do however have an special “I” shaped called a “Junction” which connects between the HE pipes and regular pipes on the 4th layer (see the pipe adjacency connections section for more info).
Counter connections use the “Counter Adjacency Connector” script. This script is very similar to the basic adjacency connections but has a couple of unique shapes that are specific to counters. The basic shapes “O”, “U”, “I”, “L”, “T”, and “X” are all the same from the basic connector. The unique counter shapes are defined below:
U2 - A “U” type variant that is shortened. The reason for this is it can be used to connect Counters to Walls.
Door - A special “I” type variant that can be rotated to allow it to open.
Door Frame - A special “I” type variant that is used with the Door variant (on the same tile).
Disposal connections use the “Disposal Adjacency Connector” script. Disposal connections are based on the basic connections and are similar to the other pipe connections. The disposal models themselves actually reside beneath the floor that the player walks on.
There is no need for the traditional “O” or “U” shapes but there are some unique “U” type shapes (see below). The “I” and “L” shapes act the same as they do in the basic connections.
The “T” shape acts the same in principle as well but is accompanied by arrow overlays. Due to the nature of disposals (objects travel through them), “T” shapes have a designated ‘exit’ connection side to determine which direction the object paths join into. This direction is represented by the arrow overlays (more info in the disposals documentation).
There isn’t a significant need for the “X” shape either but we do have one modeled and in theory the same directional arrows could be made for it to work the same as the “T” shape.
The unique disposal shapes are defined below:
Vertical - A special “U” type variant which connects to the north as well as turning upward and connects vertically to above-ground disposal machines. Pipes & wires cannot exist on a tile with a vertical disposal due to major clipping.
Vertical pipes only connect to pipes directly in front of them.
Broken - A special “U” type variant which replaces a variant when it gets abruptly destroyed (more about this below).
When a disposal pipe variant gets destroyed, instead of alerting nearby connections that there is no longer a connection at this location and to update their own shape as a result; we maintain connections to this tile and replace it with 1 broken variant per undestroyed connection.
Another interesting trait about disposals is that they can overlap each other in one specific situation.
This works easily in 2D but in 3D we do not have the additional space to actually have one disposal pipe go beneath the other.
Because we don’t have the extra space in 3D, our plan, as goofy as it may look, is to simply resort to allowing the disposal pipes to overlap and clip through each other in this specific situation.
You’ll notice the difference between the overlapping pipes and a true junction is that the overlapping pipes are missing the support rings near the intersection. (Alternatively we could design a new model for this overlap).
Airlock connections use the "Airlock Adjacency Connector" script. Airlocks are a (special) type of wall and thus connect to all types of walls and other airlocks based on requirements.
Airlocks connect to walls on either SIDE of them. Airlocks ignore connections in the front, back, and corners. If both sides ARE connected, the airlock becomes operational. If a wall on either side is destroyed or severely damaged, the airlock stops being operational.
Door frames are a required component when an airlock connects to a wall. Sometimes referred to as "wall caps". It is a small piece of wall that covers the connecting "gap" of the wall because the airlock does not have the same dimensions as the gap to cover it itself.
Door frames themselves come in different material types based on the types of walls. The type of door frame used is dependent on the wall type it is connecting (metal door frame for metal walls, wood door frame for wood walls, etc.).
This sub-section may not be final.
Door caps are similar to that of door frames because they also are meant to fill the gaps left by doors. Door caps fill the gap between the top of the door, and the ceiling.
Door caps will likely be based on the connected wall type (not sure how to decide what type if the 2 airlocks on either side are different types) or airlock type. While some special airlock types may not require a door cap.
The example above is a static option but some people are not fond of it because it blocks the view of the airlock itself a bit and if you are a player and you open the door and stand in the open doorway, the door cap will obscure you or items behind it. One way to prevent this would be to use a cutout-shader on walls and also door caps, but another way is to simply make a retractable door cap like the example below. The difficulty here is making something to blend with the wall type and the airlock.
This section may not be final.
Same as when connecting to walls, airlocks can only connect to other airlocks at their sides. This means that you must ensure both airlocks are rotated correctly for them to connect. Additionally, airlocks can only connect if they are the same base type.
Actually, airlocks don't "connect" to each other per se, rather once these conditions are met, they instead join as one object (in-game this will require the user to weld two airlock frames together to construct). They become a multi-tile airlock, and because of this are limited to 2-3 airlocks "connected" at time (based on airlock type).
Airlocks because of their nature of being doors between different rooms, may be bridging two rooms with different floor tiles. Due to this, it is hard to determine what floor tile a airlock should have beneath the airlock itself.
To resolve this we use a special floor tile for airlocks. It consists of two half tiles split with a metal track that the airlock slides on. The half tiles will use the texture based on the adjacent floor tile to blend the floors together at the doorway.
The only issue with this is that certain textures will break (wont tile properly) if you rotate the floor tile due to its custom UV. To prevent this we actually will use 2 airlock floors tiles, 1 for airlocks facing east/west and 1 for airlocks facing north/south.
Advanced connections use the “Advanced Adjacency Connector” script. They are a direct extension to the ‘basic connections’, intended to solve the issue of gaps where the corners meet. This works by using the same shapes as the ‘basic connections’ in addition to some new variants for all shapes with possible corner connections (“L”, “T”, and “X”). These advanced corner shapes are defined below:
L2 - An “L” type variant with a connection in its corner, to the north east.
T2 - A “T” type variant with a connection in its southwest corner.
T3 - A “T” type variant with a connection in its southeast corner.
T4 - A “T” type variant with a connection in both corners, southeast and southwest.
X2 - An “X” type variant with a connection in its north east corner.
X3 - An “X” type variant with 2 adjacent corner connections, 1 north east and 1 north west.
X4 - An “X” type variant with 2 opposite corner connections, 1 north east and 1 south west.
X5 - An “X” type variant with 3 corner connections, north east, north west, and south west.
X6 - An “X” type variant with a connection in all 4 corners.
Plenum covers are part of the same prefab as the plenums. They cover the plenums and connect them together.
Carpets are a great example of a type of floor tile that can be stylized and designed to be connectable.
Carpets come in a variety of colors, all of which can connect to create some creative patterns.
Other floor types that may possibly connect are lava, grass, dirt, etc.
Tables are the iconic connectable that everyone loves from SS13. The ability to build an infinite number of possible shapes of tables is a truly satisfying feeling.
Tables also come in a variety of material-based types (wood, metal, etc.) and use unique specific types to prevent connections between these different material-based types.
Girders are basically unfinished walls so it seems fitting their generic type would be “wall” (see the ‘Walls & Windows’ section below for more details).
Girders come in a variety of material-based types similar to the tables, but unlike the tables, different girder types CAN connect to each other.
Walls and windows are very similar to girders, which makes sense as they are all “wall” by generic type. All 3 can have additional components (supports, struts, sheets, etc.) overlapping the primary model to give the effect of adding/removing parts via construction (more info can be found in the construction documentation).
In most cases, these additional components will inherit the same adjacency connector as the primary model (advanced) due to the fact that most of the components are the same complexity or simpler.
One notable exception would be the ”window dividers” component. This component is a bit more complex in order to get window dividers to connect properly (see the Window Divider Adjacency Connections for more details).
Another exception is the “door frames” component. This component bridges the gap between walls and airlocks, smoothing the transition and giving the appearance of something for the airlock to reside within (see the Airlock Tile Adjacency Connections for more details).
Disposal furnitures don't change meshes when they connect to a disposal pipe, however, they should signal to disposal pipe just below them, when they have a single connection, that they need to update and become a vertical pipe.
Upon removal, they should signal to the disposal pipe that they can update their mesh to an horizontal one.
As the name implies, window divider connections are specific to creating seamless windows and use the “Window Divider Adjacency Connector”.
The window divider adjacency connector is not meant to be used with the window models themselves, it is meant to be used with the “window dividers” component that overlays the windows. The reason for this is explained when we look at the sheer number of possible connection variations a single window tile can have. Initially there may not seem like many, but it becomes apparent when looking at the more complex shapes (“T” & “X”).
After carefully considering all possibilities, we reduced the total number of possible variations by counting any corner connection as a wall (regardless if it is a wall or window) if at least one of its adjacent connections is a wall (these specific corners are marked with purple in the image linked below). Next we discarded any shapes that would be a duplicate of another shape when rotated. After these reductions we are still left with ~170 possible connection variations between our metal walls and windows. This would also mean that there would be another ~170 possible models for EACH type of window (window, reinforced window, plasma window, etc.).
Using separated components, we are able to use just 23 window divider models with the 15 window models (using the advanced adjacency connector). Reinforced windows can use the same dividers, so they simply only require 15 models themselves. Adding a new exotic type of window (ex. gold) would require 15 gold window models as well as 23 gold window dividers for a total of 38 models, far less than 170.
The wall dividers are named based on how many sides they overlay. They are defined below:
A - A variant that overlays 0 sides but does overlay 1 corner (NE).
B1 - Overlays 1 side (N), both edges are flat.
B2 - Overlays 1 side (N), both edges are angled.
B3 - Overlays 1 side (N), both edges are full.
B4 - Overlays 1 side (N), left edge is flat & right edge is angled.
B5 - Overlays 1 side (N), left edge is angled & right edge is flat.
B6 - Overlays 1 side (N), left edge is flat & right edge is full.
B7 - Overlays 1 side (N), left edge is full & right edge is flat.
B8 - Overlays 1 side (N), left edge is angled & right edge is full.
B9 - Overlays 1 side (N), left edge is full & right edge is angled.
C1 - Overlays 2 sides (N & E) and their joining corners, both edges are flat.
C2 - Overlays 2 sides (N & E) and their joining corners, both edges are angled.
C3 - Overlays 2 sides (N & E) and their joining corners, both edges are full.
C4 - Overlays 2 sides (N & E) and their joining corners, left edge is flat & right edge is angled.
C5 - Overlays 2 sides (N & E) and their joining corners, left edge is angled & right edge is flat.
C6 - Overlays 2 sides (N & E) and their joining corners, left edge is flat & right edge is full.
C7 - Overlays 2 sides (N & E) and their joining corners, left edge is full & right edge is flat.
C8 - Overlays 2 sides (N & E) and their joining corners, left edge is angled & right edge is full.
C9 - Overlays 2 sides (N & E) and their joining corners, left edge is full & right edge is angled.
D1 - Overlays 3 sides (W, N, & E) and their joining corners, both edges are flat.
D2 - Overlays 3 sides (W, N, & E) and their joining corners, both edges are angled.
D3 - Overlays 3 sides (W, N, & E) and their joining corners, both edges are full.
D4 - Overlays 3 sides (W, N, & E) and their joining corners, left edge is angled & right edge is full.
D5 - Overlays 3 sides (W, N, & E) and their joining corners, left edge is full & right edge is angled.
E - Overlays all sides (N, E, S, & W) and all corners except SE.
The window dividers could be made even even more modular but work on this has been put on hold while we further discuss quartering tilemap tiles.
Directional connections use the “Directional Adjacency Connector” script. Directional connectables, unlike most connectables, have a distinct front side and back side (ex. modular seats). They can be manually rotated in the editor and game due to this directional nature. Their default rotations are set to ‘north’. These directional shapes are defined below:
O - A variant with no connections.
Lin - An “L” type variant which, according to its design, bends inward.
Lout - An “L” type variant which, according to its design, bends outward.
I - A variant shaped like an “I” but rotated 90°, with 2 connections, 1 to the east and 1 to the west.
Uright - A variant shaped like a “U” but rotated so the only connection is to the east.
Uleft - A variant shaped like a “U” but rotated so the only connection is to the west.
Chapel Pews are the basic version of directional connectables as they do not have any corner (“L” shaped) pieces, in theory they could be added though.
The Diner Booth is an example of a more typical use of a directional connectable for modular seating as they include corner (“L” shaped) pieces.
The Sofa is very similar to the Diner Booth, but it’s also a good example of adding style variants.
Style variants are simply a variant with an alternate art style. The Sofa’s example is the addition of armrests.
The armrests by their nature are only required on the end shapes of the sofa (“Uleft” and “Uright”) and on the singular sofa shape (“O”).
Other examples of directional connectables that are not fully realized yet may include things like railings and fences...
Directionals can't connect to more than two neighbors. Once they are connected, putting any new directionals near them won't update them, unless a neighbor is disconnected.
When removing a neighbor, a connection is free, and the directional will look for other adjacent directional to form an eventual second connection and change shape.
When a directional has to change shape and has multiple options (LIn, LOut, I), the directional will choose shape in the following order:
I shape
Lin shape
Lout shape
This order is arbitrary, but it's necessary to define one as some cases are not well defined without it.
The edges are pretty self explanatory, “flat” are used on flat walls, “angled” are used on corner windows, “full” are used to extend the divider to the next tile (basically no edge).
Pipe connections use the “Pipe Adjacency Connector” script. Pipe connections are based on the basic connections and are also similar to the disposal connections.
Pipes have 4 layers, the first 3 layers reside in the plenum below the floor with the disposals, while the final layer rests just above the floor.
You’ll quickly notice that pipe layers 2 & 4 are centered, while layers 1 & 3 are offset. Due to the offset nature of layers 1 & 3 they require additional model shapes and use a more complex connector script (see the “Offset Pipe Adjacency Connections” section below).
Pipe Layers 2 & 4 work just like basic connections (“U”, “I”, “L”, “T”, and “X”) with one exception. This exception is defined below:
Broken - A special “U” type variant which replaces a variant when it gets abruptly destroyed.
Similar to disposals, 2 “I” shaped pipes can cross each other perpendicularly. Although they are clipping through each other, they are not joined like an “X” shape.
Unlike disposals, pipes have another overlapping property. 2 “L” shaped pipes can coexist on the same tile as long as they are oriented opposite of each other. (In SS13 the pipes clip in this situation but we designed our models to prevent clipping here.)
Offset pipe connections use the “Offset Pipe Adjacency Connector” script. Offset pipe connections are based on the regular pipe connections and exist on pipe layers 1 & 3.
The primary difference between the pipe and offset pipe connections is what the name implies, the offset pipes are offset. Due to them being offset, they cannot simply be rotated for different orientations. To solve this, we use additional models for the different orientations. These offset shapes are defined below:
U1 - A “U” type variant which connects to the north OR west (rotate 90°).
U2 - A “U” type variant which connects to the south OR east (rotate 90°).
Broken1 - A special “U” type variant which connects to the north OR west (rotate 90°).
Broken2 - A special “U” type variant which connects to the south OR east (rotate 90°).
I - A regular “I” type variant which connects to the north and south OR east and west (rotate 90°).
L1 - A “L” type variant which connects to the north and east (not meant to be rotated).
L2 - A “L” type variant which connects to the north and west (not meant to be rotated).
L3 - A “L” type variant which connects to the south and east (not meant to be rotated).
L4 - A “L” type variant which connects to the south and west (not meant to be rotated).
T1 - A “T” type variant which connects to the south, east, and west (not meant to be rotated).
T2 - A “T” type variant which connects to the north, east, and west (not meant to be rotated).
T3 - A “T” type variant which connects to the north, west, and south (not meant to be rotated).
T4 - A “T” type variant which connects to the north, east, and south (not meant to be rotated).
X - A regular “X” type variant which connects to all 4 cardinal directions (not meant to be rotated).
What's also to be considered:
Pipe Machinery Adjacency Connections
Transit Tube Adjacency Connections
Wire connections use the “Wire Adjacency Connector” script and, like the name implies, are unique to just wires. Wire connections are some of the most unique types of connectables. Wire connections can have several variants on a single tile, can cross over each other, and even have diagonal variants.
The “O”, “U1”, “I1”, and “L1” shapes here are the same as the basic connectables but the rest are unique and defined below:
U2 - An odd “U” type variant which has its connection to the northeast instead of to the north.
Broken1 - A special “U” type variant. Simply a broken version of “U1”.
Broken2 - A special “U” type variant. Simply a broken version of “U2”.
V - An odd variant which has 2 connections, at adjacent corners, by default the northeast and northwest respectively.
I2 - An odd “I” type variant which has 2 connections at opposite corners, by default the northeast & southwest respectively.
L2 - An odd “L” type variant which has 2 connections, 1 to a side and 1 to an adjacent corner, by default the north and northeast respectively.
L3 - An odd “L” type variant which has 2 connections, 1 to a side and 1 to an adjacent corner, by default the north and northwest respectively.
L4 - An odd “L” type variant which has 2 connections, 1 to a side and 1 to an opposite corner, by default the north and southeast respectively.
L5 - An odd “L” type variant which has 2 connections, 1 to a side and 1 to an opposite corner, by default the north and southwest respectively.
Wire connections do not have “T” or “X” shapes, but instead they create these shapes by using multiple “L” shapes that are on the same tile that are rotated accordingly.
Wires can cross over each other similar to pipes, but wires can do so in many configurations.
A cross over is anywhere wires clip through each other in the middle of a tile. They are technically still isolated circuits until properly connected.
Properly connecting wires is done by having 2 (or more) wires connect at the same connection point. With 8 connection points (4 corners & 4 edges), there can be up to 7 wires connecting to the same point on a single tile.
Wires also come in a variety of color variants. Different colors can connect and cross, the only real issue with this is that the clipping of models is more noticeable when using multiple colors.
Wires, like pipes, can also be destroyed and will leave behind broken ends in any direction there is a connection.
The combination of wires’ unique properties allows for some really creative combinations which is infamously known as “wire art” in ss13 (the images below are great examples).