Questions about node editor

Hello, im a computer science student, and been programming for 4 years now. I started with blender Game engine for games development, and eventually went to unity and UDK, but still, i think the BGE is awesome, and i want to contribute. My math skills are rubbish so no mesh tools or graphics, but i can do game logic fine.
I want to start creating a node system for logic, separated from the logic bricks, something like texture nodes, wich you can place the same node tree on different objects or make each object have its own node tree. Ive been reading the node system in blender, and i think ive got how to create a new panel, but i still have many questions. This isnt a very serious project, mostly a project for fun and learning, if i get to a barely-working prototype i may apply for a GSOC ( i want to do a GSOC this year or next, anyway) so dont get any hopes.

My questions are:
1- How can i change the node system so its completely different, but using the same UI and controls
in detail, the nodes will have an in-out socket, wich will be a signal beetween nodes. and also input output socket variables like you already have. Also i want to handle the node updating and logic myself. for example, i would make “Event” node wich will be called like a function, like “update”, “on collision” and similar. just like the sensor in logic bricks. and then, it fires the “out” socket wich is connected to other node/s and then calls their functions. Im asking if this can be done without changing much code from the general node system.

2- Should i start with Pynodes or make it complete in c/c++
ive seen some progress with pynodes, and im asking if those pynodes, or starting with its code, would be enough, im proficient both with c++ and python.

3- would be wise/easy to mix c++ classes and code with the Node and NodeType and similar classes in the blender node editor source?
Ive allways worked with c++, and reading blender’s source ive seen it has both. Im intriged by the system blender uses in the nodes to simulate classes but without them, using the NodeType enum and TreeType enum with function pointers.
should i be able to create a c++ class inheriting from that NodeType and Node and would it work nicely?

4- Where do i set the UI part of the nodes and the tab for the node editor

looking at #1, i would change a bit the UI for the nodes, can you give me some general advice on how or where to look an example?

5- How do i add a variable to a logic brick
the logic node tree will be launched from a logic brick, an actuator block wich creates a tree for the node based on a template ( like materials do)

these are the questions i have, If people help me with this, i think i could arrive to something, and maiby make a GSOC of it. If there are some other node projects for the BGE that i can see, can you point me to them?

Hi there,

It is good to see that you are interested in nodal logic, and your help would be very welcome. However, nodal logic is not an easy project for fun. It requires a lot of deep thought to get it right, in particular on node mechanics and node-node communication. Two computer science students tried this already in a Blender GSoC and both of them failed very hard.

There is no “general node system” in Blender: the Texture/Material/Compositor nodes are based on simple dependency-graph-driven updates, unsuited for game events. A BGE nodal logic system requires its own mechanics.

The node GUI and the node mechanics are completely unrelated. Pynodes is a Python framework to create node GUIs that run inside the Blender Node Editor. Creating your own node GUI in C (Blender UI code does not use C++) would be an insane amount of work and a waste of your time. A nodal GUI does not do node mechanics, that has to be solved separately.

No, because their evaluation mechanics are completely inappropriate for game event. You will need “push” mechanics as well as “pull”. Enums are bad code anyway, we are trying to move away from them and use RNA instead.

The Blender Node Editor, node mechanics and logic bricks are three completely different and unrelated things. The logic brick system has a very rigid evaluation system of game tick->sensors->controllers->actuators, this cannot be used as a basis for a node system.

See my signature.

I encourage you to think about node GUIs and node mechanics, and then study how Hive does it. The Hive tutorials and manuals have some detailed chapters about node mechanics, and you could look at the HiveGUI code for inspiration (it runs under both Pynodes and PyQt).

This should give you an idea of how big of a project nodal logic is. If you want to create your own system, you should reserve ten years of your life for it. On the other hand, if you are willing to start from an existing system, you could learn the Hive system and contribute to it. In both cases, I recommend that you learn Hive, to give you an idea about what design decisions are to be made.

Good luck :slight_smile:

Sjoerd

Thanks a lot for your answers, ill look at your system, and maiby i could help with it a bit, what you have is mostly what i intended to make