.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   WinSPWW2 (http://forum.shrapnelgames.com/forumdisplay.php?f=139)
-   -   OT: looking for zovs66 (http://forum.shrapnelgames.com/showthread.php?t=52169)

ErikCumps April 8th, 2019 05:08 PM

Re: OT: looking for zovs66
 
Hi Mark,

The savegame data is stored in multiple blocks, some compressed and some not.

This comment from my source code explains it quite well, I think:
Code:

/* This is the SPWaW/winSPWW2 savegame file format:
 *
 * A savegame is a contiguous set of several data blocks.
 *
 * The first data block is the game info section.
 * This is a fixed-size data block containing the savegame marker.
 * (which is currently "SPWAW_SAVE_V101"/"SPCTS_SAVE_V100" for SPWaW/winSPWW2)
 *
 * The other data blocks contain the savegame section data.
 *
 * Each data block consists of:
 *        a data block header
 *        the section data.
 *
 * The fixed-size data block header describes the section data that follows:
 *        the identification number of the section
 *        the size of the section data
 *        a flag indicating if the section data is compressed or not
 *
 * Uncompressed section data can be loaded as-is.
 *
 * Compressed section data must be decompressed after loading.
 * The actual size of the section data will be larger than the size of the section data in the file.
 */

/* This is the SPWaW/winSPWW2 section data compression format:
 *
 * Compressed section data is a contiguous set of run-length coded data blocks.
 *
 * There are two types of run-length coded data blocks:
 *        uncompressed run-length coded data (URLC)
 *        compressed run-length coded data (CRLC)
 *
 * Each run-length coded data block consists of:
 *        a run-length coding byte (RLB)
 *        one or more data bytes
 *
 * A compressed run-length coded data block is used to for sequences of identical data bytes:
 *        the RLB indicates the number of identical data bytes (N)
 *        the RLB is followed by a single data byte (B)
 *        the decompressed data is the sequence of N times the data byte B
 *
 * An uncompressed run-length coded data block is used for sequences of data bytes with mixed values:
 *        the RLB indicates the number of data bytes that follow (N)
 *        there is at least 1 and maximum 127 data bytes
 *        the N data bytes can be copied as-is
 */

The concrete block header layout for winSPWW2 is this:
Code:

#pragma pack(push, r1, 1)
typedef struct s_BLOCKHEAD_WINSPWW2 {
        unsigned int        section;
        unsigned int        size;
        unsigned char        flag;
} BLOCKHEAD_WINSPWW2;
#pragma pack(pop, r1)

If the 'flag' value is 0, the section data is NOT compressed.
If the 'flag' value is 1, the section data IS compressed.

Note: the two #pragma's you see are not part of the actual data layout, they are just hints to the compiler that it should respect the data layout as is and not insert additional padding between fields.

Hope this helps,
Erik

Second-MaƮtre Laurent October 17th, 2019 01:45 PM

Re: OT: looking for zovs66
 
Hi Erik

Is Warcab work for SPWW2?

For I'm playing Omaha Beach Scen. (Scen #9) and I'm on turn 16. At this point, it's a mess and I want to point my units, as in the unit menu, on a printed sheet. For, for me, it would be more convenient than to read it on the screen.
I know I'm quiet weird, but that's my way to doing things: I'm from the paper generation yet


All times are GMT -4. The time now is 01:40 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.