Pipes & Power - Sci-fi factory builder base-plate

After recently posting about a modular base-plate design I built as part of a factory game idea, I thought I’d dive a little deeper into the concept and execution. Here are some examples of the plates, their insides, and how they might be used:

Background

As a long-time fan of hard science fiction, I have always maintained that visual representations of machinery and systems in games should be both visually realistic, and functionally plausible. Many games make the choice to eschew accuracy in favor of various advantages such as simpler models, stylised appearance, or maybe they just don’t have the technical knowledge (or research time) in house. As an engineer (of various sorts) I always imagined I’d be a real stickler for technical detail, and so here I am trying to apply that to an idea for a game.

Base-plates will be the foundation (literally) of the game, and serve an important role as they are not just there to physically support the structures built on them, but also to form an infrastructure layer providing various services to all buildings by default. Often a factory game requires you to either a) route all required resources to a building, or b) ignores some of them altogether. For me, it seems that the base essentials would be as follows:

  • Energy - powering the physical function of each building (electricity)
  • Water - used in many processes, or at least for washing away waste
  • Cooling - often overlooked, but actually essential if your factory is in space
  • Waste removal - most operations have byproducts, which need removal
  • Comms - data network for coordination between buildings


(hot return, coolant supply, comms socket, power socket, water supply, and waste return)

By incorporating the supply (and extraction) of these within all base plates, it removes the headache of a lot of routing (leaving that to more interesting material distribution) and turns a base plate into a more exciting object to look at.

2 Likes

Requirements

A couple of spatial constraints I thought would useful to have for the base plates are:

  1. They should be square
  2. They should be of a single standard size across the factory
  3. Services run under the plate surface, within its structure
  4. They can be connected to other plates on all four sides
  5. Any side connection should connect all utility services
  6. Buildings connect to services via ports on the plates top surface
  7. A building can be placed in any of the four orientations on top
  8. Service provider buildings can only be placed one way round (concession)

To support buildings of any orientation, it was necessary to expose top-side connection ports for all the service types in a rotationally symmetric pattern. This was decided to be around the perimiter of the plate, and by default to have blanking plates that serve to block up all unused ones. Power and comms are available in all corners, as are water and waste connection points, and smaller cooling pairs (cold out, hot return) are doubled up and available as two sets on each side. The sizes of all ports are a rough reflection of the flow rate each service would need in various use cases, vs the quantity of connections. The large pairs of ports towards the centre of the plate are for high volume access needed by the buildings responsible for providing water, cooling and waste disposal and meeting the reuquirements of many buildings across the neighbouring plates.

To achieve this layout, a lot of people would just box up the model so you couldn’t see inside and call it a day, leaving the internals to our imagination. I wanted to actually try and build this with all the actual internal interconnections that would be needed to make it work for real. This ended up being quite a task and not without some complexity. Fortunately, a combination of procedural systems and careful hand routing got us there.

1 Like

Structure

To house all the pipework and wires, a painted metal structure was built up progressively, with some parts added as required.

This is composed using a combination of explicit spatial sub-dividision, repeated patterns, and linearly arrayed parts, each built up from various fundamental element types (box section, girders, angles, and flats). I already had a bunch of procedures for these from previous factory experiments into beam construction and tank containerisation. A lick of paint and they served the purpose perfectly.

The main base plate procedure references two sub-procedures, the outer frame and the inner structure to build most of it. Some other minor parts were added in other places.

Here we can see a number of commonly used Frame operators such as: Split, Shrink, Offset, Reorient, being put to good use. These manipulate the Frame data type (the black wires) which represents a box in 3D space (size + orientation + position) and used for a lot of spatial setup in my procedures. Some of these then reference iterative procedures to place rows of elements, e.g. the vertical supports across and along the plate.

1 Like

Pipes

The main distribution pipe network needed to run pretty straight across the plates both horizontally and vertically. By connecting these up over a number of plates, a distribution grid is formed. This will (theoretically) help ease the flow of liquids around and spread out the load as various buildings supply and demand resources.

Each of the four service types need to criss-cross the plate, which naturally causes some overlaps. This is avoided by routing the pipes up and down since we have allowed enough thickness for two pipes to pass vertically. The primary pipes (across) all just have a little lift at both ends to carry them across above everything else (this also allows them to provide the main building access ports).

The secondaries (vertical) need to run along the underside, popping up to meet their counterpart as they pass.

I already had procedures for straight pipes and bends, but felt that this use case warranted a special type which I referred to as ‘wiggle’. This is basically a straight section, but with an optional offset segment. You can set the position and start stop points as parameters.

UnrealEditor_ojKu28ieIo_2

This, as a lot of the pipe procedures, is a combination of Frame operations and re-use of simpler compnents (e.g. a straight and an offset pipe kink).

The gate valves at the perimiter are important to the functionality of the plate because the pipework needs to be connected to adjacent plates and the buildings attached without depressurising the rest of the circuits and leaking liquids. After everything is ready, the connected sides can have their valves opened (via the hex drive points in the floor) and the feeds too and from the building start to flow. Any unconnected sides remain closed, and could optionally be capped (to prevent contamination).

Next, the most compicated part of the plumbing was getting all the corner ports connected up. This was the messiest because each connection required a custom route from the main cross feeds of the right type. The combination of the main feeds being at unique offsets across the plate combined with the four rotations of the sets of ports meant they had nothing in common.

As I had at this point already added cross-bracing structural elements (rather fit the pipes to the structure than the other way round), and so I decided a new approach was needed. This is where the programmable pipe came in. This was based around the idea that pipes needed to move through the plate in some ‘general direction’ but occasionally move to one side to avoid something, and also sometimes change fundamental direction. So, driven by a configuration text parameter, you can just type in the offsets you want, how long they are, and any special moves (e.g. turn left/right/up/down, or add a bolted flange). Here you can see the procedure and parameters for one of the pipes:

There is a step size of 0.5m and eight different XY offsets added in this case (it’s a fairly long pipe), running from the top port (image lower right) to the main feed, through the other side and all the way along to another top port (image left). Rather than build two, it was easier to do both as one and intersect the larger pipe.

The pipe programming sequence used here reads as:

aUb0.75ccdLF0.4F1.8e3e5ff3Ua0.2La0.6g0.4Dh0.2R

This series of code letters is parsed in a procedure and turned into a series of pipe segment types:

  • ‘a’-‘z’ selects the offset to use for a step
  • ‘U’, ‘D’, ‘L’, or ‘R’ turns a 90 degree corner elbow (and resets the offset)
  • ‘F’ adds a bolted flange step
  • A number modifies the size of the previous step (multiplier)
  • Repeated letters can be used to stretch the transition for a smoother deviation

Whilst a bit cryptic, these ‘instructions’ allowed for easy authoring and experimenting with all sorts of wiggly pipe routing nicely around the plate.

1 Like

Wiring

With a bit of experience working with electrical power distribution I wanted all the electrical power and communications wiring to be equally believable too. I also decided to draw the line at the contents of actual junction boxes, leaving some elements of mystery to the viewer :slight_smile:
As each plate is effectively a four way junction of services, a central junction box made sense, and having left a space for it and access along the four major centrelines of the plate, next came the box and cable trays.

Cable trays are typically used in industrial settings to keep all cable (and some pipework) neat and tidy, free from movement, and provide some level of protection. The cable tray procedure is positioned using various Frame operations and outputs a frame for the space within them. This is fed into a number of wire layout procedures.

image

The wiring didn’t need the flexibility of the programmable pipework, instead these mostly consisted of a straight segment along the cable tray with spline based free ends that could be connected to any point needed, the box at the central end and the plug/socket at the outer end.

The main distribution feeds are larger, individual conductors, following the three-phase standard of red, yellow, and blue phases and a black neutral return (Note: I think in some parts these colours have been retired in favour of more colour-blind friendly alternatives). The comms feeds and wiring to the building connectors in the corners are composite multicore cables and don’t need individual conductors. The plate top-side connections needed to be routed out to one side and then split off to the two corners of that side.

Each branch of the wiring loom was a separate instance of a couple of modular procedures, each parameterised and re-used for any slight differences (e.g. orientation, plug, socket, etc). Here we can see the procedure that brings them all together, four power branches, four comms branches, and the central box.

All this together provides the ‘nervous system’ of the base plate.

As for the actual plate-to-plate connection interfacing, much like the pipe valves/flanges, I wanted nice (chunky) connectors for the electrics too. The power lines needed very hefty copper connections, and the comms some sort of overkill multiway plug/socket combo. After much procedural modelling I arrived at these monsters.

Each is on a pivot to swing back as they have protective cover plates (for when not connected) which are removed when the connectors are swung into place and secured with the bolts visible in the centre of each power plate and corners of the comms connector. The connectors are all generated down to the hundreds of tiny plug sockets and pins. :smile:

Connections

Each plate is parameterised by which sides it is connected on. This is so that unconnected (visible) sides are presented nicely (closed valves, and retracted connectors), whilst connected (partially obscured) sides have unneccessary geometry removed and the connecters mated.

PlateConn1

When they are joined, the plate connectors align nicely to give the impression of a securely attached plug/socket assembly. The pipes similarly have corresponding bolts and nuts to secure them together.

All that was left was to add a rugged top surface in the form of industrial checkerplate, with the appropriate holes cut out to reveal all the pipe and electrical connection points, and version 1 of the base plate is done :slight_smile:

1 Like

Addendum

One of the advantages of generating content procedurally at run-time is you can parameterise by various fidelity constraints. In the case of this plate, I decided that you should be able to see it in various stages of ‘construction’, and also adjust the detail level so the quantity of geometry generated could be dialed down.

This required a number of changes throughout many of the procedures, with switches and calculations driving many internal values that were previously fixed. This was implemented as a control ‘structure’ (a list of several parameters) that combined the needed information into a single connection that could be passed through the many procedures more easily. Here for example, the shape being extruded for a flange plate is being switched between a solid disc and one with centre bore and bolt holes.

Another good example of this is the number of segments on a curved edge or surface. Here, where various standard design parameters are being calculated, the fidelity control is being used to calculate the maximum number of steps a pipe can have round it’s circumference (also based on the pipe diameter in this case).

Here is this in effect, with wireframe view to help see the triangle counts.

detail levels

Some aspects of the base plate I haven’t included that may be nice to add in the future are:

  1. Mountings and supports - the pipes aren’t actually connected to the plate structure securely
  2. Insulation - some of the services should probably be lagged with insulation really
  3. Attachments - there aren’t bolt holes or similar for the bulidings to secure to the plate

This will be plenty of detail for now though and I shall be moving on to other areas of the game prototype, possibly; other plate elements like ramps and gantries, some of the buildings themselves.

This has been a bit of an epic post, but hopefully has provided a bit of insight into; Apparance, procedural generation approaches, this factory concept, and to some extent how my brain works. :smiley:

2 Likes

Placement

I managed to find time to try out some basic placement blueprints. Along with a screw-pile for them to mount on it makes for quite a convincing structure to build on :slight_smile:


(click for longer YouTube version)