-
Notifications
You must be signed in to change notification settings - Fork 4
Nodes
A core concept of LUTE is Nodes
and how these interact with one another and the Flow Engine.
Each Node
can contain one or more Orders
which essentially drive your experience in a step by step fashion.
Inpsecting a node is simple:
- Create your Flow Engine object and open/dock the window.
- Select the default node or any node that you have added to your Flow Engine. The Node's properties are visible in the inspector view:
You can see many properties on the node including the name and description of the selected node. The currently selected node (s) are highlighted in green.
We find it important to name our nodes in a unique fashion to ensure there is no confusion between multiple nodes. We also find adding a short description of the node helps other designers understand what this specific node will do when executed. Changing such paramters is easy:
- Select the chosen node you wish to change
- In the inspector window for the node, update the name and description
- Observe changes in the Flow Engine window
N.B: Node names are shown in drop downs for selecting in various other parts of LUTE, as such you may wish to name them using categories. Placing a '/' in a node name will result in dropdowns collecting things into categories.
Creating new nodes is easy using the Flow Engine Window:
- Ensure you have created a Flow Engine and the Window is open
- You can either select the 'Add New Node' button in the top left of the window (the '+' sign) or right click anywhere and select 'Add New Node'
- A new node has been added to the window with a default name and empty order list
Add a useful name and description now before you forget!
When right-clicking on a node a context menu pops up with multiple choices related to that node.
Nodes can be copied or cut (typical behaviours you find in other software such as word processors) and then can be pasted at another point (removing the original if cut was chosen). Multiple nodes can be selected by using the drag rect (hold down left click anywhere on the window and begin dragging to select multiple nodes).
To duplicate (clone / make an exact copy of) a Node, without using copy/cut then:
- Right-mouse-click over the Node you wish to duplicate, and choose
menu>Duplicate
- A copy of the Node should now have been added to the Engine (with "(copy)" appended the name of the duplicate):
Remember to add a unique name and descriptor as soon as possible.
To delete a Block from the current Engine:
- Right-mouse-click over the Node you wish to delete, and choose
menu>Delete
- The Node should now have been removed from the Engine and Window
If you ever accidently delete a node or cut it or somehow it becomes lost then you can try the shortcut CTRL (or CMD) + 'Z'
to undo your last action!
For information on the blueprint context item pleae head to Blueprints.
LUTE currently offers three types of visuals for nodes depending on their behaviour:
- Event Nodes which are typically rectangular and cyan
- Choice Nodes which are typically hexagonal and blue
- Normal Nodes which are typically rectangular and orange
For more information on Node Types please read on:
Typically in Unity we execute code blocks through conditions or using Unity provided methods such as Start
and Update
. In LUTE, Nodes can be executed in similar ways but often start executing if the Node has a defined Execute On Event
. If a Node has any possible Event attaced to it (common examples include Game Started and Update) then then Node will be displayed as a cyan rectangle (unless a custom tint is being used).
In this example, we have creaeted a Node and selected the 'Game Started' to activate the node so any behaviour on this Node will begin as soon as the game has started (or the Editor has entered 'Play Mode'). Displaying an Event Node always overrides any other display types except for when using custom tints.
Note: Event Nodes also show some text in triangle braces below the Node itself which describes the type of event this Node has. You can switch this visual off using the Show Handler Info on Graph
toggle on the Flow Engine object in your scene where the Node is related to.
If a Node is not an Event Node but contains 2 or more orders which include the 'Next Node', 'Choice', 'Menu Choice' or any other order that may relate to calling or connecting other Nodes and the orders do not share the same target Nodes then the Engine will display the Node as a hexagon.
The Flow Engine Window will also draw arrows between the connected Nodes (if they have been provided). More on connections is detailed further below.
If a Node is neither an Event Node or Branching Node then it is a 'Normal' Node which is typically displayed as an orange rectangle (if no custom tint is being used). All Node visuals update automatically when you change their setting.
Theoretically, you could design your whole experience or scene in one Node but this would be messy and would become a struggle to maintain. Therefore, we often use multiple Nodes and require methods to pass execution and control between them. Typically we do this using:
- The
Next Node
Order - The
Choice
Order (whether this is a Dialogue or Menu choice)
The Next Node
Order tells LUTE to start execution of another Node. There are a few modes to decide upon when doing such an action:
- We can 'Stop' immediately which stops execution of the current Node and passes control to the target Node.
- We can 'Wait Until Finished' which will wait until all Orders on the target Node are completed before passing control back.
- We can 'Continue' which will execute the target Node while simultaneously execute the remaning orders on the current Node (this is rather complex so proceed with caution).
To pass control and call another Node we do the following:
- Select a Node which will be called at a certain point (in this case when the game starts)
- Add another Node which will have some functionality on it
- Add the 'Next Node' order to the first Node by selecting
Flow>Next Node
- With the new Order selected, choose the second created Node from the Target Node drop-down along with the mode type you desire:
Keeping the Target Engine as default will use the Engine that this Node is attached to
- You should see an arrow in the Flow Engine Window connecting the two Nodes together. The arrow dictates which way the call is happening (in this case from the first created Node to the second created Node).
Quite often in narrative experiences we will make players decide on which direction they wish to go in. We can tie many of these choices together to eventually create a branching narrative or conversation. In this example, we will keep it simple by offering a question for players which will have two answers (incorrect and correct) that will either lead to 'Glory' or 'Certain Doom'.
The crux of this example relies on the Choice
Order:
- Create new Node and name this 'Question'.
- Add a
Dialogue
Order to this Node with your question - in this case we ask 'What Galaxy do we live in?'. If you are not using the basic Engine/Node system then ensure that this Node is activated by 'Game Started'. Also uncheck the 'Wait For Click' toggle so we proceed to the next Order once we have been shown the text automatically.
- Create a new Node and name this 'Correct' which will contain a
Dialogue
Order with some text stating that the player answered correctly.
- Head on back to the question Node and and the
Narrative>Choice
Order - With this new Order selected, we can add our choice text - in this case we can add the correct answer: 'The Milky Way Galaxy'. Ensure the target Node leads to the 'Correct' Node ensuring that when pressed we show players they were correct.
- We can now do this for the incorrect answer: add a new Node with a name of 'Inocrrect' and add a
Dialogue
order that gives an incorrect answer prompt (such as "You guessed wrong! Maybe astromony is not for you...").
- Now we head back to our 'Question' Node and add another
Narrative>Choice
Order with an incorrect choice that leads to the 'Incorrect' Node. - You should now see the Flow Engine Window update visually to reflect our changes.
- Try running the scene and playing through each scenario. If you fancy going a step further then try considering how you would return back to question Node after answering the question using the
Next Node
Order!
Upon answering correctly:
As briefly mentioned, Events are just one way to execute a Node or Order. These will follow typical paradigms that are found within Unity such as:
- Game Started
- Update
- Mouse/Input Events
- Animation Events
Whilst this list is limited, adding Event Handlers is rather simple (see Event Handlers if you are a somewhat experienced developer.
The most common event that you will likely use will either be Game Started or Update. To change the Event on a given Node:
- Select the Node you wish to update the Event for
- Find the
Activate By
property in the inspector window and choose from the popup menu of events: