Page 1 of 1

The format of the POP2 save file

Posted: December 11th, 2008, 10:47 pm
by David
I haven't seen this anywhere, and some people were asking for it, so here is the format in C language:

Code: Select all

struct TPop2SaveFile {
   short unknown; // must be between 0 and 10
   char names[25][10];
   struct TSaves {
      short checkpoint; // 0=beginning of level
      char uk02;
      char uk03;
      short time_minutes; // +1
      short time_ticks;
      char level; // 0x00=title, 0x01-0x0E=level 1-14, 0x0F-0xFE=quit with error, 0xFF=freeze
      char hitpoints; // 0x00=no move, 0x01-0x7F=1-127 hp, 0x80-0xFF=1 hp, but not shown
      char direction; // 0x00=right, 0xFF=left, other=left, and can't turn right
                      // unused if checkpoint==0
      char startpoint; // 0x02=alternative (level 7 only)
      char sword; // 0x01=long, 0x02=short, 0xFF=none, other=prince long, guard none
                  // unused if checkpoint==0
      char uk0D;
      char uk0E;
      short upside_down; // remaining time?
      char time_started; // 0x00-0x7F=yes, 0x80-0xFF=no
      char uk12;
      char uk13;
      char uk14;
      char uk15;
      char uk16;
      // the following are unused if checkpoint==0
      char fg[960]; // foreground data, same format as in prince.dat
      char bg[3840]; // background data, same format as in prince.dat
      char sg[3712]; // static guard data, same format as in prince.dat
      char dg[1088]; // dynamic guard data, same format as in prince.dat
   } saves[10];
};
EDIT: added startpoint

Re: The format of the POP2 save file

Posted: December 15th, 2008, 9:56 am
by BlackChar
POP1 file format specification wrote: Remaining ticks
Seconds are stored in ticks, a tick is 1/12 seconds. To get the time in
seconds you have to divide the integer "Remaining ticks" by 12.
This should go for POP2 too. There used to be a link to this document on the old princed page, but it's gone. But I can try to dig through the internetz and post some stuff back, if you need to :)

Re: The format of the POP2 save file

Posted: January 27th, 2009, 9:22 pm
by poirot
once again, thank you david!