Help with Digimon Story Lost Evolution PAK

Discussion in 'NDS - ROM Hacking and Translations' started by yugix, May 30, 2011.

May 30, 2011
  1. yugix
    OP

    Member yugix Sleepy

    Joined:
    May 27, 2011
    Messages:
    383
    Country:
    Bahrain
    Can anyone tell me how to unpack or at least extract the font from FONT_NFTR.pak

    I can provide you with the pak.

    Thanks in advance
     


  2. yugix
    OP

    Member yugix Sleepy

    Joined:
    May 27, 2011
    Messages:
    383
    Country:
    Bahrain
    aren't there anyone who is willing to help?
     
  3. rastsan

    Member rastsan 8 baller, Death Wizard

    Joined:
    May 28, 2008
    Messages:
    963
    Location:
    toronto
    Country:
    Canada
    well see someone is translating this and someone else is helping them with the pak files on that thread. link to thread?
    read and notice normatt is doing something all you need to do is wait... or ask them
    Even then did you come across the xentax forums and the multitude of pak file types there.
    this whole thread could have been avoided if you just paid more attention...
    not trying to be mean but did you even take look at the file structure yourself?

    did you see the pointer table. notice what appears to be files with segmentation. these things need to be analyzed and that takes time. just posting and waiting as little as you have, oy. I am not even sure what type of compression is being used. So instead of complaining you could look some of this stuff up yourself.
    decompression
    nds compression types
    file padding
    pointer tables

    heck have you even looked at in hex yet to see if it is even compressed or just a file with .pak added to the end?
    I shouldn't be grumpy over this. But why aren't you asking on the thread for translating this game how you could help? or what the person who is making the tools has learned... or even better just wait...

    normatt if you read this would you mind posting your .pak tool(s) please along with and file structure info you may have gleamed? thank you....
     
  4. yugix
    OP

    Member yugix Sleepy

    Joined:
    May 27, 2011
    Messages:
    383
    Country:
    Bahrain
    Thank you for response.
    I checked the whole project and check the changes done, I also check the msg pak(s) in the rom. I check the font file in Hex and even in Crystaltile2 and I could get one of the fonts. The thing is I don't understand the compression thing. I read alot of tutorials and couldn't understand.

    Thank you for the forum, i could now get more resources about these things.

    And about normatt, i PMed him about week ago and no reply so i thought if someone could help me in this.

    Sorry for being impatient. [​IMG]
     
  5. rastsan

    Member rastsan 8 baller, Death Wizard

    Joined:
    May 28, 2008
    Messages:
    963
    Location:
    toronto
    Country:
    Canada
    What part(s) are you having trouble with?

    so what type of compression do you think it is using?
    There are several types. there are a few threads on this here.

    though you may or may not need to know more about pointers. lets take a closer look at a file from dramatic dungeon sakura taisen so I can explain a pointer. Campdata.dat. this file doesn't have compression but is a good example of pointers. view the file in crystaltile2 in hex mode change the codepage to sjis 932. If you scroll down long enough you will find some japanese text. before this in hex you can see columns of numbers seperated by zeros. those numbers point to some text further down the file. in this files case though you have to reverse it a little. so AC2F becomes 2FAC if we go to that address...we find this "魔物を攻撃する時、近くにいる他の" there is actually a little more to this phrase that we will need to translate it properly, but the point is that we succesfully found where that pointer was pointing to.

    why is this useful. well with compression if your going to insert a smaller file before this point you are also going to need to change that pointer to point to the new end of that file and then move everything after that up.
    almost the same for inserting a bigger file.
    you start with a bigger empty file (file b) (which you can create in ct2)
    copy paste everything from the old packed file(file a) up to the point where the compressed file is about to be inserted. save the file(file b).
    you have some options here... but I am only going to discuss one option
    if you haven't already compressed the file to be inserted then you should. but first have a couple copies ready just in case of screw ups. Compress the file with the appropriate way. then open this file in hex mode and select all and copy. go back to (file b) paste at the spot where is is supposed to go. then copy everything after where the old file ended in (file a) at the new ending. Moving things down. Now you have to update any other pointers for the other files that are after your freshly inserted bigger file. that pointed before to something that has now been moved down. so even though it only kind of applies here... the 2FAC remember how I talked about it pointing to that one spot because I had to move it down everything down that pointer should now be 30AC or AC30 so you would have to go back to that pointer and in hex change it. same with the compression pointers except you are now changing all the of the ones following a certain point.

    the only problems with this is figuring out whether there is a more complicated pointer system.
    so... you could have a several types of pointers one for begining of file one for end of file. now to add more confusion to this... folders... so you would have pointers for the folder begining and ending then a list of the files and their pointers. what about files that don't need compression or cannot be compressed? but are still in this container file.... make it even more complicated these uncompressed files and folders need a way to be distinguished form the other compressed files.
    to do this the programmers add flags. basicly just a number in hex that indicates the above file, folder, compressed, uncompressed stuff... but right near the pointers. another complication there could be more than one "flag".

    another make it more complicated. the pointer I was using as an example is two byte - 2f ac and pretty simple.
    Even more importantly did not need more math to tell you where it was pointing to...
    sigh, in 7th dragon the pointers are relative... I have to add to the location of where that pointer is actually located to the value of the pointer to actually tell where that pointer is actually pointing. (confused? yeah took me a while to wrap my head around that, just words though)

    its simple though. the pointer itself is located at x the pointer value is y. add x and y to find the spot to where it really is pointing...

    more complication... pointers may not be a simple as that... they may point to a location in memory and not in the file.... so you would have a 4 byte pointer20 01 AF C0... that may or may not point to somewhere in the rom itself or just a location of a file loaded in memory. these pointers you have to be careful of as you cannot tell if by moving them you are overwriting other information in that memory...
    another complication but you would figure this one out pretty quickly. no pointer at all just one big container file. with compressed files being held through it. these are pretty easy to distinguish as the file names themselves are not that hard to find. nor is finding the end of these files as there is usually some form of buffer between files.

    what about two file based container files... where the pointers and file names are in one file and the compressed files in the other.

    so that is just some basic stuff. I haven't even started on the types of compression.

    which is why I was asking about the file structure. That can tell a whole lot....

    this pointer stuff is covered in the rom hacking wiki in the top of this forum.
    (why did I wrote all this... oy)
     
  6. Normmatt

    Member Normmatt Former AKAIO Programmer

    Joined:
    Dec 14, 2004
    Messages:
    2,135
    Country:
    New Zealand
    The files contain no encrypted contents and the file format is simple. If you can't atleast work that out your not going to get far hacking this game.
     
  7. yugix
    OP

    Member yugix Sleepy

    Joined:
    May 27, 2011
    Messages:
    383
    Country:
    Bahrain
    dear Normmatt,
    I'm not talking about the message MESPAK00.pak or the other 5 paks in the same MSG folder,
    I'm able to check all these files and change contents.
    I want to know how did you change the fonts in the font_nftr.pak if possible.
     
  8. Normmatt

    Member Normmatt Former AKAIO Programmer

    Joined:
    Dec 14, 2004
    Messages:
    2,135
    Country:
    New Zealand
    editing the ntfr files in font_nftr.pak was done manually. Unless there is an automated NFTR editor that lets you add new characters then in all seriousness you wont be able to do anything with them atleast from what i can see you can't even work out the simple .pak format let alone manually modify the .nftr format which is far more annoying [​IMG]

    I really wont want to sound like a prick but it requires a fair amount of skill to manually modify the nftr file even then my attempt didn't work that well it prevented the original sjis using the english/punctuation characters.
     
  9. rastsan

    Member rastsan 8 baller, Death Wizard

    Joined:
    May 28, 2008
    Messages:
    963
    Location:
    toronto
    Country:
    Canada
    @ Yugix
    to get the first nftr I had to use emeditor and view the FONT_NFTR.pak file in binary hexadecimal mode. I copied pasted to a new file then saved that new file in the same mode. opened that file in ct2. Got a fully working nftr. If you need me to upload this file let me know. that first font is 4 color 8 by 16.
     
  10. yugix
    OP

    Member yugix Sleepy

    Joined:
    May 27, 2011
    Messages:
    383
    Country:
    Bahrain
    Thank you Rastsan,

    About the first nftr, I found it directly using ct2 and using 4 colors, I thought it was 16 by 16 [​IMG]
    What I want to know, how do you extract the nftr from the pak??
    I found in another topic that the start of nftr is RTFN but how do we define the end of the nftr??
     
  11. rastsan

    Member rastsan 8 baller, Death Wizard

    Joined:
    May 28, 2008
    Messages:
    963
    Location:
    toronto
    Country:
    Canada
    well in this case it literally goes right to the start of the other rftn. easier to "bookmark" every rftn and just watch what you are copying over. Oh you have to go right up to the "r" so those last 2 zeroes are copied too. so the first 90 or so bytes are not needed of that pak file.
    Like I said just copy from rftn to the beginning of the next rftn and paste into a new file or in this case the binary for it"52 54 46 4E". Which I should have been more clearer about as you are viewing this file in binary hexadecimal view. so from one 52 54 46 4E to just before the next 52 54 46 4E...

    the second font is just the numbers/ math signs. 6 by 8, 8 colors, antialias, shift jis. font3 almost the same thing 4 colors, 6by7, numbers again. Font 4: 8 color 8 by 16 (kinda pretty this one, not a japanese font has english).

    font5: 4 colors 12 by 16 (so far all are antialias) more characters than font4.
    font6: 2 color 12 by 12 less character than font 5 more than font4.
    font7: 4 color 14 by 16 eh... might be easier just to upload them...
    font8: 16 colors 16 by 16. (I think I might use this i one of my other projects after I tinkle with it a little for the graphic edits, meh I already made three custom fonts just for it but this one with just a little work.... sigh)

    so over 8 minimum fonts the control codes for editing the text in this game must be "scary". I hope there isn't any hardcoded ones in the overlay or the arm9, that would add even more of a pain.

    If you are going to re-insert just make sure the files have the exact same file size... or update the pointers that you can easily see just before the first font. If you need help with this let me know, I'll be happy to.
     
  12. yugix
    OP

    Member yugix Sleepy

    Joined:
    May 27, 2011
    Messages:
    383
    Country:
    Bahrain
    Thank you very much Rastan,
    I will give it a shot now.
     
  13. yugix
    OP

    Member yugix Sleepy

    Joined:
    May 27, 2011
    Messages:
    383
    Country:
    Bahrain
    Dear Rastran,

    After checking the fonts, some of them appeared right and some didn't appear correctly.
    Please could you upload the font files if possible.
     
  14. rastsan

    Member rastsan 8 baller, Death Wizard

    Joined:
    May 28, 2008
    Messages:
    963
    Location:
    toronto
    Country:
    Canada
    link

    there you go. Did you need me to add a single byte font or edit them?
     
  15. yugix
    OP

    Member yugix Sleepy

    Joined:
    May 27, 2011
    Messages:
    383
    Country:
    Bahrain
    Dear Rastran,

    I have some questions to ask.

    1) If I replace some text (JAP-TEXT) to English text, for example アグモンツリー which romanized to agumontsurii (7 letters) and means Agumon Tree (11 letters), this will make the file bigger. so how to fix this issue ??

    2) If I want to change some font, how to change the character map to the font or at least make it appears in the ROM?
     
  16. rastsan

    Member rastsan 8 baller, Death Wizard

    Joined:
    May 28, 2008
    Messages:
    963
    Location:
    toronto
    Country:
    Canada
    Well see the point of dumping the fonts is to edit them so that they can have single byte letters. So if your 7 letters is two byte you would Actully have 14 one byte letters... thus you would have space.
    next point. This also depends on where the text is. if it is in an overlay then you are going to have some trouble finding more space as you just cannot magicly make it in that type of file. If it is in another type of file... then the chances of successfully finding the pointers to that text are much better. As you will need to change the pointers. So far for me I haven't had to make a larger file for any of the translations I have been doing. Why?
    Because I set up a painstaking sheet with the entries and the offsets and the translation and list while translating if there is more space needed or less space needed along with a translation that is formatted with the character control values. Character contol values - which is basicly flags put in the text that tell the color or size of the text and stop here end of screen/ new screen stuff, theres more here I could say but you will understand when you work on digimon...
    as you have 8 fonts that differ in size and spacing and they all have different control values. (just an example from dramatic dungeon sakura taisen..). I can change the color of the text - 7 so far colors by putting in hex 01 03 (a color) before the text I want that color, then when I want it regular I insert 01 02 in hex to change the color back to regular color (white). for digimon, sigh, there is probably a lot more codes like that.... so font8 - 16 by 16 16 color font has (blank) control code the font 5 has a different one.
    You are going to have to identify these control codes before you insert anything. SO YOU DON'T SCREW ANYTHING UP!
    which means figuring out the new screen code the end of line code the different font codes...
    make it more difficult example for zoids battle coloseum there are codes for the faces that show up above the text on the screen. I have to be careful when I put the translation in as I don't want the one bad guy saying the the main characters lines, just because I forgot to put in the code for his face.

    so my advice to you is to play around with some of the text and see what codes you can find first. then worry about translating.

    oh as to the cmap...
    ct2 and NFTRedit should be able to help you with that.
    In crystaltile2 open the nftr you need to edit. then goto tools - nftr editor. a window will pop up.
    on the bottom there is a triangle beside a shaded out build button. click that. the window will get bigger and now you can see the CWDH/CMAP listing thing. Export - by exporting you are making a table for that font. What you need to do now is go in and add one byte english table values or edit the current english font to be single byte. so instead of having just 8273=T you would either edit this to 54=T or add it to the table... Look up tables and find the single byte table values then add those to this table. save it as a different name in shift jis code table. you can edit table files in a text editor.
    now back to crystaltile2.
    in that nftr font editor window on the top there is create and TBL... click tbl... when you load the table make sure you have shift jis as the code page in ct2 for that table - otherwise you are gonna get an ugly looking nftr when you Build the new one. Also after you have loaded this table go back to the nftr font window and click font. For some reason my pc has a default font of segoe which has no japanese support and always makes fonts built with ct2 garbage. so change this font to one that has japanese "script" support, which you will also need to change in the window that popped up. so for font8 I had to go with ms gothic then change the size of the font to 14 to keep the right aspect (16by 16). you see the build button is now not grayed out. CLICK IT.
    oy.. looks like it isn't keeping the colors the right way, well looks like you might need to give nftredit a try - that I don't have experience with. font8 re-done with ct2 does not look right. Could be I don't have the right font to get the colors right.... anyways the new font that pops up is now single-byte supportive, so once you save it and insert in the pak file you should have support for that font. (writing in single byte - T as opposed to T double byte).
    Which means instead of worrying about pointers you can insert and have 14 spaces instead of 7.
    you may have to go in and manually edit the table for the rftn so that the english is one byte and not two. search for nftredit here on gbatemp...

    If I could just identify the font used in font 8.... sigh
    you shouldn't have trouble with the other fonts using this method. You don't need to edit the number fonts (no point).

    sorry for rambling... again

    (does that cover what you asked?)
     
  17. Normmatt

    Member Normmatt Former AKAIO Programmer

    Joined:
    Dec 14, 2004
    Messages:
    2,135
    Country:
    New Zealand
    rastsan, he's trying to do stuff I've already done. I released a tool to modify the text files and fix all the pointers. I even released a modified font package.
     
  18. yugix
    OP

    Member yugix Sleepy

    Joined:
    May 27, 2011
    Messages:
    383
    Country:
    Bahrain
    Dear Rastran,

    Yes, I think I understand how it works and what should I do.


    Dear Normmatt,
    It is true I asked you if you could give me the tool's source code so I could understand how it read file since I'm a programmer and couldn't do it due to my luck of knowledge in that field.
    So the tool will fix the pointers?! no need to worry about them?

    And about font, I think you said you modified one font and there is no problem in knowing how to do since it will not harm anyone.
     
  19. rastsan

    Member rastsan 8 baller, Death Wizard

    Joined:
    May 28, 2008
    Messages:
    963
    Location:
    toronto
    Country:
    Canada
    I am curious if you did just one font or all the japanese fonts in the pak? If you did do the last font how did you do it? (If you know the font it uses specifically that would be even better?!)

    Oh I went into detail so I can point other people to this thread later even though there are way better guides out there. Being able to ramble like this is sometimes better for people who are having trouble understanding things. As sometimes they feel better about asking those questions. (It helped me get it straight in my head too).
     
  20. yugix
    OP

    Member yugix Sleepy

    Joined:
    May 27, 2011
    Messages:
    383
    Country:
    Bahrain
    Dear Rastran,
    Thank you for all the troubles I give to you.

    I want to know what do you mean by codes. I found some texts with weird characters like ^1 or ^P. Do you mean these codes ?!
     

Share This Page