ah yes. save should be built from the beginning, its very hard to add later on
Not true. In fact saving is easiest to add when everything else is ready, because you don't have to adjust the save routine every time you add something.
That's excactly the reason why I started to think about saving so late. On the other hand it would have been very smart to think about saving in the beginning as stu said and just implement it now. Too late!
I now keep a hash for all of the game object types and register and unregister things I create or destroy there. All of these hashes use pointers as key. Glib offers black-magic macros to hide integers in pointers, thus allow me to use unsigned integers as object ids and store them where these objects are used. When finished (20% done) saving will be a piece of cake (I keep telling me).
@Slash: Many times I cursed my decision to use C and wished I had used something that offers handy high level functionality and does not waste so much time. Too late, as well.