Integrated Dynamics

## **Synopsis**

Integrated Dynamics adds Logic Networks into Minecraft. These are very much like programs which you might come across in basic computer programming. If you have not coded or worked with formal logic before, this mod might take a bit to figure out.

## **Getting Started**

Integrated Dynamics adds a brand new sapling into the game called a Menril Sapling. These saplings can be grown into a tree which drops Menril Wood, Crystalized Menril Chunks, and Menril Berries. These three resources are the core ingredients in all blocks and items added by Integrated Dynamics.

**Menril Wood Processing:**

Menril Wood is not used for anything by itself, but it can be turned into a Block of Crystalized Menril. This can be done using the **Squeezer** and the **Drying Basin**. Place down a Squeezer. You can see everything that you can crush in a Squeezer by pressing the U key while hovering your mouse over the Squeezer in the JEI. Right click on the Squeezer with a Menril Log in hand to place it into the Squeezer. Jump on top of the Squeezer over and over again. Each time you jump, the Squeezer will compress a little bit more, until it is completely flat. At this point, the output will drop if it is an item, or be output to either the left or right adjacent block if it is a liquid. Menril Logs are squeezed into one bucket of liquid Menril Resin. You can reset the Squeezer by giving it a redstone pulse.

You can collect the liquid Menril Resin with any kind of fluid tank, but it may be logical to collect it with a Drying Basin. Place a Drying Basin adjacent to the Squeezer, to either its left or right, and squeeze a Menril Log. This will fill the Drying Basin with liquid Menril Resin. After a small amount of time, the liquid Menril Resin will harden into a Block of Crystalized Menril, which can be turned into Crystalized Menril Chunks. You can see additional uses for the Drying Basin by hitting the U key while hovering your mouse over it in the JEI. There are mechanical versions of the Squeezer and the Drying Basin which work similarly and require power.

## **The Logic Network**

A Logic Network is kind of like a program. You can define variables and assign them values; you can define functions and use them to process variables or return outputs. Everything that you use in your “program” needs to be connected to the Logic Network. This is done using **Logic Cable**.

**Mono-Directional Connector:**

 The Mono-Directional Connector is capable of connecting two Logic Networks which are not directly connected together. This is sort of like importing another file to be used in your program. In order for the two networks to be connected, one Mono-Directional Connector must be placed attached to each network, facing each other. This means that they are either on the same horizontal axis with the same y value (horizontal connection), or they are on the same vertical axis with the same (x,z) pair (vertical connection).

**Omni-Directional Connector:**

 The Omni-Directional Connector serves the same function at the Mono-Directional Connector; it connects two Logic Networks together. Omni-Directional Connectors can be placed anywhere in the network, and even work across multiple dimensions. These connectors have a Group which is assigned to them when they are crafted. All networks with Omni-Directional Connectors from the same group will be connected together. To change the group of a connector, place it in a crafting grid. You can place two connectors in the same crafting grid (in different slots) to place them both in the group of the connector that is closer to the upper left of the crafting grid.

## **Logic**

It is time to start writing some programs. First, we are going to need to define some variables. Craft yourself some **Variable Cards**. Variable Cards do nothing on their own; they require values. There are two types of value that can be assigned to Variable Cards; **dynamic** and **static**. Dynamic values can change in real time as the environment around your program changes, while static variables are constants; they retain the same value no matter what.

**Naming Variables:**

 Those of you with programming backgrounds might understand the importance of naming your variables with good names. Variable Cards which store the values of your variables will be named “Variable Card” by default. This helps no one. You can change the name of a variable card using a **Labeller**. Right click with the Labeller in hand to open its GUI. From here you can place a Variable Card into the top left slot and change its name as if you were using an anvil. Naming your variables definitely isn’t necessary with smaller Logic Networks, but as you start to expand you will find that you have trouble remembering what certain cards are intended for.

## **Dynamic Variables**

First, we are going to talk about assigning dynamic values to variable cards. There are 10 different **readers** available for your use in Integrated Dynamics. These readers monitor the Minecraft environment and output certain values to variables which are bound to them. The values of these variables change in response to the readings being taken from the environment by their connected readers.

**Example Walkthrough:**

The easiest reader to use and understand is probably the Redstone Reader. Craft yourself a Redstone Reader and attach it to your Logic Network by placing it on some Logic Cable. Now place some redstone dust in front of the Redstone Reader and run a redstone line out some distance for the purpose of demonstration.

Right click on the Redstone Reader to open its GUI. This will show you all of the values that the reader can read from the environment to a variable. The first option is **Redstone Low**. Hover your mouse over the box in the top left to see its description: this value measures “If there is no redstone level” and has a type of Boolean (True/False). You can see the current value of this variable in the box below its name; if the redstone in front of your Redstone Reader is currently powered, it will be equal to false; if the redstone in front of your Redstone Reader is currently unpowered, it will be equal to true.

Place a Variable Card into the slot to the right of the variable name (in this case, “Redstone Low”) to bind the variable card to the value of this variable. Take the bound variable out of the right hand slot. You can see what it is bound to (Aspect: Redstone Low), what its type is (Boolean), and what its ID is. The ID is like the variable’s name; the program tracks which variables are which using these IDs.

Now, let’s use this variable. The simplest way to do this is to craft a **Display Panel**. All the Display Panel does is display the current value associated with a variable card. Place a Display Panel into your Logic Network by placing it on some connected Logic Cable. Right click on the Display Panel to open its GUI and place your variable card into its slot. You can copy the value of the variable card to your clipboard for the purpose of debugging.

When you exit the Display Panel’s GUI, you will now see the value that is being read to your variable card. Attach a lever to your redstone line. Flick it on and off to see the value of your variable change.

Click on your Redstone Reader again. This time, scroll down to the variable **Redstone**. The background of this variable is a **different color** because this variable has a **different type**. Hover your mouse over the box in the top left to see its description: this value measures “the exact redstone level” and has a type of Integer (non-fractional numbers). Bind a variable card to this value by placing it in the slot to the right of the name and taking it out of the reader. Now place your new variable into the Display Panel. The display panel will now show the exact signal strength of the redstone in front of it. Place a redstone torch some distance along your redstone line. Now place another redstone torch, this time closer to the reader along the line. You should see the number on the display increase as the strength of the signal increases (redstone signal strength decays as it gets farther away from the source).

**Generic Readers:**

As I mentioned above, there are 10 readers available in Integrated Dynamics. I cannot go over every single thing that they can read in this guide; there are hundreds if not thousands of variables that they are capable of reading. I will however go over your options in the general sense and hopefully you can figure out what you are interested in using and go from there. All of the readers work in the same way; you can see what attributes each value has by hovering your mouse over the box in the top left, you can see the current value being read, and you can bind a Variable Card to one of the values being read by placing it in the slot to the right of the value’s name.

* **Audio Reader:** reads audio information (noteblock sounds)
* **Block Reader:** reads block information (location, name, properties)
* **Entity Reader:** reads entity information (name(s), type(s), rotation)
* **Extra-Dimensional Reader:** reads information that is shared for all dimensions (random, ticks, players)
* **Fluid Reader:** reads fluid tanks (capacity, type)
* **Inventory Reader:** reads data from inventories (capacity, count(s), type(s))
* **Machine Reader:** reads machine properties (functions, capacity, energy)
* **Network Reader:** reads target network properties (components)
* **Redstone Reader:** reads redstone values (signals, comparators)
* **World Reader:** reads things related to the world, blocks, and entities (weather, time, world attributes)

## **Static Values**

Static values, unlike dynamic values, will never change once assigned. They are not reactive to readings being taken from the environment. There are two ways to assign static values to Variable Cards. One of them is using a **Logic Programmer**. This machine will be discussed below in its own section. The other way is using a **Materializer**.

Craft a Materializer and place it down connected to your network. Right click on it to open its GUI. Place a dynamic Variable Card into the top slot of the Materializer. A checkmark will appear next to this slot if the value can be read (the Reader connected to this Variable Card is in this network). The current value of the Variable Card will also be visible below this slot. Place a different Variable Card into the lower left slot to create a **Constant** variable which stores the current value being read. You can then take your dynamic Variable Card out of the machine and go on your way.

## **The Logic Programmer**

The Logic Programmer comes in both block and item form. Either place the block down and right click it, or hold the item in your hand and right click to open its GUI. It does not have to be connected to a network.

The Logic Programmer is capable of assigning **static values** and **operators** to Variable Cards. The options are pretty much exhaustive. All of the options are listed on the left side of the GUI and there is a search bar in the top left if you know what you are looking for.

Operators are a way to assign **dynamic** values to Variable cards. They take references (pointers) to multiple other Variable Cards and apply some operation (addition, subtraction, negation, etc) to them. In order for a Variable Card which references other Variable Cards to work, it must be able to access them. This requires a **Variable Store.** Connect a Variable Store to your Logic Network and place any variables that you use in the network inside of it.

There is a filter in the bottom left of the GUI. From left to right, the slots are as follows: Input Type 1, Input Type 2, Output Type. Placing any Variable Cards into these slots will apply a filter so that only operators which have the same type as the Variable Card for the corresponding area (Inputs and Outputs) will be shown as options. You can see a tab’s input and output types by hovering your mouse over it.

**Example Walkthrough:**

Open up your Logic Programmer and type Integer into the search bar. Click on the Integer tab. You can now set the number in the textbox to any integer and place a Variable Card in the bottom right slot to create a static variable. If you type something in the box which cannot be used (is not an integer in this case), a red x will appear in the bottom right. Let’s use the number 2. You can place this Variable Card into a display panel to see its value.

Now, let’s get some dynamic variables up and running. Attach a Redstone Reader to your Logic Network (described in the first walkthrough) and place a line of redstone dust in front of it. Open its GUI by right clicking and scroll down to **Redstone**. Place a Variable Card into the left slot to bind it to this value. Place a redstone torch somewhere along the redstone line to give it a signal strength. You can see the current value of your Variable Card by placing it in a Display Panel.

Back to the Logic Programmer! Type **Multiplication** into the search bar, or at least the first few letters, and select the Multiplication tab. Now place your static variable, 2, in one of the slots, and place your dynamic variable, bound to your Redstone Reader, in the other slot. Place a Variable Card in the bottom right slot to get your multiplication Variable Card.

Place your multiplication Variable Card into a Display Panel. You should see a red x appear. This is because the multiplication Variable Card is referencing two other cards; it needs to be able to read their values in order to do the calculation. You can see the IDs of the cards that your Variable Card is referencing by hovering your mouse over the card in your inventory. We need to store the referenced cards in a Variable Store in the Logic Network. Craft a Variable Store, connect it to your network, and place the two Variable Cards into it. Now, your Display Panel should have a number on it.

Time to play! Your Display Panel is displaying the value of the redstone signal strength in front of your Redstone Reader multiplied by 2. Place a redstone torch directly in front of your Redstone Reader and you should see the number 30 on your display. If you move the torch one block away along the redstone line, you should instead see the value 28.

From here, you can increase the complexity ten fold. You can multiply this multiplied value by another dynamic or static value; you can put your values through AND gates to output a Boolean indicating whether the two values are equal, greater than, or less than. You can add, subtract, multiply, divide, or negate. You can create lists, compare lists, and display lists. The possibilities really are limitless and if you want to do something complicated, I am sure you can do it. There are options in the Logic Programmer that I don't even know how to use and I am literally a Computer Science major. What you are capable of will come down to the amount of experimentation you are willing to do.

## **The Proxy**

The **Proxy** is a machine which can create references (pointers) to a Variable Card. What this means is, you can have **multiple** Variable Cards which mirror the value of a single card (no matter its value). Place down a Proxy in your Logic Network and place a card into its top slot. This card can be dynamic or static. The card’s value will be shown below the slot. Place any Variable Card into the lower left slot to make it reference (point to) the card in the top slot. You can use this reference Variable Card anywhere that you would use the card it is pointing to. You must leave the card in the top slot in order for your Proxy Cards to be able to reference it.

An example, because this can be hard to wrap your head around. Take a Redstone Aspect Variable Card (like one we created in the above walkthroughs) and place it in your Proxy. Now place two Variable Cards into the lower left slot of the Proxy to make them both reference the single Redstone Aspect Variable Card. Place both reference cards in different Display Panels. They should both display the same value. Change the redstone signal strength in front of the Redstone Reader that is connected to your Redstone Aspect Variable Card. This will change that card's value, and as a result, change **both** values displayed on the Proxy cards.

## **The Delayer**

**The Delayer** is largely a machine for the purpose of debugging programs. Place a Variable Card into the top slot of the Delayer’s GUI. The Delayer will create a list tracking the value of the inserted card over time. The Delayer can be configured to update the list every x amount of ticks, and the length of the stored list of values can be configured as well. You can insert a Variable Card into the bottom left slot of the Delayer to save the tracked list to that card. Putting this card into a Display Panel will be helpful in reading the full list.

## **Writers**

**Writers** are essentially the opposite of readers (unsurprisingly). Rather than monitoring the Minecraft environment, they output to the environment based on stored Variable Cards. There are 6 different Writers available in Integrated Dynamics.

* **Audio Writer:** plays audio and music
* **Effect Writer:** outputs particles
* **Entity Writer:** writes entity data - disabled in SkyFactory 4
* **Machine Writer:** writes configurations to machines - disabled in SkyFactory 4
* **Inventory Writer:** writes to inventories - disabled in SkyFactory 4
* **Redstone Writer:** writes to redstone

For example, let's get out our Redstone Aspect Variable Card once again. Place this Variable Card into a **Redstone Writer**, in the slot labeled “Redstone” with the type “Integer” (this is going to test your knowledge so far). Now, place some redstone dust in a line in front of the Redstone Writer. Ths Redstone Writer should output the same signal strength to that redstone as is being read by the Redstone Reader which is bound to its Variable Card.

**Energy**

Integrated Dynamics includes some forms of energy generation and storage. These are the **Generator** and the **Energy Battery.** The Generator outputs energy to blocks that are adjacent to it when it is powered with fuel. It can only output to one side at a time. The side it chooses seems random. The Energy Battery stores energy up to a given capacity (default 1,000,000 RF). Energy Batteries can be combined in a crafting grid to create a single battery with the total energy storage capacity of all the batteries in the crafting grid. As far as I can tell, the largest battery you can create has a capacity of 655,000,000 RF.