Jump to content

Ultraq

Fremen
  • Posts

    6
  • Joined

  • Last visited

    Never

Reputation

0 Neutral

Profile Information

  • Location
    New Zealand
  1. Re: Dune 2 SHP file format - In conjunction with the document mentioned above, I added my findings about the format, and wrote something about it in the source code for my Dune 2 SHP file converter: /* * ====================== * 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. */
  2. Seems I might be a bit late in helping with Format80, but I thought I'd throw this in here in-case somebody finds it useful. MrFlibble mentioned my name somewhere in this post as I've been writing Dune 2 conversion utilities for him, and in the process have ended-up writing an encoder/decoder for the Format2/40/80 compression formats used by Dune 2 and C&C. The thread for these tools is here: http://cnc-tech.planetcnc.gamespy.com/index.php?showtopic=3699 The source files are available with the download, but the thing is it's written in Java. If you can read Java then you're probably most interested in the encoding/decoding part which is all done in 1 utility class in my program. I've uploaded a copy of that class with the Format2/40/80 encoding/decoding methods here: http://ultraq.orconhosting.net.nz/CNCCodec.java
  3. With all this progress on these Dune 2 modding tools, it must be a good time to be you eh MrFlibble ;)
  4. Yo MrFlibble, It's been a while, but I haven't forgotten your request to allow for the creation of those Dune 2 SHPs with multiple images in them. I've updated my conversion utility to allow for this, but I haven't been able to give it a really good test. Details for the latest version are in the same thread: http://cnc-tech.planetcnc.gamespy.com/index.php?showtopic=3699 You'll probably be looking at using the new mpng2shpd2 (multiple PNG -> Dune 2 SHP) batch file. Usage instructions included in the program aren't the best, but basically if you want to turn several PNG files into a Dune 2 SHP, you have to name them the same, except for a 3-digit number included at the end of the filename, eg: image000.png image001.png image002.png Then use "image.png" (minus quotes) as the source file name. I think you'll be able to figure it out once you give it a try. Hopefully this should give you the ability to create those Dune 2 SHP files which have multiple images of different dimensions in them. As always, feel free to reply to that CNC-Tech forum thread to tell me about problems/suggestions for the tool. (I've also posted this to your PPMSite forum thread).
  5. Carrying-on from my last post, I've written a basic C&C SHP File -> Dune 2 SHP file converter. Details can be found in this forum thread. It seems to work for C&C's mouse cursors, so I'm not 100% sure if it will work with Dune 2.
  6. Have you happened to find any? I'm also kinda interested in the Dune 2 SHP file. I'm currently working on a FreeCNC-like program, and a request came in from a modder of the original C&C for a Dune 2 SHP file format creation utility (the C&C mouse cursors are based on this format, and he wishes to modify the cursors). So far I've managed to read/load the Dune 2 SHP file into the game engine I've developed. The next step would obviously be saving a Dune 2 SHP file. I'm well on the way to doing that (maybe a few weeks until completion, you can thank some recently released games for that ;D), but I'm still looking around for any additional resources to help me out. So far I've got the source code to XCC Utilities, FreeCNC, as well as this semi-helpful document on the Dune 2 SHP file. With this topic being about a month old now, I'm wondering if you've managed to find anything which could be helpful? Thanks.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.