Archive 17/01/2023.

Saving/Loading game

smellymumbler

How would you guys approach a system for loading/saving a game? Just save the entire scene serialized?

Modanung

If you have all the required information stored in component properties. Then maybe.
But in most cases you won’t need that much information (but probably also more) since a base scene might already be present with its set save and load points.
You’re probably best off figuring out what information is essential to store in your situation and then writing SaveGame and LoadGame methods that handle and complement that.

Sinoid

Place the things that need to be saved under a “DynamicObjects” node in the scene which is treated like a “folder.”

When saving just save that node and it’s children out to XML/binary.

When reloading just overwrite the existing DynamicObjects node.