B0 M 7M2XS, ;@0MM 20 MWXrX '03 .XM M 2M7 M X@ :,. MM M MM .. M2 M ;a WM ,. MMBMX M ,22iM. M MX MM ar 2, Xa. SM aa;7M 8W@ MMr Mi ,0a M7XS a iZXiM ;Z 0 r @W; M M M 7iW@ M W M7M 8 S X7M M Ba M. 2i70 M 0 i M .M W M2.. ir @ M,M M MZX M M i Zr:2 Z M M 7Z 0M M ;S 7B 2 M MMr0 M ra M; M MMZWM aXM MaSZMMX SXZMMM,MM MM MM 8M XBM0M, Wa2S0MM MX ;SMMMM.MX MM ----;X-----B--------S----..:i-i;--.------------0---------------ii--------------------,---r0---- Galactic Civilizations .SPR1 File Format Hacked Researched by Dark Rain / Black Heaven (rochdenis@hotmail.com) v0.0.4 ====== Introduction To SPR1 Files ========================== SPR1 files contain sprites for galactic civilizations. I assume it's short for Sprite, beats me why there's a 1. A version number maybe? Notes ===== For this text, I assume that a char is one byte, a short 2 byte and a longword 4 byte. The SPR1 Header =============== Variable Name Size ============================ Unknown1 Short Unknown2 LongWord SpritesNb Short .. 12 bytes of unknown stuff .. EndHeaderPtr LongWord Attributes Definition ===================== Unknown1 - Looks like padding so far. Unknown2 - It looks like it's used to tell if the image is 8 bit or 16 bit. Haven't seen another type yet but I assume it's only a matter of looking at enough files. (Wild guess here). SpritesNb - The number of frames in the SPR1 book. EndHeader" - A pointer to the header at the end of the file, more on this later. After the header, there's a list of LongWord pointers to the various sprites. Obviously the number of pointer is the number of Sprites. If a sprite has no graphic, the pointer value will be FFFF FFFF ( 429 4967 295 ). The adress is relative to the end of the pointer list, so the pointer to the first sprite will pretty much always be 0000 0000 unless the sprite is empty. The Picture Header ================== Variable Name Size ============================ Unknown Short Width Short Height Short Offset_x Short Offset_y Short .. 12 bytes of unknown stuff .. Attributes Definition ===================== Width - The width of the image Height - The height of the image Offset_x - The x offset of the image Offset_y - The y offset of the image The offset are used in game to center the image as if it was say a 50x50 image. That way all the sprites that have been cut down from 50x50 to something else will look like they're stil 50x50. Right after this header, it's the pixel data. It's not raw pixel data, so you have to parse it a bit to get the original image. The pixel data start with a short telling you how long in byte the next block of data is. After that, there's what seem to be two byte. Not too sure what the first one is and the second one is the number of pixels in this data block. The End Of File Header ====================== Variable Name Size ============================ Unknown Short From the end of the file, you can see the sprite sequences. Each sequence name is a null terminated string followed by a Char representing the index where the sequence ends. The index should be inside the number of frames but I've noticed that Mutil will keep the old chapters even if there's nothing in them, so you should check for that before assuming it's a valid index. It looks like this in a hex editor : .0ColonyShip_Default_A32C1. .0ColonyShip_Icon_A1C1.!.0ColonyShip_Icon24Trans_A1C1.".End. The "." are null characters, " ", "!" and " between the strings null characters are the index I was talking about. Greetings ========= · Saruman & Bobban / DFR Engineering. · The old EVA crew and NS Hard Rock Save!