Hi! Thank you for replying! I've given WarpRogue a few tries this past week or so, and I find it has a huge amount of potential, so I hope you keep going, and good luck!
About serialization:
I understand that the same objects won't have the same memory address. However, it should still be unique throughout a single execution. Also, there won't be two pointers to diferent objects having the same value.
I'm guessing that what you do when you serialize is just write the list/array down, one by one, in the savefile, is that correct? I see how that works now...
However, theoretically... instead of doing it one-by-one, list/array style, couldn't you have a serialization engine, as I said, with functions for each class/struct type and call SerializationEngine::Serialize(MainGameClass/struct) on your main instance? What I'm thinking it could do is embed/serialize the object based on the first memory pointer occurence. It's late, so I'm not sure how clear I'm being - sorry about that.
Basically, I'm trying to say that when a pointer which the (de)serialization engine does not recognize is first found, you serialize or deserialize it immediately, embedding it within the holding class's serialization output. In deserialization, you'd probably create a new instance and "fill it up". You'd also end up knowing what the new pointer value is, because you'd just allocated it.
This way, the previous execution's pointers become a unique ID with which to identify which object is where in the new execution. You can easilly set that up in a table somewhere - much like you're doing in-game, except there's less overhead from having that general resource list/index.
Oh, poo. I think this is exactly what you just said. I'd appreciate it if you let me know if I got it half-straight though. Also, you could probably get away with no embedding by "recursively" serializing the "containees" and serializing the containers last - as long as you don't have double-references (this points to that, but that points to this). Might be a little tricker then.
Thanks in advance! And again, good luck with WarpRogue, I look forward to playing the next version!