Closed ForLoveOfCats closed 5 years ago
I split up liquid and power system discussions into separate issues #66 and #65
I've realized that having the system only have one output and have the inputs "push" the item is silly, instead there should be only one input and numerous outputs with the machines "sucking" items though both for gameplay and performance reasons.
This is an overview of what I plan for the pipe system both gameplay wise and implementation.
A pipe collection can have numerous inputs but only one output (same for each segment, for example a T-Pipe can have two inputs but only one output), each pipe segment knows which pipe is the output and how many pipe segments away it is from the output pipe. When an input is fed to a pipe it checks that the endpoint output and connected machine are both ready, gives it to the machine connected to the output, and sets a cooldown on the output based on the input's distance from the output. (This cooldown effects the whole collection as this is what was checked at the beginning when checking that the output is ready.)
Each pipe scene will have specific
Point3d
nodes designating the connection points, which are to be in the scene under a specificNode
for easily being grabbed during the pipe's_Ready
method. When a pipe is placed it will check adjacent grid spaces for pipes and see if any of their input connection points match up with the output connection point on the pipe being placed. If so the new pipe will set it's internal distance to be the connected old pipe's distance+1 and it's endpoint output is set to the same endpoint output as the old pipe.