Posted: Thu Nov 21, 2013 8:14 am Post subject:
RA1 mouse.shp
Subject description: Decoding that thing
Since it doesn't seem like it's documented anywhere: what format is Red Alert's "mouse.shp" in?
I know VK decoded it at some point, but didn't share the sources. I know the OpenRA guys must have decoded it somehow, but I'm not really keen to hunt through all of their sources right now. Their "Dune2ShpReader", however, seems to read it the way I assume it to be encoded. Is RA's "mouse.shp" in Dune2k SHP format? QUICK_EDIT
Joined: 22 Nov 2010 Location: Iszkaszentgyorgy, Hungary
Posted: Thu Nov 21, 2013 2:03 pm Post subject:
It's in pure Dune2 format., not Dune2k.
I have a source from a redhorizon project, (can't remember where I found it) which says the following about it:
Quote:
/*
* ======================
* Dune 2 SHP file format
* ======================
*
* The Dune 2 SHP file, is a multiple image filetype, where each image can have
* it's own set of dimensions. The file is structured as follows:
*
* File header:
* NumImages (2 bytes) - the number of images in the file
* Offsets[NumImages + 1] - offset to the image header for an image. The last
* (2 or 4 bytes each) offset points to the end of the file. The offsets
* don't take into account the NumImages bytes at the
* beginning, so add 2 bytes to the offset value to
* get the actual position of an image header in the
* file
*
* The size of the offsets can be either 2 or 4 bytes. There is no simple way
* to determine which it will be, but checking the file's 4th byte to see if
* it's 0, seems to be a commonly accepted practice amongst existing Dune 2 SHP
* file readers:
*
* eg: A 2-byte offset file: 01 00 06 00 EC 00 45 0A ...
* A 4-byte offset file: 01 00 08 00 00 00 EC 00 ...
* ^^
* The marked byte will be 0 in 4-byte offset files, non 0 in 2-byte offset
* files.
* Lastly, like C&C SHP files, there is an extra offset, pointing to the end of
* the file (or what would have been the position of another image header/data
* pair).
*
* Following the file header, are a series of image header & image data pairs.
* The image header is structured as follows:
*
* Image header:
* Flags (2 bytes) - flags to identify the type of data following the
* Datasize field, and/or the compression schemes used
* Slices (1 byte) - number of Format2 slices used to encode the image
* data. Often this is the same as the height of the
* image
* Width (2 bytes) - width of the image
* Height (1 byte) - height of the image
* Filesize (2 bytes) - size of the image data in the file
* Datasize (2 bytes) - size of the image data when Format2 encoded/compressed
*
* Regarding the flags, there seem to be 4 values:
* - 00000000 (0) = Decompress with Format80, then Format2
* - 00000001 (1) = (see 3)
* - 00000010 (2) = Decompress with Format2
* - 00000011 (3) = A small 16-byte lookup table follows, and the image data
* should be decompressed with Format80 then Format2.
* - 00000101 (5) = The first byte gives the size of the lookup table that
* follows, and the image data should be decompressed with
* Format80 then Format2.
*
* And after this image header is the image data.
*/
_________________ "If you didn't get angry and mad and frustrated, that means you don't care about the end result, and are doing something wrong." - Greg Kroah-Hartman
=======================
Past C&C projects: Attacque Supérior (2010-2019); Valiant Shades (2019-2021)
=======================
WeiDU mods: Random Graion Tweaks | Graion's Soundsets
Maintainance: Extra Expanded Enhanced Encounters! | BGEESpawn
Contributions: EE Fixpack | Enhanced Edition Trilogy | DSotSC (Trilogy) | UB_IWD | SotSC & a lot more... QUICK_EDIT
Joined: 22 Nov 2010 Location: Iszkaszentgyorgy, Hungary
Posted: Fri Nov 22, 2013 12:44 pm Post subject:
Dune2k is a remake of Dune 2 on a highly customized, Red Alert-derived engine. Just sayin'.
Meanwhile I found out that OpenRA guys also used this redhorizon documentation for their implementation. _________________ "If you didn't get angry and mad and frustrated, that means you don't care about the end result, and are doing something wrong." - Greg Kroah-Hartman
=======================
Past C&C projects: Attacque Supérior (2010-2019); Valiant Shades (2019-2021)
=======================
WeiDU mods: Random Graion Tweaks | Graion's Soundsets
Maintainance: Extra Expanded Enhanced Encounters! | BGEESpawn
Contributions: EE Fixpack | Enhanced Edition Trilogy | DSotSC (Trilogy) | UB_IWD | SotSC & a lot more... QUICK_EDIT
Dune2k is a remake of Dune 2 on a highly customized, Red Alert-derived engine. Just sayin'..
Its actually not based on any of the Pre SAGE engines, it is in fact a new engine and only contains some code from the WWLib, mostly the VQA lib. QUICK_EDIT
Joined: 26 Apr 2003 Location: Somewhere in Germany
Posted: Fri Nov 22, 2013 3:07 pm Post subject:
CCHyper wrote:
Graion Dilach wrote:
Dune2k is a remake of Dune 2 on a highly customized, Red Alert-derived engine. Just sayin'..
Its actually not based on any of the Pre SAGE engines, it is in fact a new engine and only contains some code from the WWLib, mostly the VQA lib.
Yeah, most people don't seem to know that D2k and E:BFD were made by external studios contracted by WW (just like Kane's Wrath). That's why the D2k engine is more advanced than TS in some areas (scrolling while selecting, 24-bit images). QUICK_EDIT
Gee, I find it weird how this format practically does a two-layer runtime length encoding... anyway, I got it decoded, thanks again!
Frame #35 is all black, I suppose that is correct? QUICK_EDIT
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum