Tools for the Job, Part 1: The Nodegraph System

Victor Zuylen; 12 December 2016

Olaf & Bryan

"The Nodegraph System allows designers to create complex gameplay elements without writing code"

Efficient games development is all about having the right tools at your disposal.

At Guerrilla, a team of dedicated tools and game tech programmers strives to streamline the process with a suite of powerful development tools tailored to the Decima engine. In this article we take a closer look at one of their creations: the Nodegraph System, a versatile node-based visual scripting solution.

“In essence, the Nodegraph System allows designers to create complex gameplay elements without writing code,” explains Senior Game Tech Programmer Olaf Jansen, who helps maintain the system along with Game Tech Programmer Bryan Keiren. “We originally built it for Killzone’s sound designers, who were looking for an easier way to attach audio behavior to game objects.”

Fig. 1: A relatively complex nodegraph with a lot of data connections, showing live values and execution flow. The line graph displays a specific pin's value over time. (Click to enlarge.)

Initial results were promising, so a version adapted for more general design purposes soon followed suit. “Before long, our game and quest designers were creating all kinds of cool and complex systems in the editor – stuff we didn’t even realize it could be used for,” Bryan says.

The intuitive interface of the editor has been one of the key factors in the adoption of the Nodegraph System. “It’s basically a graph editor,” Olaf says. “You create node networks by connecting wires between nodes, which can represent anything from objects to gameplay events.” Behind the scenes, the system parses and converts node networks into C++ code, which is then compiled and executed in the Decima engine running on a PS4 development kit.

Fig. 2: An example of a state machine. It contains several states that can be transitioned between. Each state listens for a few different events in the game. Notably, the mouse is on the "Entity Update" event of the initial (green) state, showing a preview of the graph that is executed when that event is triggered. (Click to enlarge.)

The other major component of the Nodegraph System is the debugger, which allows developers to track down issues in nodegraph networks by showing which parts are triggered while the game is running. “Developers can freeze the game at any point, inspect the values and connected wires of each node, make adjustments, and re-sync the game to try out the changes,” Olaf explains.

The debugger then generates new C++ code, which it compiles and hotloads in the game. “That’s been a huge time saver”, Olaf says. “Not too long ago, you’d have to quit the entire game, make the change, restart the game, wait until it loaded, and see if you’d solved the issue.”

Fig. 3: The Nodegraph Editor comes with a large toolbox of nodes that can be combined to script logic. It supports execution flow control, data connections, variables and nesting of graphs, among other things. (Click to enlarge.)

The debugger even allows developers to ‘travel back in time’ through previous executions of the node network, to pinpoint the moment an issue first pops up. “Each sequential execution is represented by a block on a bar in the lower half of the screen, and developers can scrub through this bar similar to how they might scrub through a waveform in an audio editor,” Bryan explains.

Easy-to-use interface elements like these have made the debugging process much simpler for the designers. “Before the debugger was completed, our designers would frequently come to us when a node network wasn’t behaving according to their expectations,” Bryan recalls. “Now they’re able to do almost all of the debugging themselves.”

Fig. 4: The Nodegraph Debugger lets developers see a live view of values and execution flow, and enables them to diagnose performance by inspecting the time it took to execute graphs or individual nodes. (Click to enlarge.)

Olaf and Bryan already have further enhancements planned for the Nodegraph System. “The next step is to add a toggle that will allow the game to record in the background which nodes are being triggered,” Bryan says. “That data can then be loaded back into any debugger, making the reproduction and pinpointing of issues encountered by QA much easier.”

Olaf and Bryan aren’t worried such enhancements would require a radical overhaul of the Nodegraph System. “Like the Decima engine itself, this system was created with versatility in mind,” Bryan says. “Even if we want to use it for something radically different – say, the creation of shaders – most of the scaffolding is already in place. In that sense, it’s likely the Nodegraph System will play an even bigger role in future projects.”

If you’d you like to work on the Nodegraph System and other cool development tools at Guerrilla, check out our vacancies for Tools Programmers here!

Tags: guerrilla, tools, Programming, code, Decima