-
Notifications
You must be signed in to change notification settings - Fork 0
Mod Overview
Logic Networks is a mod about programming advanced logic and logistics systems all within a graphical interface, similar to Unreal Engine blueprints or Blender (or Unity, or most other 3D software)'s shader editor. It aims to be a streamlined, centrally controlled alternative to popular logic mods such as Integrated Dynamics or XNet. Those mods (and others) absolutely have their strengths, but Logic Networks serves a different purpose.
Rather than simply serving as the go-between for connected machines and interfaces, Logic Networks serves more to manipulate signals passing through its programmable networks--not just A -> B
, but rather A + B -> arbitrary logic -> C
. As an example, massive redstone systems to decode binary digits for a 7-segment-display (with all the slowness of in-world redstone circuits) can be condensed and simplified to be entirely contained within a network, reading an integer input signal and outputting 7 different signals for the display--and doing it all in a single server tick.
Besides a few intermediary crafting components, the mod comprises of a few key blocks and items:
Main page: Network Anchor
These serve as the I/O for your network. Every network (that's connected to the world somehow) will have at least one entry point or exit point linked to an anchor. These are unique among analogous blocks from other mods (such as XNet's connectors) in a few ways, but the major difference that may take getting used to is an anchor doesn't really "belong" to a network in the sense that others might. Rather, an anchor stands on its own and can be referenced by any number of networks that use it, as long as the anchor is loaded. Further, each operation using an anchor only deals with one face of it; Linking Card define a direction used by the network.
By default, Network Anchors can interact with the world in a few ways:
- Read and write analog or boolean signals from/to any adjacent block or face
- Read and write any supported signal to a Network Cache for later use, either by the same network or a separate one
- Read the NBT data of any adjacent block
- Fetch Block Info of adjacent blocks
- Fetch any other data via nodes listed under Source Nodes with an anchor link input
Anchors have a GUI that shows when right-clicked, with a text box to edit the anchor's visual name, 6 tabs, and a linking card slot. The name is purely for your own organization; any linking cards you take out will have the same name as the anchor so you can tell what you're linking in your inventory and in the graph editor. The 6 tabs can be used to switch between faces, and you can extract a linking card pointing to whichever face is currently active. When initially opening the anchor GUI, the face that you right-clicked directly should be selected automatically.
Network anchors can be hidden within any solid (full cube shaped) block by right-clicking to add a facade; it will then adopt the shape and hitbox of the block used. The anchor itself will still render, so if you use glass or a similar block as a facade, you'll see a glass block with the anchor block within it. The facade can be removed by right-clicking with a wrench or shift-right-clicking with an empty hand.
Main page: Network Cache
These serve as persistent data storage for a network, allowing any signal that's defined as cache-writable to be read or written (see Signals for a list). A network cache contains one single slot for data of each type; that is, if a redstone signal of 0 is written by an anchor on the north side, then a redstone signal of 15 is written by an anchor on the east side, the contained redstone value will be 15 as it overwrites the previous one. However, a separate integer signal value of 30 can be written and will be stored alongside the redstone value.
Any data contained in a Network Cache is serialized and deserialized with the Cache block's loading and unloading; so, you don't need to worry about your data disappearing unless you overwrite it with something else.
Network Caches can be covered with a facade similarly to Anchors, but they don't have a gui of their own.
Main page: Network Controller
This is the heart of a network and does all of the heavy lifting: as mentioned previously, Network Anchors don't actually do anything on their own but serve as the in-world "anchor" for a network; a point for it to interact with the world. The Controller has a gui to configure (as of now) two settings, redstone control and ticks per operation, and a button to open the Network Graph.
Ticks per operation is pretty self-explanatory; it can be any value between 1 and 1200 (eventually configurable) and is the number of ticks between each network tick. A network tick is the execution of every valid operation in the network. You'll probably want to read up on what actually gets processed and how: Network Execution covers this information. Redstone control can be cycled through any of the following with left-click, and cycled backward with either right-click or shift-left-click:
-
Always
- always runs -
High
- runs only with a redstone signal -
Low
- runs only without a redstone signal -
Never
- never runs -
Pulse
- runs once per redstone pulse, ignoring the value of ticks per operation
It's important to note the controller's internal tick timer is only incremented when its redstone control requirement is met. For an example, if a network has redstone control set to High
and ticks per operation at 20:
- While it doesn't have a redstone signal, it does absolutely nothing
- Once it starts receiving a redstone signal, then the timer starts counting up, and once it has been ticked 20 times by the server it will then trigger a network tick.
- If the controller becomes no longer powered, the timer stays at the same value, and only starts ticking up again once it receives a signal.
This is contrasted to some other modded machines' behavior, which will try to operate every
x
ticks and only do so if a signal is received.
This wiki will be updated eventually with examples and walkthroughs for creating different systems (such as the 7-segment display described above), hopefully as a way to "learn by doing" and get the user more familiar with Logic Networks.