Skip to content

Introduction to Logic Nodes

Moritz Brückner edited this page May 22, 2021 · 18 revisions

Introduction to Logic Nodes

Armory's logic nodes provide a visual way of creating interactive behaviour. Nodes are "building blocks" for some common procedures, which when combined with other nodes create a node tree that describes the behaviour of a trait. Each node can be executed and will then run the functionality it represents. When you build your project, the logic node trees that you've created are automatically translated into Haxe code.

The functionality of individual logic nodes is described in the reference, for an in-depth look over the internals of logic nodes, please read the page on logic node development.

The compilation to Haxe can lead to warnings depending on the name of the node tree. If you see such a warning, please read this note.

Table of Content:

Logic Node Editor

Logic nodes can be edited in the Logic Node Editor. To open it, change the type of an area in the Blender user interface to Logic Node Editor as shown in the following screenshot:

Open the logic editor

To create a new node tree, click on New at the header of the node editor. A node tree contains all logic nodes that belong to the trait.

Create a logic tree

You can add nodes to the current tree with Shift + A or via Add in the node editor's menu bar. If you press S while the Add menu is opened, you can search for logic nodes. Logic nodes can also be added via Blender's search operator (F3). Logic nodes are grouped into categories for easier navigation.

Add logic nodes

Logic Nodes

A logic node looks like this:

Logic node screenshot

The inputs and outputs of Blender nodes are called sockets. To connect nodes, simply drag with the mouse from one input socket to another output socket. Input sockets can either activate the node (execute it) or can be used by the node to retrieve data from other node's outputs. Output sockets can send impulses to other connected nodes to activate them or hold data to be retrieved. This is explained in more detail further below.

In addition to that, nodes can have operators and settings which can alter the functionality of the node.

Sockets

Different sockets have different functionality depending on their type. The socket type is denoted by the color of the socket. When connecting nodes, make sure to only connect sockets that are compatible with each other and do not create cyclic connections.

Socket Types

TODO

Variable Sockets

Some sockets have a small dot inside of them. This dot tells you that this socket is an interface to a variable value that is stored between executions of this trait (over mulitple frames). Nodes for working with variables can be found in the Variable category.

Performance

Using logic nodes results in a slight overhead compared to pure Haxe scripts. The connections between nodes have to be followed before executing a connected node and calling functions of node classes usually requires a very small amount of time. Also, logic nodes don't know anything about their surrounding context which can lead to redundant calculations, for example due to two different nodes doing the same sub-task twice.

Clone this wiki locally