ROM Hack [Translation] Ace Attorney Trilogy

Status
Not open for further replies.

Asia81

Yuri Lover ~
Member
Joined
Nov 15, 2014
Messages
6,656
Trophies
3
Age
29
XP
3,489
Country
France
AATri uses an own font (it seems the same like in the DS games). But since this font doesn't include other special characters but á and é I cannot include other special characters.
If you want them ingame you firstly have to edit the font of the game. After that I (or you if you understand my script) can include a de-/encoding list for this new language.
I myself had to edit the font in order to get spanish letters to work. And only for this font (which you can find in our tools folder) the "sp" language in the dlgTool.py is working.

Any unknown characters will be erased because it couldn't be de-/encoded.
Unfortunately there isn't a more pleasing answer to this.
So if I understand, I need to edit the game's font?
But where do I need to start to edit a 3DS font?
I need an SDK? If so, what SDK I need?
And how hard it is to add (and not replace by erasing another character) special characters like é or à?
 

onepiecefreak

Kuriimu 2 Developer
OP
Member
Joined
Aug 12, 2015
Messages
525
Trophies
0
XP
1,733
Country
Germany
You could use the tool bffnt.py from our tools folder to extract file 42 (which is the font for the english version) and extract it to a png and json. Unfortunately I can't tell you how to add characters because we only replaced existing ones.
We choosed this method because it was very complicated to add new characters to the font.
So I can't tell you how to add new characters.
 
  • Like
Reactions: Asia81

Asia81

Yuri Lover ~
Member
Joined
Nov 15, 2014
Messages
6,656
Trophies
3
Age
29
XP
3,489
Country
France
You could use the tool bffnt.py from our tools folder to extract file 42 (which is the font for the english version) and extract it to a png and json. Unfortunately I can't tell you how to add characters because we only replaced existing ones.
We choosed this method because it was very complicated to add new characters to the font.
So I can't tell you how to add new characters.
So I will try to replace useless characters if there are any.

BTW, it's impossible to use the bffnt.py script, if I write -help to see how to use it, just nothing happen
1483201536-pycfnt.png
 

onepiecefreak

Kuriimu 2 Developer
OP
Member
Joined
Aug 12, 2015
Messages
525
Trophies
0
XP
1,733
Country
Germany
Oh that shouldn't happen. Sorry.
I will add the help text asap. Meanwhile you can use "-e" to extract the file and "-c" to create a new font file.
So "bffnt.py -e 42.cfnt".
 

Asia81

Yuri Lover ~
Member
Joined
Nov 15, 2014
Messages
6,656
Trophies
3
Age
29
XP
3,489
Country
France
Oh that shouldn't happen. Sorry.
I will add the help text asap. Meanwhile you can use "-e" to extract the file and "-c" to create a new font file.
So "bffnt.py -e 42.cfnt".
Strange, I extracted the PNG 42_sheet0.png and I see all the characters I need.
I'm lost.
1483202211-test.png
 

onepiecefreak

Kuriimu 2 Developer
OP
Member
Joined
Aug 12, 2015
Messages
525
Trophies
0
XP
1,733
Country
Germany
But they aren't correctly mapped in the game. I searched through most of the encoded codes for my table. But I never found the codes for these characters you marked.
And that's why you can't use the characters although they are included.

I know: The font is very messed up and I myself can't exactly understand this chaos.
And the tool is uploaded now with a working help text.

In the end it was easier just to replace existing characters.
 

Asia81

Yuri Lover ~
Member
Joined
Nov 15, 2014
Messages
6,656
Trophies
3
Age
29
XP
3,489
Country
France
Ok, I think I begin to undertand.
Now what I want know is if I need to edit something in the json file, or just edit the png by copying the é or another character needed is enough.
Like for example If I take é and I paste it on +.
The game will now show é instead +, right?
1483205242-test01.png


But how do I know which characters are used in game? To not paste on non-used characters x)
 

onepiecefreak

Kuriimu 2 Developer
OP
Member
Joined
Aug 12, 2015
Messages
525
Trophies
0
XP
1,733
Country
Germany
Mostly correct.
It depends on "how long" the replaced character is.
In the json you have 3 values: char, glyph, left for every character.
  • char: is the width in pixels of the glyph itself. You have to adjust it when the character seems cut off (so you only see half of an "e" for example)
  • glyph: is the space in pixels that the characters use in the dialogue box. So you can let an "e" show as "e " by adjusting this. It is different to char because if you set char on a higher value than 18 you would see the next character from the png. That isn't the case for glyph
  • left: is the "opposite" of glyph. You can let an "e" show as " e". If you set left to high the character will overlap with everything else after it in the dialogue box.
But since this font is messed up you can't adjust glyph. You can edit it in json but the game seems to ignore it. That's the reason why you can't use the japanese characters to import your characters. Because the japanese characters have a glyph of 18, every latin character that is much smaller will be shown as "á " in the dialogue box.
I don't know why you can't adjust it. I could prove that my tool is importing the files 100% correctly back.

To adjust the values for the right characters you have to use the "glyphMap" in the json and this website:
https://www.branah.com/unicode-converter

Following situation:
You want to replace "+" with "é".
Find "+" or it's 4-digit unicode, from the linked website, in the "glyphMap".
After that note the number that is written behind it. Example: "+: 8" -> you have to note 8.
Now you have to search for this number in "glyphWidths" in the json.
After finding it you can edit the 3 values given to it.

Hope that can help you.
 
Last edited by onepiecefreak,
  • Like
Reactions: Asia81

matheus abreu

Active Member
Newcomer
Joined
Sep 8, 2016
Messages
28
Trophies
0
Age
27
XP
223
Country
Brazil
Strange, I extracted the PNG 42_sheet0.png and I see all the characters I need.
I'm lost.
One thing about the fonts/game dialogue.

I think that french characters on the font can only be used on the third game, Trials and Tribulations, that have a different table.
Because if you put the code of the characters ç,û from Trials and Tribulations in the dialogues of the ace attorney 1, you will get japanese characters.
jkv5ySt.png


But if you put the same code in the dialogues of Trials and Tribulations, you will get this:
hMHHGCJ.png
 
Last edited by matheus abreu,

onepiecefreak

Kuriimu 2 Developer
OP
Member
Joined
Aug 12, 2015
Messages
525
Trophies
0
XP
1,733
Country
Germany
Oh interesting. Doesn't change the fact that should have to replace existing characters that are used as the same the whole 3 games.
But that is good to know.
Maybe because of Masque DeMasque? His name uses these characters. Huh.

I have to look if it affects our spanish font.
That I didn't noticed that...
 
Last edited by onepiecefreak,

Asia81

Yuri Lover ~
Member
Joined
Nov 15, 2014
Messages
6,656
Trophies
3
Age
29
XP
3,489
Country
France
Mostly correct.
It depends on "how long" the replaced character is.
In the json you have 3 values: char, glyph, left for every character.
  • char: is the width in pixels of the glyph itself. You have to adjust it when the character seems cut off (so you only see half of an "e" for example)
  • glyph: is the space in pixels that the characters use in the dialogue box. So you can let an "e" show as "e " by adjusting this. It is different to char because if you set char on a higher value than 18 you would see the next character from the png. That isn't the case for glyph
  • left: is the "opposite" of glyph. You can let an "e" show as " e". If you set left to high the character will overlap with everything else after it in the dialogue box.
But since this font is messed up you can't adjust glyph. You can edit it in json but the game seems to ignore it. That's the reason why you can't use the japanese characters to import your characters. Because the japanese characters have a glyph of 18, every latin character that is much smaller will be shown as "á " in the dialogue box.
I don't know why you can't adjust it. I could prove that my tool is importing the files 100% correctly back.

To adjust the values for the right characters you have to use the "glyphMap" in the json and this website:
https://www.branah.com/unicode-converter

Following situation:
You want to replace "+" with "é".
Find "+" or it's 4-digit unicode, from the linked website, in the "glyphMap".
After that note the number that is written behind it. Example: "+: 8" -> you have to note 8.
Now you have to search for this number in "glyphWidths" in the json.
After finding it you can edit the 3 values given to it.

Hope that can help you.
I'm fucking lost. I just guess I will stop here. Thanks for your time, anyways.
Last thing, I suppose it's not possible inject a font from another 3DS game, or convert a Windows font to bffnt?
 

onepiecefreak

Kuriimu 2 Developer
OP
Member
Joined
Aug 12, 2015
Messages
525
Trophies
0
XP
1,733
Country
Germany
Not with my tool. But I thought it would exist a tool that can do that.
But I don't know.

BTW: I mentioned that I can try to create a font for you, didn't I?
I could try my best to do so.
 

Asia81

Yuri Lover ~
Member
Joined
Nov 15, 2014
Messages
6,656
Trophies
3
Age
29
XP
3,489
Country
France
Not with my tool. But I thought it would exist a tool that can do that.
But I don't know.

BTW: I mentioned that I can try to create a font for you, didn't I?
I could try my best to do so.
I have hesitate to ask you it, because you're already so nice with your explanations.
 

onepiecefreak

Kuriimu 2 Developer
OP
Member
Joined
Aug 12, 2015
Messages
525
Trophies
0
XP
1,733
Country
Germany
That's no problem. If you can't understand directly, that's it. I also needed 2 weeks to understand it mostly.
I have another team that would like to get a font so you will have to wait a little bit for it.
 
  • Like
Reactions: Asia81

onepiecefreak

Kuriimu 2 Developer
OP
Member
Joined
Aug 12, 2015
Messages
525
Trophies
0
XP
1,733
Country
Germany
The dialogue tool have the same bug of the PWSE.

"The problem appears if we press the last sentece of 3th testimony in a modified game, Mia will appear and then the epilogue of the case will appear to then go back into trial."
This quote is from a post of RH.net.
http://www.romhacking.net/forum/index.php/topic,12139.msg180886.html#msg180886

The same thing happens with 3DS version in the first case.

I searched through the whole file, but I can't find the flaw.
It's right: case1, 3rd testimony, last statement. After the pressing text it somehow jumps to the end of the case. But I compared both binary files. They're the same.
And there isn't something like a new jmp statement.
I can't explain how this error can exist.

And with this statement the rewritten dlgTool.py is uploaded. It doesn't have the error that the game crashes after pressing START for example.
 
  • Like
Reactions: matheus abreu

matheus abreu

Active Member
Newcomer
Joined
Sep 8, 2016
Messages
28
Trophies
0
Age
27
XP
223
Country
Brazil
I searched through the whole file, but I can't find the flaw.
It's right: case1, 3rd testimony, last statement. After the pressing text it somehow jumps to the end of the case. But I compared both binary files. They're the same.
And there isn't something like a new jmp statement.
I can't explain how this error can exist.

And with this statement the rewritten dlgTool.py is uploaded. It doesn't have the error that the game crashes after pressing START for example.
Yeah, it's really strange, I had checked it today too , I don't know how the original file work without this jump command.
 

onepiecefreak

Kuriimu 2 Developer
OP
Member
Joined
Aug 12, 2015
Messages
525
Trophies
0
XP
1,733
Country
Germany
Oh, I have a suspicion. I don't know why they would do that but maybe I found out how we can resolve this problem.
The main point seems to be command 0x36.
It seems like a jmp command.
And the only difference between the new and the original dlg are 8 byte. And now ask on which part of the dlg binary the 0x36 command coincidentally point...
 
Last edited by onepiecefreak,
  • Like
Reactions: matheus abreu

onepiecefreak

Kuriimu 2 Developer
OP
Member
Joined
Aug 12, 2015
Messages
525
Trophies
0
XP
1,733
Country
Germany
I updated the dlgTool again. You can extract DS and AATri dialogues with it. Since the encoding in the NDS games is a little bit off of the one in AATri you have to insert for example special characters like á or whatever.
There is no save bug. All possible values are now somehow stored in the txt files (marked as the command "do_not_delete"... just don't delete it.).
The tool should now be more usable then PWSE and also more reliable.

P.S: You can't copy over DS scripts to AATri completely unchanged. Since font encoding and most graphics, animation and sound ID's aren't the same in AATri it's better to only copy over the text from the DS dialogues to prevent unwanted graphic or sound bugs.
 
Last edited by onepiecefreak,
  • Like
Reactions: matheus abreu
Status
Not open for further replies.

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    SylverReZ @ SylverReZ: https://www.youtube.com/watch?v=pnRVIC7kS4s