Suggested Pipe Module

jellysnake

New Member
Contributor
Architecture
GUI
This is a simple pipe module that would allow for transfer of items from one place to another without player intervention.

Purpose:
Having a way to transfer items from one block to another is a crucial part of most automation and tech playstyles. It allows for feasible tech modules to be added opening a new section of additions.

Structure:
General
The overall structure of the module would be to use an abstracted graph to represent the pipes. Each physical pipe block wouldn't do anything apart from indicate to alter the graph representation in some way, ie add a new node, lengthen this connection etc etc. Each node would be either an endpoint or a special pipe type, ie a sorting pipe or a t-junction.
This has the advantage of allowing physically large networks with small connections to be easily added as well as being able to use graph theory for optimised methods like a* for searching.

There would then be a second abstraction that would handle the visuals of an item moving and would also contain nodes for anything other than a straight line. (Ie corner bends etc). This allows for easier showing of the item moving through the pipes as it only ever moves in straight lines.

Terasology
Components
The two major components would be the PipeComponent and the PipeGraph components.
The former would represent the actual pipe block and would /data on the pipe's type, neighbouring inventories and similar.
The PipeGraph would contain the graph representation of the network. It would be used for both the visual and functional graphs. This would store the nodes, connections and the info needed to construct the graph.

Systems
There would only be one main system to control it. This system would handle adding/removing pipes to the network and hence nodes to the graph, transporting an item through the network and other needed tasks.

Events
The main events fired would be adding an item to the network, adding a pipe to the graph, changing the network, item being ejected from the network and events related to the individual pipes (eg, item sorted etc etc)

Extending
The majority of extending would relate to adding new pipe types. This would be as easy as creating a new PipeComponent and adding it to an entity. The system could also be extended to allow for more methods of interfacing with inventories and other inventory systems. The system should automatically be compatible with any module that has a block containing an inventory. This makes it very usable with almost every module
 
Top