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
384
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
384
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
384
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
  • TwoSpikedHands @ TwoSpikedHands:
    I just found out that the EU version is better in literally every way, better sound quality, better lighting, and there's even a patch someone made to make the text look nicer
  • TwoSpikedHands @ TwoSpikedHands:
    Do I restart now using what i've learned on the EU version since it's a better overall experience? or do I continue with the US version since that is what ive been using, and if someone decides to play my hack, it would most likely be that version?
  • Sicklyboy @ Sicklyboy:
    @TwoSpikedHands, I'll preface this with the fact that I know nothing about the game, but, I think it depends on what your goals are. Are you trying to make a definitive version of the game? You may want to refocus your efforts on the EU version then. Or, are you trying to make a better US version? In which case, the only way to make a better US version is to keep on plugging away at that one ;)
  • Sicklyboy @ Sicklyboy:
    I'm not familiar with the technicalities of the differences between the two versions, but I'm wondering if at least some of those differences are things that you could port over to the US version in your patch without having to include copyrighted assets from the EU version
  • TwoSpikedHands @ TwoSpikedHands:
    @Sicklyboy I am wanting to fully change the game and bend it to my will lol. I would like to eventually have the ability to add more characters, enemies, even have a completely different story if i wanted. I already have the ability to change the tilemaps in the US version, so I can basically make my own map and warp to it in game - so I'm pretty far into it!
  • TwoSpikedHands @ TwoSpikedHands:
    I really would like to make a hack that I would enjoy playing, and maybe other people would too. swapping to the EU version would also mean my US friends could not legally play it
  • TwoSpikedHands @ TwoSpikedHands:
    I am definitely considering porting over some of the EU features without using the actual ROM itself, tbh that would probably be the best way to go about it... but i'm sad that the voice acting is so.... not good on the US version. May not be a way around that though
  • TwoSpikedHands @ TwoSpikedHands:
    I appreciate the insight!
  • The Real Jdbye @ The Real Jdbye:
    @TwoSpikedHands just switch, all the knowledge you learned still applies and most of the code and assets should be the same anyway
  • The Real Jdbye @ The Real Jdbye:
    and realistically they wouldn't

    be able to play it legally anyway since they need a ROM and they probably don't have the means to dump it themselves
  • The Real Jdbye @ The Real Jdbye:
    why the shit does the shitbox randomly insert newlines in my messages
  • Veho @ Veho:
    It does that when I edit a post.
  • Veho @ Veho:
    It inserts a newline in a random spot.
  • The Real Jdbye @ The Real Jdbye:
    never had that i don't think
  • Karma177 @ Karma177:
    do y'all think having an sd card that has a write speed of 700kb/s is a bad idea?
    trying to restore emunand rn but it's taking ages... (also when I finished the first time hekate decided to delete all my fucking files :wacko:)
  • The Real Jdbye @ The Real Jdbye:
    @Karma177 that sd card is 100% faulty so yes, its a bad idea
  • The Real Jdbye @ The Real Jdbye:
    even the slowest non-sdhc sd cards are a few MB/s
  • Karma177 @ Karma177:
    @The Real Jdbye it hasn't given me any error trying to write things on it so I don't really think it's faulty (pasted 40/50gb+ folders and no write errors)
  • DinohScene @ DinohScene:
    run h2testw on it
    +1
  • DinohScene @ DinohScene:
    when SD cards/microSD write speeds drop below a meg a sec, they're usually on the verge of dying
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Samsung SD format can sometimes fix them too
  • Purple_Heart @ Purple_Heart:
    yes looks like an faulty sd
  • Purple_Heart @ Purple_Heart:
    @Psionic Roshambo i may try that with my dead sd cards
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    It's always worth a shot
    Psionic Roshambo @ Psionic Roshambo: It's always worth a shot