Node graph
All graphs in Vilanel are edited on the same node canvas: class event graphs, functions and construction scripts, interface graphs, materials and animation pose graphs. Only the available nodes change.
One canvas for every graph
Panning, zooming, the grid, box selection and moving several nodes at once are implemented once and shared, so every graph editor behaves the same way.
State machines are the exception. They are drawn as boxes connected by arrows rather than as nodes with pins, so they use a canvas of their own.
Connection types
Each connection type has its own colour:
| Type | What it carries |
|---|---|
| Exec | The order in which things happen |
| Bool | True or false |
| Int | Whole numbers, which stay whole through every node |
| Float | Decimal numbers |
| Vector | Two, three or four numbers, such as a position, direction or colour |
| String | Text |
| Asset | A reference to an asset, chosen with an asset picker |
| Entity | An object in the level |
| Pose | A skeleton's pose, in animation graphs only |
| Untyped | Takes on the type of whatever is connected to it |
Execution connections use triangle pins and value connections use circles, so the difference is clear without relying on colour. Pose connections are drawn in white so the flow of the pose through an animation graph is easy to follow.
Node library
The node library covers maths, vectors, text, physics queries, input, spawning and other gameplay tasks. Three rules apply throughout:
- Invalid operations stop with an error. For example, the square root of a negative number stops the graph and reports an error, instead of producing a value that causes confusing problems later.
- Missing systems return a safe result. In a level with no physics, a raycast simply hits nothing, so graphs behave the same in tests and in levels. Invalid arguments, such as a zero-length direction, are still reported as errors.
- New nodes are added at the end of the list. Saved graphs refer to nodes by their position, so inserting a node in the middle would break existing graphs.
Errors
If a required input is not connected, or a node cannot compile, the error is shown directly under that node, so there is no need to search the log to find the problem.
Animation graphs
Animation is built with Animation Blueprints, which evaluate poses in their own way and have their own state machine editor.
Related
- Actor classes: events, functions and variables
- Animation Blueprints: how animation graphs work