Eketek's Routing and Pathfinding Mod

by Eketek

Components to generate routing and pathfinding signals

Content
5 years ago
0.16 - 0.17
9
Circuit network
Owner:
Eketek
Source:
N/A
Homepage:
https://forums.factorio.com/viewtopic...
License:
MIT
Created:
6 years ago
Latest Version:
1.0.3 (5 years ago)
Factorio version:
0.16 - 0.17
Downloaded by:
9 users

This mod adds a set of combinator-like machines which can be linked up and used to generate circuit network signals which are suitable for routing items across a corresponding network of belts, trains, and inserters.

The routing system supports routing of arbitrary or abstract resources (all signals other than the ones the mod adds are intended to be processable by the routing system). It supports complex network topologies (loops and one-way paths). It performs multi-source, multi-sink routing (items can be buffered anywhere and sent anywhere). It includes path cost (both general and per-item). It attempts to alleviate congestion by routing large requests across multiple paths. If there is a shortage of an item, it uses a weighted distribution.

Usage
The routing system mostly uses pulsed signals. These should be captured and stored in accumulators. I recommend using a decider with the "each >0 each" configuration.

The routing system is defined by a set of nodes and links forming a directed graph and controlled by the very creatively titled "Controller" machine:

Controller - Routing system interface
Route Item - Sending a +1 signal for a resource causes the routing system to process the specified resource and schedule item transfers along all generated paths.
Cancel Item - Sending a -1 signal for a resource causes the routing system to send a cancel signal for the specified resource (-2,000,000,000)
Change configuration - various pulsed signals to adjust the routing system behavior or performance tuning.

Node - Defines a reachable network location.
It outputs a continuous nodeID signal.
It accepts a continuous signal indicating what is either buffered and or requested at the node. Requests are negative values. Buffered items are positive values. It does not support a node which has both a requester and a provider for a particular resource, so if that's needed, you'll need to add another node and move the conflicting requester or provider away.
When a routing function is triggered, the node will generate a pulse indicating what was scheduled for pickup (positive) or receipt (negative) at the node (this may be used to control filter inserters that move from the buffer to the network)

Link - Defines a one-way path from one node to an adjacent node.
It accepts two continuous ID signals. One ID is for the Source Node and the other is for the Destination node. the source node signal is just a nodeID copied over. The destination node signal is the nodeID of the destination converted into a "Link to Adjacent Node" signal. You have the option of either using wires to transfer these signals around or of *simply copying the appropriate ID signals into a connected constant combinator.
The link also accepts continuous path cost modifier signals. Per-resource path cost modifier is just a continuous signal for the resource input into the link machine. A general path cost modifier which applies to all resources is also available (added by the mod)
When a routing function is triggered, the link will generate a pulse indicating what was scheduled for transfer onto the link (this may be used to control filter inserters that move from the network to the link)

These machines alone are not sufficient. Combinator proficiency is required. Specifically, in typical usage, you need to feed supply and demand signals to the network components, extract and store transfer signals from it, use the transfer signals to control item movement, cancel or reduce the transfer signals as items are transferred, and [optionally] convert transfer signals into an appropriate path cost modifier.

(*) Direct circuit connections between components are technically not required. The Eketech Routing System is quite advanced. It isn't wireless, but Eketek also isn't going to say just how the data gets moved from place to place when no wires are put between.

The Motivation
This mod came about mostly as a result of prior attempts to implement routing strictly with vanilla components (repeatedly concluded that a massively overcomplicated blueprint might as well be a mod...). But, the motivation to go ahead and actually make a mod of it came from the recent "belts vs. bots" controversy - This is an implementation of my proposal, which involved making belts more usable, not by a simple buff, but by adding a path-finding mechanism, so as to bring them somewhat more in line with the capabilities of bots.