I am making a jigsaw puzzle game. So far it works pretty well but trying to implement a save game system is proving tricky.
I spawn each puzzle piece into the world along with associated data like piece location, orientation, which 3D model, UV coordinates, which texture file, and probably a couple things I’m forgetting and I put all those variables into a “pieceStruct”. So each piece has it’s own struct with unique data and that data gets updated when the piece moves or changes orientation etc.
What I can’t figure out is how to save that data to a savegame file and make sure each piece comes along with it’s unique struct data.
Make an array of structs? Make an array of each piece of data and toss out the structs and just use array indexes? What’s the best practice for saving a bunch of actors and relevant unique data for each actos?