game-development

more quicksaves

i just spent the last half hour sitting the 'sitting chair' trying to figure out how the hell my quicksave stuff from yesterday even worked. apparently it was oh soooo obvious to me that remembering it, let alone writing it down was not important.

this time i will write it down.

marking things dirty really is like a timestamp back to when the data was loaded in. ie. this data is dirty and will always be dirty. that gives a reference point to compare against. there is nothing relative about it. things can only get more and more dirty until you end up writing out the entire freak'n database.

ok. that's not really the problem part. the problem part is the creation and deletion of objects. if you keep track of all creations and deletions the relative booking keeping of those will eventually take up more space than an absolute snapshot of your database.

so that sucks, but if we think about about it the same way as marking things dirty. as in.. wrt to when the database is first loaded (let's call that time zero) then some assumptions can be made.

if we keep a sort of timestamp with our objects then we can quicksave out only 'new' objects not created at time zero. there is no need to save out deletions (this is actually a realization since yesterday). what you do is upon load is first just freak'n delete ALL non time zero objects in the database before you load your quicksave in. that's it. (i think that's it at least. it's past my bed time.)

Code:
---------------------------------------------------------------------------------------------
robote/quicksaves/billy/localhost_2006mar25_211010/2006mar25_225125/robote/maps/fancyland.map

quicksave
{
   map
   {
      GlyphNodes
      {
         MinimumCapacity=3
         donkey_friendly
         {
            LocalPosition={20.0 0.0 0.0}
         }
         donkey_mean
         {
            LocalPosition={30.0 0.0 0.0}
         }
         somebullet=new file://robote/models/bullet.model/model()
         {
            LocalPosition={0.0 10.0 0.0}
         }
      }
   }
}


yes i changed the format more. hush!

ps.. i really need to stop using the word 'database.'