AD
Finder of things, Doer of stuff
Since ODVS' AI enhancement thread is getting a bit long and somewhat fragmented with a few different discussions happening, I figured I would break out and try and document what we *do* know about the WC3 3DO video in one place. Over the years various people have made good progress on decoding the 3DO videos though no actual tools have ever really come about from it. What's more, not having access to the raw video files makes side by side comparisons with the PSX version's videos difficult to gain any real meaningful data from. The PSX and 3DO versions both have benefits and drawbacks and ideally it would be cool to find a way to use both versions as a kind of hybrid source for some upscale in the future. @HCl made some progress on creating a decode for the videos but didn't actually release any tools for converting them into a usable format.
I'll try and post a bit of what he did say about the format from the discussions I did have with him with the hopes that someone actually technically skilled in this stuff can actually pick up where he left off. Also note that the sample video mentioned *is* still on HCl's solsector site so if people like @ODVS want to experiment with it, it's there.
Another barrier to 3DO video testing is that there's a few hoops to go through to actually get to the video files. Once a person breaks open the 3DO disks (use a tool like 'opera decompiler' or unCD-ROM) the videos are stored similarly to the PC version, in an archive file of sorts. Instead of a TRE file the 3DO has BUNs. The BUN format has previously been documented but as far as I know, nobody has actually released any tools to extract all the files therein. Here's some info on Bun files: http://wiki.xentax.com/index.php/Wing_Commander_3_BUN
Further, it might be helpful for anyone attempting to work with this stuff to take a look at some of the original developer documentation for hte 3DO and how the graphics processing on the system works:
Note that if you are looking for 3DO video files, the WC3 demo on the 3DO sampler CD is available for download on WCNews but it has a somewhat different video format from the Full game version.
I'll try and post a bit of what he did say about the format from the discussions I did have with him with the hopes that someone actually technically skilled in this stuff can actually pick up where he left off. Also note that the sample video mentioned *is* still on HCl's solsector site so if people like @ODVS want to experiment with it, it's there.
I've been making some progress lately on documenting the WC3 3DO VGA chunk. I still don't have it completely documented, but here's an update just to keep you up to speed:
>
> So far, i've been able to confirm it is indeed very close to the PC version: 22 opcodes for image operations, huffman compressed, along with a variable-byte length block, motion compensation block and encoded pixel block. The content of these smaller blocks within the VGA chunk seems to be pretty much the same between the PC and 3DO versions, with only minor differences, such as pixels in CEL format instead of 8-bit VGA palette (which the PC version further compresses with the same dictionary-based algorithm used by other WC games, such as Super Wing Commander) .
>
> As an aside, observing the evolution in cut-scene encoding between WC2-SWC-WC3 is really exciting! The principles behind WC3 movie decoding turn out not to be that much different from the WC2 take off / landing animations (although WC2 is much simpler... and usually decodes the movie over one or more still backgrounds, encoded separately and triggered at different points).
>
> Anyway, the main difference between the 3DO and PC versions seems to be the image operations used by the main algorithm. While both use 22 opcodes for encoding the image, these have different meanings on the PC and 3DO versions. Gone is an opcode which handles a 3-byte run-length (which makes sense, given the movie resolution, 2-byte lengths are always enough), while other opcodes simply do something else... so the challenge right now is to document the changes and adapt the decoder accordingly.
>
> I think i'm getting close! In between data-analysis and binary disassembly, i hope to be able to dig up this information and integrate it on my script. I'll keep you informed as I go...
________________________________________
Good news here, i finally have all the details figured out for the 3DO compression algorithm, and managed to complete my script for decoding the video. I posted a sample here:
>
> http://hcl.solsector.net/sc_13.mov.avi
>
> I'm still running a few tests to make sure no bugs remain although, given the output, if there's still any bugs remaining they're likely to be pretty minor.
>
> Overall, what we have on the 3DO is a variation of the PC algorithm, with a few changes in order to take into account the CEL hardware and 3DO frame buffer memory layout. That's basically it. You get increased color depth when compared to the PC version (and without those "sticky pixels"), and don't get the somewhat blurry artifacts of the PSX movies resulting from the JPEG-like compression.
>
> Movie resolution is actually slightly lower, since it's 300 pixels wide instead of the 320 pixels both on the PC and PSX. Interestingly, however, the VGA chunks still encode the frame changes expecting a 320-pixel wide frame buffer (probably in order to fit the 3DO frame buffer), which means that if the CEL chunks (keyframes) are smaller than that, they are rendered on the center of the buffer.
>
> You'll note the video I posted doesn't have any audio. I think it is compressed with some kind of ADPCM algorithm, i just have to figure out if the decompression is done by the CPU or the 3DO DSP, and then dig in and figure out what's going on. I expect audio quality to be fairly close to the PSX videos though.
Another barrier to 3DO video testing is that there's a few hoops to go through to actually get to the video files. Once a person breaks open the 3DO disks (use a tool like 'opera decompiler' or unCD-ROM) the videos are stored similarly to the PC version, in an archive file of sorts. Instead of a TRE file the 3DO has BUNs. The BUN format has previously been documented but as far as I know, nobody has actually released any tools to extract all the files therein. Here's some info on Bun files: http://wiki.xentax.com/index.php/Wing_Commander_3_BUN
Further, it might be helpful for anyone attempting to work with this stuff to take a look at some of the original developer documentation for hte 3DO and how the graphics processing on the system works:
Note that if you are looking for 3DO video files, the WC3 demo on the 3DO sampler CD is available for download on WCNews but it has a somewhat different video format from the Full game version.