Does UE cache non-exec blueprint node results - i.e. does it do any kind of dependency analysis or dirty tracking to only evaluate the nodes that it has to?
e.g. say I have a blueprint and on every tick, it takes some input variable (a Transform or float for example) and uses that variable in a large, slow network of (pure) math/transform nodes to calculate a result, and then uses that result to do something along the exec chain (for example, aim a turret at something). If that input variable hasn’t changed since the last time the blueprint ticked, will it still reevaluate that massive math/transform network even though the result will be the same?
I’m basically trying to figure out if I should be stashing these intermediate results in variables all over my blueprints, and doing 'if variable has changed, then evaluate and store new result" tests everywhere, or if I can expect UE to do the “right” thing.
I see in the Execution Flow section of the docs that “nodes without execution pins (pure nodes) reevaluate their outputs every time a node connected to their outputs executes”, which implies that there is no caching going on at all, but just want to make sure I understand correctly.
Pure mean that everytime you will access to the return value, the value will be re-evaluated.
So if you access three time to the same value, it will be re-evaluated three time.
When you are in a non-pure function, it’s evaluated one time, when the execution pin pass in.
If you want to “cache” the information, it’s up to you to do it (by saving the result in a variable).