Input / Output Types

Video Transcript

There are 5 types of inputs and outputs.

First is what’s known as an Activation. This is the most common type. It is a floating point number between 0 and 1, or if you include the negative range, from -1 to 1. Next to an Activation input are several buttons. The first button exists next to every IO type, this toggles whether the input or output is available to be connected to from other parts of the program. When an input or output is exposed it has a red background. More information about external inputs and outputs will be covered in the next video about making connections between Agents. The next button shows a graph of the Activation value over time. Matched with the playback toolbar which pauses and plays back data, this is a very useful tool for understanding the workings of a real time program. The last button cycles through the three blend types, Add, Multiply, and Average. This controls how the connected inputs are combined into one value.

The Trigger is the next most used type. When an output trigger fires any connected input triggers also fire. For example in the very common Above or Below node, when an input Activation value goes above 0.5, the output “Go Above” trigger fires, then when the output goes back below 0.5 the “Go Below” trigger fires. These output triggers can be used to control something like a switch.

Almost all values in Embrio should be converted to an Activation when read from the world, and converted back to an integer only when written back out to the world. For example an analog input node encapsulates Arduino’s analogRead function which returns an integer. This integer value is converted to the 0 to 1 range of an Activation and set as the node’s output. Then when it is time to write the value out to a pin with an analogWrite, the Activation value is converted back to an Integer in the Analog Output node. Some values don’t easily translate to an activation, like the number of seconds in a minute for example. For these there are the Integer and Float IO types. Both of these types have a configurable range, click on either the minimum or maximum value to change it.

Finally there is a Text IO type for representing text. Click on the number next to the IO to set the maximum length. To set a text input’s value, right click and select Edit.