Need help with .sad file and events - Professor Layton and the diabolical box

Lef

Member
OP
Newcomer
Joined
Mar 29, 2023
Messages
6
Trophies
0
Age
27
XP
37
Country
France
So, I've been trying to undub the French version of Professor Layton and the Diabolical Box. As there is no .sdat file in the French unpacked ROM, I've been exploring the other folders within data/dat_lt2/. So far, I've replaced the French stream folder with the Japanese one (as well as the sound folder, since I've seen other threads with people also replacing it), and it seems to be working quite well.

I've noticed that the files in data/dat_lt2/stream/event/fr/ are not the same as in the Japanese data/dat_lt2/stream/event/. In fact, there are many more files in the Japanese one, and the reason is the way text shows up on the screen during certain parts of the game (intro screen, letters, etc).

For example, in data/dat_lt2/stream/event/fr/, there is this file: 001_0.SAD followed by 011_0.SAD, while in the Japanese folder, there are two more files in between: 001_1.SAD and 001_2.SAD.

I figured out the reason when testing my ROM, and it's simply because the Japanese intro screen is made up of three sentences appearing successively and being read one after the other. However, during the French intro, it shows all the text at once, thus only one event is needed since it seems to have been programmed as one sentence/groupe of sentences appearance = one audio event. This leads to the French text showing up, triggering only one Japanese audio out of the three and immediately skipping to the next screen (the same goes for other similar events later in the game).

My guess is that when there is an occurrence of multiple Japanese event files and fewer in French, they need to be merged in order to "trick" the script and synchronize with the French text.

Therefore, I've been wondering if there is a possibility to modify those .SAD files which aren't supported by VGMTrans or Nitro Studio. I've been looking on different threads and found out they could be read with foobar2000, which allows me to convert them into WAV files and edit them to a single one with Audacity, but it seems impossible to convert them back to .SAD afterwards.

I've done tons of research on GBAtemp and couldn't find anyone pointing out this issue, so maybe I'm doing something wrong? If so, any advice would be very much appreciated. :)
 
Last edited by Lef,

Cervi

Well-Known Member
Newcomer
Joined
Aug 25, 2022
Messages
46
Trophies
0
Location
Catalonia
XP
394
Country
Spain
I'm part of Team Top Hat, working on a ROM hack for layton2. Check out our tool, the Layton Editor: https://github.com/thatrandomstranger/LaytonEditor

Download the latest version (0.5-pre1 or something like that). IMPORTANT: If you want the latest changes, which sped up audio encoding and decoding up to 200x (from up to 5 minutes to a couple seconds), clone the branch https://github.com/thatrandomstranger/LaytonEditor/tree/dev (although stability is not guaranteed, it works), and you'll have to follow the extra instructions to set it up with python, not with an .exe. I maybe could build an exe for you tomorrow.

It has support for SAD importing/exporting to and from .wav. The information can be found in the wiki.

Tomorrow I might be able to take a look at how the French voice lines differ from the one on the Japanese ROM.
 
Last edited by Cervi,
  • Like
Reactions: Lef

Lef

Member
OP
Newcomer
Joined
Mar 29, 2023
Messages
6
Trophies
0
Age
27
XP
37
Country
France
I read some of the wiki it seems really exaustive thank you. Do you think that with what's writtent in the Editing event part i'll be able to write a command which allows several event to play for 1 text appearence ?

For example : write a command to make the text from the intro screen last until 001_2 has been played (instead of 001_0) and an other to trigger the three events as the intro screen appears ? Also the events (.SAD files) will need to play with some delay between them in order to be more "natural".

I have no knowledge in coding but I'm willing to learn so please tell me if what I ask is beyond my reach x)
 

Cervi

Well-Known Member
Newcomer
Joined
Aug 25, 2022
Messages
46
Trophies
0
Location
Catalonia
XP
394
Country
Spain
I've just looked into it, and the opening part and all "narration parts" (the ones which are like letters from Luke) are not editable for now. They seem to be hardcoded in the game's code, so it'd be really hard to edit them. However, other events where characters talk to each other, for example, maybe could be edited. Still, I don't think you can play two consecutive voice lines while a dialogue is taking place. I think it'd be much more feasible to just edit the audio files and join them in a single .wav that you can later import as a SAD file.

I'm also sending you the latest WIP LaytonEditor executable. It should make it easier to edit events (using a new GUI editor, so you won't need coding at all) and import WAV to SAD files quicker. Note: it does not allow to create new SAD files, just replace existing ones... and stability is not 100% guaranteed. I'd recommend you make a backup every once in a while.
 

Lef

Member
OP
Newcomer
Joined
Mar 29, 2023
Messages
6
Trophies
0
Age
27
XP
37
Country
France
Thank you, I've looked into the editor I think it will be really helpful. I'm working on it rn.

I was able to export the files from SAD to WAV and to edit them in a single one. But I have a quick question : if I want to import back a WAV file back into the ROM should I choose "import raw data" or "import WAV" in order to the file to be converted back to .SAD ?
 

Cervi

Well-Known Member
Newcomer
Joined
Aug 25, 2022
Messages
46
Trophies
0
Location
Catalonia
XP
394
Country
Spain
Thank you, I've looked into the editor I think it will be really helpful. I'm working on it rn.

I was able to export the files from SAD to WAV and to edit them in a single one. But I have a quick question : if I want to import back a WAV file back into the ROM should I choose "import raw data" or "import WAV" in order to the file to be converted back to .SAD ?
You should choose "import WAV". Raw data is used for importing already transformed SAD files.
 
  • Like
Reactions: Lef

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    AncientBoi @ AncientBoi: :O:ohnoes::ohnoes::ohnoes::angry: I Love Pianos 😡