Menu
 

Modding rundown: Sound

Started by Noelemahc, December 05, 2006, 11:53PM

Previous topic - Next topic
I think it'd have to be re-ripped.

PS: For people who have played them, which of these 2 games would offer better Hulk voice?
http://pc.ign.com/objects/499/499624.html
http://xbox.ign.com/objects/627/627861.html

I liked both but would pick the Hulk first one or movie Hulk I just liked the game better.
And their turning us into Monsters its all designed!!

November 14, 2007, 07:36PM #212 Last Edit: November 14, 2007, 07:53PM by idrinkdrpepper
I have very good news.  Remember how I said that Game.exe contained a reference to m_uiHash, which Google told me was a function used by NeoEngine?  Well, I tracked down the hash function used by NeoEngine (a pretty standard function) and it turns out that this is the Hash function that MUA uses.  It took me a while to figure out that the correct input string needs to be capitalized, but it generates the correct HashIds exactly.  What this means is that you no longer need to waste time searching for the correct HashID.  Just simply enter the power name the same way you would reference it in the powerstyle file.  For example, input: "CHAR/DRSTR_M/P7_POWER" and the program will give you the HashID in reverse order: "04757FD2"

#include <iostream>

using namespace std;
int Hash(const char *s);

int main()
{
  string thisisastring ;
 
  cout<<"Please enter a string: ";
  cin>> thisisastring;
  cin.ignore();
  cout<<"You entered: "<< thisisastring <<"\n";

  int n = Hash(thisisastring.c_str());
 
  //while (cin >> n) {
        cout << "decimal: " << n << endl;
     
        //--- Print hex with leading zeros
        cout << "HashID: ";
        for (int i=2*sizeof(int) - 1; i>=0; i--) {
            cout << "0123456789ABCDEF"[((n >> i*4) & 0xF)];
        }
        cout << endl << endl;
  //}
  cin.get();
 
}


/* Peter Weinberger's */
int Hash(const char *s)
{
const char *p;
unsigned int h, g;
h = 0;
for(p=s; *p!='\0'; p++){
h = (h<<4) + *p;
if (g = h&0xF0000000) {
h ^= g>>24;
h ^= g;
}
}
return (h & 0x7FFFFFFF);
}



This is C++ code.  If you have a C++ compiler, then just compile this and run it. 

Can you write that in reverse real quick too?  That way we can take the hex value and see what string it would refer to.  Then we can find out exactly how _v.zss hashes are built. 

Quote from: Teancum on November 14, 2007, 08:03PM
Can you write that in reverse real quick too?  That way we can take the hex value and see what string it would refer to.  Then we can find out exactly how _v.zss hashes are built. 

Nope.  It's not possible.  The HashID is only 7 hex numbers long, which allows for 16^7 = 2^28 = 28bit strings.  However, the file extension names can exceed 28 bits by several factors.  This means that the Hash Function is not one-to-one, so it's irreversible.  It also means that there exist several strings that will generate the same Hash value.  But the number of file extension names used by MUA is so small that there most likely won't be any hash "collisions".

uhmm can sum1 tell me if it's posible to rip all of deadpools banters or jokes on mua? like for example when he ties to make black bolt spatula? i really love that line. :) thanks!

Are there HashIDs for MUA or XML2 PSP characters' power sounds? Or were those not included in the PC exe?

No, but with his source code we can create them.  For instance, we run something like CHAR/CABLE_M/P6_POWER through the program it it'll generate the HashID that we need.  From there we take someone with a similar amount of power sounds (say captam_m) and rename it cable_m.  We go through and replace the HashIDs as needed, then Cap's sounds will play.  From there we replace the actual raw sounds as needed.  Of course that's all in theory.

Speaking of theories, I've got a fairly solid one on why charname_v has to be the same as charname_m to work.  It's not because it's linked to the ZSM file, but rather that it's linked to the herostat.  So if you've edited mrfan_m and now it's called angel_m (and of course you've fixed HashIDs and whatnot) your herostat is going to look for angel_m.

So here's where I'm going with this.  Using the above example, angel_v is still looking for mrfan_m in the herostat.  My theory is that _v HashIDs are generated in a similar manner as above, but like this:

CHAR/MRFAN_M/XTREME

That would explain why charname_v is depending on finding charname_m.  I doubt the ZSS/ZSM files are actually linked, but rather that charname_v is linked to whatever's in the herostat, as stated before.  How else would x_voice (XML2) work when it uses the same hash system?  That also explains why the XML2 PSPers work when you put pspcharname_m in the herostat.

Okay, the HashIDs for Bishop are wrong as well.  He plays "You lose, tough guy" (a victory taunt) during an Xtreme.  If we fix that I'll fix his Xtreme sound.

No, the newest version got a working zss file for me :scratchhead:

See for yourself

November 15, 2007, 02:44PM #220 Last Edit: November 15, 2007, 02:53PM by idrinkdrpepper
Quote from: Serph21 on November 15, 2007, 05:44AM
uhmm can sum1 tell me if it's posible to rip all of deadpools banters or jokes on mua? like for example when he ties to make black bolt spatula? i really love that line. :) thanks!

Deadpool-Blackbolt

The file extension name for power sounds (which appear in [char]_m), is of the form "CHAR/DRSTR_M/[power name]".  And it's referenced that way in the powerstyle files.

For sounds in the simulation files and in the level files, the file extension name is of the form "VOICE/DRSTRANGE/[sound name]".  It's referenced that way in the Conversation files.

For common sounds, several of them have the filename "COMMON/MELEE/[sound name]"

For sounds that appear in [char]_v, I'm not sure what the file extension name is.  The only one that I know is "CHAR/DRSTR_V/XTREME".  I don't know the full file extension name for the other sounds like BORED or ISEEYOU.  If there were a file that referenced these sounds, it would be helpful.  Otherwise, it's a matter of trial and error to see which filenames will generate the correct HashIDs.

One ZSS file, complete with new Xtreme sound

bishop_v.zss

Quote from: Teancum on November 15, 2007, 01:56PM
No, but with his source code we can create them.  For instance, we run something like CHAR/CABLE_M/P6_POWER through the program it it'll generate the HashID that we need.  From there we take someone with a similar amount of power sounds (say captam_m) and rename it cable_m.  We go through and replace the HashIDs as needed, then Cap's sounds will play.  From there we replace the actual raw sounds as needed.  Of course that's all in theory.

Speaking of theories, I've got a fairly solid one on why charname_v has to be the same as charname_m to work.  It's not because it's linked to the ZSM file, but rather that it's linked to the herostat.  So if you've edited mrfan_m and now it's called angel_m (and of course you've fixed HashIDs and whatnot) your herostat is going to look for angel_m.

So here's where I'm going with this.  Using the above example, angel_v is still looking for mrfan_m in the herostat.  My theory is that _v HashIDs are generated in a similar manner as above, but like this:

CHAR/MRFAN_M/XTREME

That would explain why charname_v is depending on finding charname_m.  I doubt the ZSS/ZSM files are actually linked, but rather that charname_v is linked to whatever's in the herostat, as stated before.  How else would x_voice (XML2) work when it uses the same hash system?  That also explains why the XML2 PSPers work when you put pspcharname_m in the herostat.

So, theoretically, we could build new files using the shells of old ones and HashIDs? Including XML1 characters and custom characters? Or am I misunderstanding this.

That's exactly what I'm saying.  Stage sounds too.  But we have to figure out the VOX format that the game is encoded in, cuz it's not wanting to take XML1 wavs.

so here is the xbox version (though i have no ideia if it is gonna work in game). I also updated the pc version to fix some things (it's in the same zip)

http://www.sendspace.com/file/8ovjxp

as for the hash, that's great dude. Too bad i finished the program prior to see the post. But now i could make a new program to completely compile and decompile the zss file (which would allow us to change sounds, change hashs or whaterer) what you guys think? Or is anyone else already working on something like that?

Also i tried using the xbox sounds in the pc version's zss and it worked but it sounds crappy in game. The closest i got was using Vox studio 3 and converting the file to bicom adpcm 22050 and put back in the zss (without changing the 106 to 1). That gave a better quality very close to the game sounds. I was just wondering how noel managed to get better quality, i even tried uncompressed wave file and still sounded bad.