Questions regarding the save/load system

Post Reply
nick
Posts: 85
Joined: Mon Sep 08, 2014 9:24 pm
Location: Plymouth, UK

Questions regarding the save/load system

Post by nick »

Though I'd create a topic specifically for questions regarding the save/load system.

There is code that looks like it is part of the game save/load process, but I can't find where it is ever called in that process.

For example: SaveModelToBinary()
which is called in the function ModelViewer::PollEvents()
What is this?

Will be grateful for any help with this :)

Going to have to close down for a while, but will log on again later tonight.
nick
Posts: 85
Joined: Mon Sep 08, 2014 9:24 pm
Location: Plymouth, UK

Re: Questions regarding the save/load system

Post by nick »

Also, could anybody shed any light on NodeVisitor and its derived classes?

As far as I can see, ONLY one that is part of the save/load process is SaveVisitor and LoadVisitor (now SaveVisitorJson and LoadVisitorJson) which are invoked in ModelBody::Save(Serializer::Writer &wr, Space *space)

Thanks
robn
Posts: 302
Joined: Mon Jul 01, 2013 1:11 am
Location: Melbourne, Australia

Re: Questions regarding the save/load system

Post by robn »

SaveModelToBinary is part of the model compiler. You don't need to worry about it for this.

NodeVisitor walks a model node graph and invokes methods for each node. SaveVisitor and LoadVisitor are responsible for serializing and deserializing node state. They're the only ones involved in the save/load process.
nick
Posts: 85
Joined: Mon Sep 08, 2014 9:24 pm
Location: Plymouth, UK

Re: Questions regarding the save/load system

Post by nick »

Thanks robn!
Then I've created some unnecessary JSON save/load functions (e.g. in CollMesh) which I'll remove to avoid confusion. Let me know if you ever need them though :)

With regard to SaveVisitor and LoadVisitor:
As far as I can see, only a single matrix4x4f is saved/loaded (in ApplyMatrixTransform).
I'll check again though, to see if any other virtual functions are called that save data.
nick
Posts: 85
Joined: Mon Sep 08, 2014 9:24 pm
Location: Plymouth, UK

Re: Questions regarding the save/load system

Post by nick »

FYI: There may be some information regarding the JSON save/load system in https://github.com/pioneerspacesim/pioneer/pull/3350 which is not covered in the posts in this forum.
robn
Posts: 302
Joined: Mon Jul 01, 2013 1:11 am
Location: Melbourne, Australia

Re: Questions regarding the save/load system

Post by robn »

At review time, what's in the PR is canonical.
Post Reply