I want to save the running state of a behavior tree, for example, save the running state as a json string, and then I hope that I can restore this string directly to put the behavior tree in a certain running state. Used to save and read the game. I did not find the corresponding description in the function list. Do you support it?
Saving and restoring the whole and exact running state of a graph is not possible. The best approach of saving and restoring the graph state, is to design the graph in a dynamic way so that the conditions which will evaluate will make the graph come to the desired state. Blackboard variables can be of help to that, especially since you CAN save and load blackboard variables to a son string using the Serialize and Deserialize methods found in the Blackboard class. So in essence, by saving and loading variables only, the graph flow (due to conditions) will return back to the state it was/needs to be.