Satisfactory Splitter Calculator

A tool to help calculate how to split conveyors in Satisfactory into specific ratios.

Dependencies

Python 3.9

PyYAML

Python Graphviz (Note: Requires actual Graphviz, more details on pypi.)

Usage

Run `conveyor_nodes.py` with a YAML file as the first argument.

`python conveyor_nodes.py my_yaml.yaml`

or just drag and drop the YAML onto `conveyor_nodes.py` so that it “Opens With” the python file.

YAML File

The YAML File is broken into multiple parts, broken up by `---`. The first is the config section, that holds the options available to change how the program will calculate and show its output.

The second section is where you put what it is going to do. There are currently only three things that can go in here.

```Calculate: output_filename    # This tell it to calculate the values in the next section and output to output_filename.
Save Nodes: Yes    # If Calculate is present, will additionally save to output_filename.yaml all the nodes used for the output.
Graph: output_filename    # This will try reloading nodes from the next section. Automatically set in file created by Save Nodes.```

The third / last section is the ratio input. If you would like to just evenly split a belt into N outputs:

`- N    # Where N is the desired amount of outputs. N should be an integer or it will fail.`

Otherwise, put in how much to give to each output and put floats / decimals in as fractions or mixed numbers.

```# Example of 3:5
- 3
- 5

# Example of a fraction (3/5):
- - 3
- 5

# Example of mixed number (7 5/9):
- - 7
- 5
- 9

# Can also be used to get N outputs showing value X, example 5 of 12:
- 12
- 12
- 12
- 12
- 12```

Can also be a JSON if it follows the sections being elements in a list, and it’s filename ends with `.json`

Output

Output is done with a Graphviz Digraph. From each node, there is an arrow pointing to where it goes. The arrow should be labeled, but it may be hard on some outputs to associate a number with a node. When graphing, nodes are displayed in a few different ways depending on what it represents.

By Default, the house and inverted houses are Inputs and Output respectively. Diamonds are for splitters while diamonds with lines inside are smart splitters set to send everything down some belt amount with overflow for the rest. Squares are mergers. Currently, a chain of mergers will be condensed into a single merger, but I may change/fix that in the future.

Some examples:

It is likely still not perfect and I recommend checking that it makes sense. Mainly the sum of the inputs match the sum of the outputs and that the inputs and outputs are what you expect.