Jump to content

Home

Monkey Island Special Edition - File Formats


Bennyboy
 Share

Recommended Posts

  • Replies 283
  • Created
  • Last Reply

Top Posters In This Topic

Regarding the Nvidia Photoshop DDS plugin: Alpha works fine. you need to save as DXT5 with interpolated alpha (or whatever the fancy alpha variant is called)

also you need to generate an alpha channel, but for experienced Photoshop users this is easily done.

Link to comment
Share on other sites

Hi guys. Great work, very useful stuff!

 

Ditto to ronzbig1. Does anyone know how to change subtitles without making voices to disappear?

 

And, by the way, when changing speech.info, though Guybrush's phrases do change, the same phrase in the selection menu during dialog doesn't.

Link to comment
Share on other sites

Here are my latest findings:

 

typedef struct CostumeHeader {
 unsigned int identifier; // number corresponds to filename
 unsigned int relativePositionToObjectName; 

 unsigned int numberOfTextures; // Number of dxt files referred
 unsigned int realtiveOffsetToTextureIndex; // relative to current position

 unsigned int numberOfStates; // Like InitLeft or WalkLeft
 unsigned int relativeOffsetToStateIndex; 

 unsigned int unk1;  // 0 most of the time, sometimes 1,2,3

 unsigned int numberOfSpriteGroups; // 1 most of the time, in the rage of 1-11
 unsigned int relativeOffsetToSpriteGroups;

 unsigned int unk2; // 0 most of the time, sometimes 1,2,3,4

 unsigned int numberOfPointsOnPath; // some sort of 2D positions
 unsigned int relativeOffsetToPath;

 unsigned int num3_1; // 0 most of the time, sometimes 1
 unsigned int num3_2; // always 0

 float version[3]; // always 0.5 1.0 1.0 
 unsigned int reserved[3]; // always 0 0 0
} CostumeHeader;

typedef struct TextureIndex {
 unsigned int identifier;
 unsigned int relativeOffsetToFilename;
} TextureIndex;

typedef struct StateIndex {
 unsigned int relativeOffsetToStateName;
 unsigned int identifier;
 unsigned int numberOfStateData;
 unsigned int relativeOffsetToStateData;
} StateIndex;

typedef struct SpriteGroup {
 unsigned int identifier;
 unsigned int unk1;
 unsigned int numberOfSprites;
 unsigned int relativeOffsetToSprite;
} SpriteGroup;

typedef struct PathPoint {
  char unk1;
  char unk2;
  char unk3;
  char unk4;
  float x;
  float y;
} PathPoint;   

typedef struct Sprite {
  unsigned int textureNumber;
  unsigned int textureposx;
  unsigned int textureposy;
  unsigned int width;
  unsigned int height;
  float screenposx;
  float screenposy;
  unsigned int unk2;
  unsigned int unk3;
  unsigned int unk4;
} Sprite;


typedef struct StateData {
  unsigned int spriteGroup;
  unsigned int sizeOfFrames; // ???
  unsigned int numberOfFrames;
  unsigned int relativeOffsetToFrames;
} StateData;

typedef struct Frame {
  unsigned int spriteIndex;
  unsigned int unk1;
  unsigned int unk2;
} Frame;

 

I think it is nearly complete now. Some work has to be done for the StateData and Frames but I guess some bruteforcing could bring some more insights. The other "XML" files should have a similar structure.

 

I guess the main question is on how to proceed...

One way could be to transform the structure to a real XML file so it can be modified with a text editor - the other would probably be some kind of visual editor.... well I don't have *that* much time unfortunately..... any help is needed!

Link to comment
Share on other sites

I've only been away for a day and the progress has been rapid. Good job everyone!

 

I'm going to look into the WMA's now. Hopefully it'll just be a case of adding the correct header to them.

 

Another possibility is that they might be headerless xWMA

Link to comment
Share on other sites

Giving up for now. I've been trying to manually build a wma file using the raw data, just to test that the data really is wma.

 

Unfortunately this hasn't yielded any results, I haven't been able to build a correct wma header that will play back any audio. I've been assuming that the audio is 44100 stereo 16bit wma and after failing with calculating the track length from the data, I tried using the track length from the corresponding wav files in the old music soundbank.

Link to comment
Share on other sites

Having another crack at the audio.

I'm now assuming that its headerless xWMA. I'm currently trying to use xWMA encode to produce a valid xWMA file from a wav, then chopping out the data, correcting the wav size headers, inserting the data from one of the MI WMA's and seeing if xWMA will decode it back to pcm wav. The trick is in finding the correct bitrate for the input and output audio.

Link to comment
Share on other sites

Yes I can confirm that this have to be xWMA files, given the same 20 byte pattern in the beginning occurs when converting a WAV with xWMAEncode.exe with -b 96000.

 

Now we only need to create the proper header....

Link to comment
Share on other sites

I can confirm this too. I'm actually able to play the files now!

 

Just took a long wavefile, converted it xwma at 96 kHz using xwmaencode. Simply copied the header and pasted first in one of the extracted files from the wavebanks then converted it back to .WAV using xwmaencode. It gives an error because the header size is off but it still converts the file and I can play it successfully. Generating a correct header should be no problem!

 

EDIT: So, for the record, the WAVEFORMATEX chunk I ended up with for the working file was:

 

66 6D 74 20 12 00 00 00 61 01 02 00 44 AC 00 00 E0 2E 00 00 6B 11 10 00 00 00

 

So the problem boils down to generating the dpds (decoded packet cumulative data size array). Hopefully there is some obvious way to generate it from the actual data somehow.

Edited by Tomas
Link to comment
Share on other sites

We can easily put together a batch file to rip and do the conversion. However, a more optimal solution would be to get a correct WMA header to add to the raw xWMA's. As I understand it xWMA's are pretty much the same as a normal WMA and should work as part of a WMA container.

 

I'm going to keep trying to do this, if I can get a container then I can easily make an app to read the soundbanks and put the data in a RIFF/WMA container. Its a shame that the WMA format is such a pain in the arse¬

Link to comment
Share on other sites

Here is a modified (i.e. hacked together) version of unxwb that produces "xwm" files that can be converted with the xWMAEncode.exe tool back to WAV (part of the DirectX SDK).

 

Source and binary (updated):

http://helicoid.de/scumm/unxwb-mi.zip

 

So for example run

unxwb.exe MusicNew.xwb

and then something like

for /r . %i IN (*.xwm) do @xWMAEncode.exe %i %~ni.wav

to convert all the files to wav. (Given both tools are in the PATH or in the current directory...)

 

If you have LAME installed you could finally do

for /r . %i IN (*.wav) do @lame.exe --preset extreme %i %~ni.mp3

to produce mp3 files.

Edited by jott
Link to comment
Share on other sites

So... Can you upload it?

 

Upload what? I most certainly will not upload the soundtrack as everyone owning MISE can extract the files.

As for the xWMAEncode.exe - Microsoft is not very friendly regarding redistribution of their tools. A real shame. So you have to get the whole DX SDK (you could extract the EXE file if you wish instead of installing it though).

Link to comment
Share on other sites

Here is a modified (i.e. hacked together) version of unxwb that produces "xwm" files that can be converted with the xWMAEncode.exe tool back to WAV (part of the DirectX SDK).

 

Source and binary (updated):

http://helicoid.de/scumm/unxwb-mi.zip

 

So for example run

unxwb.exe MusicOriginal.xwb

and then something like

for /r . %i IN (*.xwm) do @xWMAEncode.exe %i %~ni.wav

to convert all the files to wav. (Given both tools are in the PATH or in the current directory...)

 

If you have LAME installed you could finally do

for /r . %i IN (*.wav) do @lame.exe --preset extreme %i %~ni.mp3

to produce mp3 files.

 

works just fine for me this way... thanks ^^

 

now the only thing i need are the right names for the right file... would be nice if anybody could make a list or so... i'm just too dump to name them propably... until now i'm only pretty sure that 00000016 is actually the theme music... could someone check that please

 

and thanks again for mentaning how it may could be possible to get the new music playable ;):thmbup1:

Link to comment
Share on other sites

 Share


×
×
  • Create New...