Modulo provides a method of visual programming in Unity by connecting logic nodes together in state machines. Rather than being 'yet another visual scripting tool' aimed at making games without code, Modulo is designed specifically to aid collaboration between programmers and designers, by providing a simple but powerful framework for programmers to script logical building blocks that designers can then configure, combine, and experiment with. Originally conceptualized as a tool for designing NPC schedules, Modulo's scope quickly expanded to cover generic use cases. It is an effective tool for constructing and visualizing the flow of complex logic trees, such as dialog trees or behavioural AI.
Modulo has a number of features that are similar to other visual programming solutions, as well as a few things that set it apart. These are some of the more interesting features:
- A fully Unity-integrated editor is provided for constructing Modulo visual scripts (called 'modules').
- Each module contains a collection of state machines which act similarly to methods/functions in programming.
- A set of 'variables' can be defined to store and pass around data within a module, as well as a set of 'local' variables for each state machine in the module.
- A sophisticated execution model allows multiple coroutines of execution, and separate contexts for each state machine invocation.
- Transition conditions are nodes too, and these can be chained in AND/OR configurations to construct complex decision trees.
- Debugging features: Set breakpoints, log messages to the console, follow execution of a module runner, watch changes in variables.
- Common usability features: zooming, panning, resizing of UI components, node grouping, copy/paste nodes, tabs, annotations, undo/redo.
- Nodes and groups can be color-coded.
Features of interest to programmers:
- Creating new node types is simple and intuitive. A collection of base node classes are provided to hide the complexity of common use cases.
- The system can be easily extended to support additional types of Modulo variables, including ones that act as references to objects in scenes.
- A robust mechanism is provided for checking modules for errors.
- Object allocation is kept to a minimum to avoid GC spikes.
- Custom editor scripts are defined for nodes in the usual Unity way, meaning that how a node is configured is entirely up to the programmer.
- A mechanism is provided for saving and loading the state of all module runners in a scene.