News: 11 March 2016 - Forum Rules

Author Topic: help with .ssar hacking  (Read 465 times)

keisui

  • Jr. Member
  • **
  • Posts: 4
    • View Profile
help with .ssar hacking
« on: February 01, 2022, 07:08:42 am »
hello all , im having a bit of trouble successfully editing a .ssar file to get the sounds to play in game . the game in question is kingdom hearts 358/2 days and the program im using to edit the .sdat is nitro studio 2 , what im trying to hack is the battle quotes , how the sound effects work for the attacking is first attack sound , second sound , third sound being the final attack sound , with the first and second randomized . i added a third random sound to be played in addition to the other two to give more variety in sounds you hear .

anyways , i added the sound to the .swar , created a new .sbnk that includes said sound , and added code in the .ssar for it to play . everything plays fine in nitro studio 2 , everything works as it should , yet in game the sound isnt included as a randomized attack sound , as if i didnt change a thing . my thought was .ssar can only play a certain amount of sounds but i realized theres others with way more sounds .

my question is whether its even possible to add sound effects this way or whether some code needs to be added//changed somewhere else in the rom to tell the game to play a new sound .

any help or insight would be very appreciated

FAST6191

  • Hero Member
  • *****
  • Posts: 3554
    • View Profile
Re: help with .ssar hacking
« Reply #1 on: February 01, 2022, 10:56:39 am »
I am not sure what you are doing.
Are you replacing a sound and it is not playing or are you trying to add another sound that was never in the game (as opposed to simple replacement) and have the game play that?

I can't say I have ever really messed with nitro studio 2 for DS sound related hacking purposes (usually manual, guided by tools like vgmtoolbox, maybe with the occasional fiddling with vgmtrans).

For the former Usual guesses are

1) Mismatch of audio styles. If it was originally 16KHz 8 bit PCM then has to be that (or you go through the hassle of making it work by editing everything down and up the line), even if the program nominally will import it and play back on PC.
2) Some kind of pointer fun. Can you compare before and after in the edited file to see what changed? Sometimes an offset might be hardcoded and could be troubled if something has changed.

For the latter. Yeah you are going to have to figure out how the game calls the sound and tell it to call your new one. If you know where the data for the third sound is in memory (should be the same as the file as seen in the SDAT) then search a memory dump for it and see where it is. Set break on read in a debugger for that area and somewhere a bit further back should be the call for the file, if 1 and 2 are already randomised then you might even be able to borrow code there rather than running off to find a reliably random piece of DS memory to choose between 3 and whatever your new one is, you may face some issues with memory if all three original sounds are there but it is probably going to be tightly controlled enough that you can be spared that.
Possible alternative. I don't know if you can have a start position in the call, might be possible to instead have it randomise where in the base sound it plays (lazy man's genius cousin being maybe you abuse the suspect timings of SDAT/SSEQ setups to trigger a loop and ending depending upon something).

keisui

  • Jr. Member
  • **
  • Posts: 4
    • View Profile
Re: help with .ssar hacking
« Reply #2 on: February 01, 2022, 11:08:15 am »
I am not sure what you are doing.
Are you replacing a sound and it is not playing or are you trying to add another sound that was never in the game (as opposed to simple replacement) and have the game play that?

I can't say I have ever really messed with nitro studio 2 for DS sound related hacking purposes (usually manual, guided by tools like vgmtoolbox, maybe with the occasional fiddling with vgmtrans).

For the former Usual guesses are

1) Mismatch of audio styles. If it was originally 16KHz 8 bit PCM then has to be that (or you go through the hassle of making it work by editing everything down and up the line), even if the program nominally will import it and play back on PC.
2) Some kind of pointer fun. Can you compare before and after in the edited file to see what changed? Sometimes an offset might be hardcoded and could be troubled if something has changed.

For the latter. Yeah you are going to have to figure out how the game calls the sound and tell it to call your new one. If you know where the data for the third sound is in memory (should be the same as the file as seen in the SDAT) then search a memory dump for it and see where it is. Set break on read in a debugger for that area and somewhere a bit further back should be the call for the file, if 1 and 2 are already randomised then you might even be able to borrow code there rather than running off to find a reliably random piece of DS memory to choose between 3 and whatever your new one is, you may face some issues with memory if all three original sounds are there but it is probably going to be tightly controlled enough that you can be spared that.
Possible alternative. I don't know if you can have a start position in the call, might be possible to instead have it randomise where in the base sound it plays (lazy man's genius cousin being maybe you abuse the suspect timings of SDAT/SSEQ setups to trigger a loop and ending depending upon something).

im trying to add a new sound effect to the game , i checked everything and it should work , yet in the game not so . i did borrow the code for the first 2 sounds since i figured that would make the most sense and it did seem to function , just with no effect actually in game . the new sounds have been added to the .swar in the sdat and the .sbnk has been created from it and everything works fine in the .ssar , just having trouble actually getting it to work in the actual game . as for the first things you listed it may be hardcoded .. all the audio is in the same style as ive changed every sound effect all with the same audio settings . i could try searching a memory dump as im not quite sure what else i could do