this short note shoehorned into a tiny space in mr mike’s Gaming Coding Complete programming book is the most important thing no one else told me about building games that are capable of saving to disk/state/network (aka serializing)
i’ve spent months figuring out ways of trying to work around missing address bugs in Exigy, and 100% of them were because i had made a fundamental architectural error in designing game objects from the beginning.
i was using their (Lua table) addresses to keep track of object instances. this works great when you have a program that runs once and terminates.
but when you want to reload a saved game, you can’t count on those addresses remaining the same.
i had written all kinds of hacky remapping voodoo to deal with resetting those addresses after loading a save. but the real solution was to keep track of objects myself using a manager. indexing objects by unique number from the beginning would have saved me months of sweat and tears.
good learning experience for a novice game engine coder like me!





