Saving and reading

NodeCanvas Forums General Discussion Saving and reading

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #15696
    wzxinchen
    Participant

    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?

    #15706
    Gavalakis
    Keymaster

    Hello,

    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.

    Please let me know if that help.

    Thank you.

    Join us on Discord: https://discord.gg/97q2Rjh

    #15711
    wzxinchen
    Participant

    I’m sorry I posted a duplicate. I understand, thank you for your reply.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.