Hierarchical Nodal Logic for Blender 2.5
The game engine has already a GUI for logic creation: the logic brick system. Logic bricks are easy to implement but not easy to use. We want it the other way round: a logic system should be easy to use and useful even to develop complex application, no matter if the implementation is complex.
The Logic Bricks system has several limitations:
It is very difficult to see the logic as a whole when it gets a little complicated. Also the logic is not presented in a confortable form: the sequence of actions are not easily visible.
The state system is the only level of hierarchy available and that's insufficient for complex logic.
A game is always a dodgy mix between Bricks and Python:
Python access to game engine features is incomplete; you cannot get away from using some logic bricks, possibly inefficiently, if you want to create a 'only python' application.
Logic brick access to game engine features is incomplete; you cannot get away from using some Python code if you want to implement a complex logic.
Logic Bricks are not easily extendible: you must code in C and modify Blender to create a custom brick.
Logic graphs are not reusable: you cannot create a library of logic graphs and apply them to multiple objects. This is because Logic Bricks are closely attached to objects.
This project will try to address all these limitations by providing a system that's easy to use, extendible, hierarchical, efficient, complete and reusable. It would be nice if in addition it is not too difficult to implement but that's a secondary requirement.
Sound familiar? It should for some of you, it is Kizmit only using Python instead of Unrealscript. Read further if you care to...
The concept
After reviewing some of the most popular nodal logic systems in the market and consulting with other Blender devs and users, I came up with a Nodal Logic design. Various well-established analogies include: flowcharting, data flow diagrams, and integrated circuit design methods. The pattern we want to use is Blender's Node Editor, where we have a set of connected nodes in a tree-type of structure (a "noodle"). Inputs feed data and events into the noodle, where it is processed and results in changes relayed out through output nodes. Inputs can be taken from, for example, a Wii remote, a joystick, the keyboard or motion sensors. Processing can include any number of math functions, scene functions (object create/destroy, play actions and animations, get/set a variable or property). Outputs can be relayed to set a property, write to a file, or send a value to an output port (for example, controlling a robot), or write to a log file through a file output node.
This is not the only possibility but a well-designed Nodal Logic system can fulfill all the requirements stated above better than any other system. The key features are re-usability and hierarchy. If well used, the hierarchy of Logic graph will provide the separation of tasks, programmatic capability and state engine support that is needed for a complex logic development. We should be able to group nodes into logical processing units, and be able to append/link node groups as well.
... Wow, how exciting...