News:

11 March 2016 - Forum Rules

Main Menu

A foray into old Sega PC game formats

Started by 4lorn, November 13, 2019, 01:54:58 PM

Previous topic - Next topic

4lorn

Hi. Lately I've been curious about old Sega PC game file formats. By Sega PC I mean titles released during the '90's, such as Daytona Deluxe and Panzer Dragoon. Making these run is almost always a battle in itself, but some weeks ago I installed and looked into Daytona Deluxe's folders. There were numerous files with the extension BMP but none could be opened by any kind of image editor. With a hex editor, I looked inside and noticed the SZDD header.

It seemed familiar but I couldn't quite remember where I'd seen it before, so I did some digging. Turns out it's a simpler but weaker form of LZSS compression Microsoft used back in the day, primarily included in many Windows software distributions that used the InstallShield installation software (an example would be files named _INST32I.EX_ ).

For smart people (ie, not me), an SZDD file begins with this fixed header:

Offset Length Description
0x00 8 "SZDD" signature: 0x53,0x5A,0x44,0x44,0x88,0xF0,0x27,0x33
0x08 1 Compression mode: only "A" (0x41) is valid here
0x09 1 The character missing from the end of the filename (0=unknown)
0x0A 4 The integer length of the file when unpacked


The header is immediately followed by the compressed data.

And wouldn't you know it? The decompression is still available in modern day Windows through the Command Shell. To unpack something on your desktop, you'd use

C:\Users\USERGUY\Desktop>expand FILENAME.extension NEWFILENAME.extension

or to use one of Daytona USA Deluxe's file as an example:

C:\Users\USERGUY\Desktop>expand pressenterkey.bmp pressenterkey

The extracted file can now be read by any image editor that supports BMP files. Just be careful: the program will replace the original file if you expand it with the same extension. Also, you don't need to extract them with an extension - they'll open just like regular bitmaps in your editor of choice (my favorite method).

That's about half the battle, though: how do we compress it back? Well, it seems that while the decompression algorithm is still present (presumably for compatibility with old software distributions), there doesn't seem to be a way to compress it - not in the same way, at least. However, through the Command Shell, you can

C:\Users\USERGUY\Desktop>compact /c untitled.bmp

While it doesn't seem to compress the file as much, the end result can still be read by Daytona USA Deluxe. You'll note the file's thumbnail will also show two blue arrows indicating the compression:



And here's a proof of concept:



Not sure how the image handles transparency yet (note the slight pink outline) but you get the point. Something to look into in the future, perhaps. Also, sorry about the cellphone picture: the game doesn't like Print Screen.

So far, I've found this compression method present in Daytona USA Deluxe and Panzer Dragoon, though I'm still trying to catalogue all the games that feature it. SZDD is used for almost every file in these two games but some files are not images at all. Two other file extensions are present: MDL and TEX. The MDL files might be models (there's a YouTube video showcasing someone swapping/renaming the MDLs of the special cars and using them without having ranked 1st on all tracks). The TEX files, I assume they might be textures but have no idea of what - I suspect they may be the textures of the tracks (like advertisements and billboards; maybe the START you see on the above picture) or maybe even the cars.

Panzer Dragoon however, is a mystery to me. The same compression is present but I can't read any of the formats. Curiously though, there are files with a EVAW header, which I assume are just WAV format but can't be read right off the bat (Daytona uses the RIFF format for audio stuff).

Apologies if the info about this was common knowledge; I pretty much found this on my own and thought I'd share. Incidentally, has anyone ever looked into these kinds of files? This kind of thing might facilitate mods and translations.



Jorpho

It sounds a teeny bit familiar, but then I haven't delved much into the Sega hacking scene.  (There are definitely others who have, though.)

I think Panzer Dragoon used quadratic surfaces in its models (see https://en.wikipedia.org/wiki/NV1 ), so they're likely to be weird and nonstandard.
This signature is an illusion and is a trap devisut by Satan. Go ahead dauntlessly! Make rapid progres!

4lorn

#2
So, got Manx TT Superbike running with limited success. Windows 10 absolutely refuses to install the game under several compatibility modes, but I managed to play the game by running the main game executable itself. Manx doesn't seem to have SZDD encoding but has a handful of cute quirks.

DATA folder

X.SKY - All *.sky files have BM6 headers and open like ordinary BMPs. As the name implies, they're the skies used for the tracks.
X.PAL - Palette files for each course, probably, but have no header and aren't opened/converted by anything yet.
X.VMC - No headers, but so they are all related to images/textures used on the tracks. This is FONT1.VMC viewed inside HxD with 512 bytes per row:



Another example is LAXEY.VMC (Laxey is the first course in the game), again through HxD with 512 bytes per row:



The LAXEY.VMC file contains more stuff used in the course (Honda, Castrol and SEGA, for instance).

X.RBH - It declares a PIFF header but is followed by RBH, and the file has references to "BODY", which I thought might be model related. A little digging turned up that House of the Dead for PC also uses the same file format for its models; YouTube user egregiousguy shows some videos of him exporting the levels into Blender as *.obj, with some hex editing and scriptlets to convert the raw data into vertice data. This might apply to Manx TT Superbike as well, though I can't confirm this now (it takes ages to be that good).

ENGLISH folder

More RBH and VMC files. The VMCs here can be seen pretty much like the other ones and they're mostly concerned with menus. PANEL2.WMC has stuff like "YOU", "YES" and "NO" in the same way LAXEY.VMC does, but requires a bit more fiddling to spot all words.

MOVIES folder

X.PMM - The PIFF header once again, but this time followed by PXM info.

On the game's main folder, the files GAMESNDS.RBH and MENUSNDS.RBH bring up the PIFF header and RBH data again, but these are apparently sounds: another YT user has replaced the PC versions announcer voices with audio mixed from the Saturn and arcade version. His mod are just replacement files for the files I mentioned. My take on this is that PIFF might just be a variant of RIFF, the Resource Interchange File Format by Microsoft, itself based on Electronic Arts' Interchangeable File Format; and RBH some kind of resource file. Would PXM be actually PCM files, though? That's for another day.



November 18, 2019, 02:28:20 PM - (Auto Merged - Double Posts are not allowed before 7 days.)

Quote from: Jorpho on November 13, 2019, 11:10:25 PM
It sounds a teeny bit familiar, but then I haven't delved much into the Sega hacking scene.  (There are definitely others who have, though.)

I think Panzer Dragoon used quadratic surfaces in its models (see https://en.wikipedia.org/wiki/NV1 ), so they're likely to be weird and nonstandard.

Sorry Jorpho, I hadn't seen you reply. You're right and I think the only Sega games with exclusive NV1 support on release were Daytona, Panzer Dragoon, Virtua Cop and Virtua Fighter Remix. Titles like Virtua Cop 2, HotD1/2 and others didn't have any.

I've had limited success with the TEX files of Daytona USA deluxe, in the sense that, taking the first course as an example, you can find some things with Tile Molester (4bpp linear reverse order, 2 dimensional mode and mirror): the slot maching 777 is there, for instance, but most of it seems a pain to edit, though.

So far, I've only found ZSDD compression is Daytona. Games like Manx TT Superbike, Sky Target, Virtua Fighter and Virtua Cop don't use it, though these present their own particular challenges.

Also, much of Virtua Cop *can* be found in its *.tex files with Tile Molester. The more standard options are 8bpp linear and 2 dimensional mode, though many other things are noticeable under 3bpp and 4bpp linear, and 16/24/32bpp ABGR. The issue I'm having is some edits don't seem to have any effect, and I'm left wondering if the game is instead reading and forcing information from the CD (other than the music).

4lorn

#3
So. This is some data about Panzer Dragoon, using mostly Tile/Sonic Molester Pro. PZ also uses SZDD compression, by the way. For reference:
1D = 1 Dimensional
2D = 2 Dimensional
Col = # of columns (when applicable)
Row = # of rows (when applicable)
bpp = Color Codec. Usually, PD graphic data is best viewed at 16bpp ARGB, but other data can be seen at other bpp. When I say 16bpp, it's implied I'm talking about ARGB. When I say 4 or 8bpp, it's assumed I'm talking about Linear.


PANZER DRAGOON


ascii.cgx   - 1D, 16bpp: A standard font (not the main one used by the game, unfortunately)
ascii.cgy   - 1D, 8bpp: as above but smaller
ascii.cgz   - 1D, 16bpp: as the .cgx version


Demo - "DemoX" files relate to the cutscenes. Numbers in () indicate the order the lines are spoken.


demo1.cgx   -    2D + 16:
  25 col = To all ships, prepare for battle. (3)
  32 col = Transmission from the patrol ship, sir. (1)
  33 col = We must capture that Dragon at all costs. (6)
  35 col = The target has been located in sector No. 12. (2)
  38 col = Inform ground troops to position wire barricade. (4)
  7 col = Yes, sir. (5)

You can also see other textures such as FX and parts of the dragon at 10, 12, 15, 16, 17, 20 col (there's more stuff w/other number of col but these are the main ones). Interestingly, if the dialogues in the cutscenes are simply images, I suspect it might be easier for anyone looking into translating the game.

demo1.cgy   -   2D + 8
      Different column numbers will show the same as demo1.cgx. 16bpp shows
      the cutscene dialogs too but with smaller letters. Maybe meant for different resolutions/color depths.

demo1.cgz   -   2D + 16
      Like demo1.cgx, but with different palettes

demo_1.pta  -   2D + 8 linear
      ...Something. Seems like an animation. 128 col x 4 rows (or vice versa) for best viewing angle, I think.

demo_1.ptb  -   no idea

demo_5.pta  -   same as demo_1.pta

demo_5.ptb  -   same as demo_1.ptb

demo5.cgx   -   same as demo1.cgx. Also contains water splash textures and:
      35 col: All ground units mobilized, initiate operations and secure the area. (2)
      39 col: Instructions from Unit 01 received and confirmed. (1)

demo5.cgy/z -   same as demo1 file extensions applied to demo5

demo8.cgx   -   same as demo1 and 5.cgx. Dragon wing textures @20 col.
      18 col = Unit 01... Confirmed. (1)
      39 col = After rendezvous, take Unit to full strength. (2)
      Note: at 20 and 15 colums, can clearly see textures of the last boss.

demo8.cgy/z -   same as demo1 file extensions applied to demo5

ending.pta  -   same as other .pta
ending.ptb  -   same as other .ptb


XXX_D1/D5/D8 - These files also apply to cutscenes.


gr2_d1.bgx  -   2D + 16bpp, 32col x 16row - a sky texture
gr2_d1.bgz  -   2D + 8bpp, 32col x 16row - seems like a heightmap with RGB separation for the sky texture
gr2_d1.bgy  -   as above, but with different tones (orange+purple instead of greens and reds);
      for some reason this file always gives an error when expanded
      ("Error in compressed input file format: gr2_d1.bgy")

gr2_d5.bgx  -   2D + 16bpp, 32col x 16row - a water texture
gr2_d5.bgz  -   same as _d1.bgz but for the water texture
gr2_d5.bgy  -   same as _d1.bgy but for the water texture

gr2_d8.bgx  -   2D + 16bpp, 32col x 16row - the same water texture
gr2_d8.bgz  -   same as _d5.bgz but for the water texture
gr2_d8.bgy  -   same as _d5.bgy but for the water texture


GR2_RX - There are several types of files afterward, all following the same pattern. From gr2_r0 to gr2_r7, with the same extensions: BGX (image), BGZ and BGY with RBG separations. The BGX files include (32column x 16row values):


r0 - water reflections inside the sunken palace on the first level
r1 - water reflections outside the palace
r2 - sand and dunes on the second level
r3 - 99% sure it's the rocky ground texture for level 3
r4 and r5 - trees used at the end of ep4 and throughout the fifth level
r6 - dark green water on level 6
r7 - quite likely the dark blue water from the final chapter

gr2_ti.bgy  -   2D + 16bpp, 32x32 size: some ground texture, but not sure from where. pattern is wonky, or I didn't find the correct values and codec
gr2_ti.bgz  -   ??? beats me. However, it might well be similar to the RBG separation structure like previous files.

grn_d1/_d5/_d8.bgx - same as gr2_d1/_d5/_d8.bgx
grn_d1/_d5/_d8.bgy - same as gr2_d1/_d5/_d8.bgy
grn_d1/_d5/_d8.bgz - same as gr2_d1/_d5/_d8.bgz

From grn_r0 to grn_r7, with the same extensions and column/row values, these files are identical to the gr2_d0 to gr2_d8 files. Not sure why; could be for different resolutions but there's no difference between the textures, and the file sizes are the same.


Other files


Panzpal.dat  -   palette info, probably.

PC_STF.cgz   -   no SZDD compression. maybe a table file for something I don't know yet. It seems to address files (from pc_stf01_cgz to _stf10_cgz, plus _fll_cgz), which do not exist, though I may be reading it wrong.

pdtl.bmz     -   SZDD again, and with a BM6 (BMP) header. Opens in a conventional image editor. It's the title screen. To view it properly in Sonic Molester, use 2D + 24bpp + 40col x 27rows, and Flip.

pdd_r1/_r2_/r5.cgz   -   no idea, but these are not compressed.

Round0 to Round7.cgx   -   back to compression. Textures for each level, including bosses. The .cgy and .cgz file extension notes still apply for these.

All RoundX.pta/b share the same structure as the former pta/ptb files (ie., beats me for now).

SGLogo.pta   -   like all .pta files before it.
SGLogo.ptb   -   nope.

SKY_d1/_d5/_d8.bgx   -  a veeeery tiny sky (16x16). Either it's repeated, stretched or it's a palette for the cutscenes. BGZ and BGY similarities to previous files apply.

SKY_TI.BGX   -   a sky texture but strangely warped. The accompanying .BGZ also seems another kind of RGB separation.

TITLE.CGX    -   the title screen in patchwork, for some reason. 2D + 16bpp, 4 col. Accompanying extensions (.cgy, .cgz) share the same traits as previous filename+extension combo.

title.pta/ptb -  as previous .pta/b files.


SOUND FILES


WAVE_XX.CMP   -  EVAW header, just WAV files with sound effects for levels and cutscenes. If you have Audacity, you can import them as Raw Data. I went with: 8-bit PCM unsigned, Mono 11025Hz, though your mileage may vary.


Others


PANZ_TIT.DLL  - 16bpp ARGB, 1D. Italic font used in options (F5, F6, etc).

DLL_EPP.dll   - @1D + 4pp linear w/Row Interleaved, there is the italicized font with added characters (à, á, â, etc.).

PANZ_R1.dll   - same as PANZ_TIT.DLL

With all that said and done, I still have no idea where the main game font, and the one used for Episodes, is stored. I assume it should be on the ASCII files but I've also found fonts in DLLs, so... Besides, parsing through these can get tiresome. There's 34 codecs, 2 modes, row-interleaving and manual column adjusting, so I might've missed something.

Here are some screens from inside the files. There's a nice level of detail here at times.














peixemacaco

Well , I know it´s an old topic, but with great info.

Thanks 4lorn for saying with so much detail, all info on open this files in Tile Molester. If not, we'll be trying zillions of methods to get to correct mode.... lol

Interesting to see images as Ascii on Hex Editor.  And thanks for your explanation on how to open those bmp files (I'd tried to open when in those games folder and no success)

Offtopic, I´d did a Daytona Circuit Edition hack on Dreamcast, named Daytona Brasil   ::) Was just a voice/music hack , and at that time I was thinking to do a Crazy Taxi 2 hack too, but the game was soooo huge, now I will try on PC versions.

Nelson
Super Monaco GP... It garnered an at-the-time unprecedented 10–10–9–9 rating from Electronic Gaming Monthly's Review and wasn`t a F Indy title.

4lorn

You're welcome :) I liked the challenge and realized that once the compression was solved, the info might be useful for anyone willing to do any kind of modification and/or translation. I might do one for Daytona but that's still a ways off.

As a curiosity: I don't have pictures now but I eventually found out that Virtua Cop 1 for the PC *also* has ASCII identifying some 3D objects, chiefly letters.