Just to verify that I’m not seeing things that are not there I’ve created a test project that instantiates 100 state machines that call a “public NodeCanvas.Status NCUpdate(int value)” method on the agent until it returns Success. Three different ways are used to call that method.
These are the results. (Simplified delegate action is my own implementation)
Unity 5.4.1f1, 100 fsm’s in editor:
Standalone Only/Implemented Action: 2 kb per frame
Multiplatform/Implemented Action: 27 kb per frame
Simplified delegate action: 0 kb per frame
Unity 5.4.1f1, 100 fsm’s on iOS device (IL2CPP)
Standalone Only/Implemented Action: DOES NOT WORK
Multiplatform/Implemented Action: 17 kb per frame
Simplified delegate action: 0 kb per frame
Where the memory allocations come from when using the included script actions I don’t know, but they do definitely happen! And this happens with most of the Script Control actions and conditions, not just the ones that return a Status.
The implementation I have created shows that it is possible to create an interface with scripts that don’t have this overhead and can work on AOT platforms. So I think there is room for improvement for the included Script Control actions.
Best,
Jakko
Login
Register
By registering on this website you agree to our Privacy Policy.