game-development

quicksaves

if you have not guessed.. i've been using my blog to think out loud.

i think that i want to handle quicksaves as a form of versioning. one problem with this is that you need to know how things changed. there are two ways to do this.. keep track of the changes or diff against a previous version. because it is a "quick"save that pretty much only leaves a single choice. diffing the complete state of everything against the complete state of a previous version is not really something you can do in under a second.

keeping tracking of changes is not fun and is error prone. luckilly (i think) i don't really need that and can just be a bit sloppy. instead of change i can just mark states as dirty. while still a pain in the ass it is much easier than really tracking changes. a nice feature is i can be lazy if at first (of forever) and just mark an entire object dirty if anything changes.

here's what it looks like..

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

this/
{
   GlyphNodes/
   {
      MinimumCapacity=3;
      donkey_friendly/
      {
         LocalPosition={20.0 0.0 0.0};
      };
      donkey_mean/
      {
         LocalPosition={30.0 0.0 0.0};
      };
      somebullet=ref file://robote/models/bullet.model
      {
         LocalPosition={0.0 10.0 0.0};
      };
                someotherbullet=nullptr;
   };
};


yes that path is scary long. i'll explain that in a later post, but it has to do with networked versioning.

it kinda naturally fell out like this. it also supports the addition of new objects and the the deletion objects too (set to nullptr). new objects would internally require a new 'dirty' list and deletion would also require a dead 'dirty' list.

so looking at this it seemed pretty nice. maybe even nicer than what i had before for the other stuff!

Code:
----------------------------------
robote/glyphnodes/Donkey.glyphnode

origin=new cli://gamebasis/code/GlyphNode()
{
   LocalPosition={0.0 0.0 0.0};
   TheGlyph=ref file://robote/glypharrays/donkey.glypharray/skin;

   Childs/
   {
      MinimumCapacity=1;
      torso=new cli://gamebasis/code/GlyphNode()
      {
         TheGlyph=ref file://robote/glypharrays/donkey.glypharray/torso;
         Childs/
         {
            MinimumCapacity=1;
            hips=new cli://gamebasis/code/GlyphNode()
            {
            };
         };
      }
   };
};


what ends up happening is the generalization of how containers work. a path is a container, just like an array of glyphnodes is a container. first you check for an existing name, if one does not exist, you create one. quite nice. even better.. no crazy ~=

and i thought i was getting close to a final format. while it is annoying that i don't have the time to actually do proper work or coding on this stuff.. it is nice to over think this stuff to death!