[Help] Puyo Puyo Tetris - Texture and Graphics Replacement Issues

Discussion in '3DS - ROM Hacking, Translations and Utilities' started by ongo_gablogian, Jul 9, 2016.

  1. ongo_gablogian
    OP

    ongo_gablogian GBAtemp Regular

    Member
    187
    128
    Mar 26, 2010
    United States
    So I recently started looking through the files in Puyo Puyo Tetris to see if I could possibly translate some of the basic menus and such. I haven't gotten too far (I only have the graphics done for the title screen), but I've hit a bit of a brick wall as the game crashes when the title screen starts to load.

    The file I'm working with is named "title.narc" and the tools I've been using are NDS Editor (kiwi.ds) and Puyo Tools. Using NDS Editor I can unpack the .narc, which leaves me with three files.

    - title_000.bm
    - title_001.swif
    - title.ctpk

    The .ctpk can be unpacked with ctpktool and doing so left me with a bunch of .png and corresponding xml files. The two files i've edited are "title_tds2_d8888.png" and "title_02_d4444.png", both are shown below with the code from the matching xml file.

    The main issue I'm having now is rebuilding the .ctpk with CTPK Tool. Extracting and rebuilding the .ctpk seems to causes the game to crash, even when using the unmodified .png files that were originally extracted from it. Also the modified file is always 2.75mb when the original is ~1mb.

    If I rebuild the .narc (using puyo tools) with the unmodified .ctpk, the game works fine. This leads me to believe that the .ctpk building process could be to blame.

    If anyone has any experience with .ctpk, bm , or .swif files, please let me know.

    Linked in this post is the title.narc and a LayeredFS plugin for both the base game and the v1.1 update. This is the SD card setup for the plugin:

    SD:/PuyoPuyoTetris/title/title.narc


    [​IMG]
    [​IMG]
     

    Attached Files:

    Last edited by ongo_gablogian, Jul 12, 2016


  2. ongo_gablogian
    OP

    ongo_gablogian GBAtemp Regular

    Member
    187
    128
    Mar 26, 2010
    United States
    Update:

    I think root of my issues are with CTPK Tool (or possibly my .png format), as rebuilding a .narc with the unmodified files works fine. If anyone knows anything about CTPK Tool or .png formats used in Puyo Puyo Tetris (or other 3DS games) please let me know

    Also @Nagato, maybe you'd have some ideas about the issues I'm running into.
     
    Last edited by ongo_gablogian, Jul 13, 2016
  3. DarkSynopsis

    DarkSynopsis GBAtemp Fan

    Member
    397
    235
    Oct 15, 2014
    New Zealand
    New Zealand
    According to the .png files once extracted from the ctpk they are etc1a4 encoded, CTPK Tool does not repack with this encoding.

    I believe in the original post about why this is the case is most games don't care about the encoding but you get the odd few that are, I know Fire Emblem If/Fates is one and I guess this is another.

    Best you can do is create a etc1a4 encoded image and hex it into the ctpk which is a nightmare.



    I had done a video for Fates but doing it with Puyo at least with that ctpk seems like it would be more a pain since more than one image within the ctpk.

    Had hoped this was just a similar issue we ran into with Taiko 3 Mystery Adventure, that was just a matter of taking some of the lines from the original ctpk and putting them into the new one.
     
    Last edited by DarkSynopsis, Jul 12, 2016
  4. ongo_gablogian
    OP

    ongo_gablogian GBAtemp Regular

    Member
    187
    128
    Mar 26, 2010
    United States
    Interesting, I was actually just watching that video to see if it would be possible to do a something similar. I have barely any experience when it comes to hex editing, so I don't think I could pull off editing a etc1a4 image properly. Hopefully the CTPK Tool can be updated to include this functionality.

    Thanks for helping out.
     
  5. Nagato

    Nagato GBAtemp Advanced Fan

    Member
    531
    514
    Jul 15, 2011
    United States
    Try this version of ctpktool: (see later post)
     
    Last edited by Nagato, Jul 14, 2016
  6. ongo_gablogian
    OP

    ongo_gablogian GBAtemp Regular

    Member
    187
    128
    Mar 26, 2010
    United States
    Wow thanks a ton for this. The game doesn't crash anymore, but there still are some image issues. The image on the left is the title_002.ctpk rebuilt with it's original contents, while the image on the right is the .ctpk rebuilt with the modified top and bottom screen textures.

    EDIT: I've added a screenshot of the game's original title screen for reference. Also I realized this issue could have something to do with some of the other files in the "title" folder of the RomFS, as they share similar names. I've uploaded them here and their names are listed below.

    - title_texlist.bin
    - title.naix
    - title.narc-info

     
    Last edited by ongo_gablogian, Jul 13, 2016
  7. Nagato

    Nagato GBAtemp Advanced Fan

    Member
    531
    514
    Jul 15, 2011
    United States
    >The image on the left is the title_002.ctpk rebuilt with it's original contents, while the image on the right is the .ctpk rebuilt with the modified top and bottom screen textures.
    >I've added a screenshot of the game's original title screen for reference.
    Where's the original title screen? I only see the one showing off the original (rebuilt?) and the one with modified textures.

    Edit: Nevermind, I see it now. For some reason it wasn't showing.
     
  8. Nagato

    Nagato GBAtemp Advanced Fan

    Member
    531
    514
    Jul 15, 2011
    United States
    Try this: (see later post)
    It's doubtful that it'll fix it, but I noticed a peculiarity with the way it handled the hash table, so this will fix that. The rest of the CTPK file should be mostly mostly the same (aside from the way the ETC1A4 images are encoded).

    Note: You will need to extract the title_002.ctpk again using this version of the tool. You only need to update the .xml files since it adds more metadata.
     
    Last edited by Nagato, Jul 14, 2016
  9. ongo_gablogian
    OP

    ongo_gablogian GBAtemp Regular

    Member
    187
    128
    Mar 26, 2010
    United States
    Nice, it's almost perfect!

    Same deal as before, the image on the left are the original japanese files from the ctpk rebuilt and the one on the right is with the edited png's.

     
  10. RupeeClock

    RupeeClock Colors 3D Snivy!

    Member
    6,389
    861
    May 15, 2008
    I'm really interested in at least a basic menu translation, I have the game card and it can be booted via Hans too.
    Good luck.
     
  11. Nagato

    Nagato GBAtemp Advanced Fan

    Member
    531
    514
    Jul 15, 2011
    United States
    Looks like the alpha channel is getting lost when encoding ETC1A4 only. How does this work?
    (see later post)
     
    Last edited by Nagato, Jul 14, 2016
  12. tiduscrying

    tiduscrying that butt...

    Member
    466
    428
    Jun 12, 2012
    United States
    HELL
    Hmm.. This looks familiar to an issue I was having with some images as well, back with the translation of Taiko no Tatsujin: Don to Katsu no Jikuu Daibouken. The issue I had resulted in weird black lines surrounding things in the tutorial images.
    It looked a bit like this...
    @Nagato, I recall from when you helped me with the image, it had something to do with a color format, right? Could this be a similar issue?

    Also, @ongo_gablogian, this looks like it'll be a nice translation! I tried playing the game in Japanese but couldn't figure out much... I was considering doing a translation at some point, but taiko took my attention away from that. Let me know if you need any help with the graphics or anything! I'd be more than willing to lend a hand! :yay3ds:

    Edit: Looks like nagato replied before I could finish typing, haha.
     
  13. ongo_gablogian
    OP

    ongo_gablogian GBAtemp Regular

    Member
    187
    128
    Mar 26, 2010
    United States
    It produces the same results as the last build unfortunately.

    Thank you, I was hoping start a translation project as soon as the image issues are sorted out. I don't speak any japanese so I'll likely need help with translating most of the text graphics.

    Thanks for the offer, I'll need all the help I can get! I'll let you know when I'm ready to make and "official" translation thread.
     
    Last edited by ongo_gablogian, Jul 13, 2016
  14. Nagato

    Nagato GBAtemp Advanced Fan

    Member
    531
    514
    Jul 15, 2011
    United States
    Oh. :(
    That's not good. I don't really know what the problem could be then.

    Just for giggles, can you open title_01_etc1a4.xml and title_tds1_etc1a4.xml, and replace
    Code:
    <Format>13</Format>
    with
    Code:
    <Format>0</Format>
    and see what happens then?

    It might crash, it might not (depends on the game).
     
  15. ongo_gablogian
    OP

    ongo_gablogian GBAtemp Regular

    Member
    187
    128
    Mar 26, 2010
    United States
    HOLY SHIT THAT WORKED! Seriously, thanks so much. The only issue I can see is the "X" shaped texture in the background of the top screen isn't loaded for whatever reason.

     
    Last edited by ongo_gablogian, Jul 13, 2016
    tiduscrying likes this.
  16. Nagato

    Nagato GBAtemp Advanced Fan

    Member
    531
    514
    Jul 15, 2011
    United States
    Good to hear! That means that you can probably change the image format of most of the images in the game without it crashing. If you run into another error with things displaying black like that, try changing from format 13 to 0 again. This also means that I think there's a transparency issue somewhere in the ETC1A4 code, but I have no idea where (not my code to begin with :V).

    The missing X shape in the background is weird. I think that graphic is coming from another or image somewhere. It's not anywhere in the title data you gave me. Have you tried searching around for it?
     
  17. RandomKid150

    RandomKid150 Translator

    Member
    360
    94
    Nov 4, 2015
    United States
    Texas
    This might be a little off topic, but can you see if you can get these .ctpk files open? It for the game, Sumikko Gurashi - Here You Settle Down. Thanks. :)
     

    Attached Files:

  18. Nagato

    Nagato GBAtemp Advanced Fan

    Member
    531
    514
    Jul 15, 2011
    United States
    If those are CTPK files then they're encrypted or something. They're completely different from normal CTPK files.
     
    RandomKid150 likes this.
  19. Jayro

    Jayro MediCat USB and Mini Windows 10 Developer

    Member
    GBAtemp Patron
    Jayro is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    4,957
    2,667
    Jul 23, 2012
    United States
    Octo Canyon
    I'm eagerly awaiting you to release this patch when the translation is done. :D
     
  20. ongo_gablogian
    OP

    ongo_gablogian GBAtemp Regular

    Member
    187
    128
    Mar 26, 2010
    United States
    I've got some good news and some bad news. I rebuilt the title.narc with kiwi.ds editor instead of puyotools and that "X" shaped texture came back. I have no idea where it's located in the romfs and I've looked around for it a bit too. Either way, I guess that's solved.

    I've also almost finished the main "Single Player" menu and a screenshot of that is below. The only issue I've noticed is the transparency issue with the puyos and other graphics on the screen (minnade02_d4444.png), maybe you could check it out for me? The files have been uploaded here.

    Now the bad news. When I modified the main menu textures (RomFS:/main/main_menu.narc/) the game crashes. I've tested it and it seems to be happen when the xml format value is changed from 13 to 0. I have a few observations that could possibly lead to why this is occurring (main_menu.narc files uploaded here).

    - If I rebuild the .ctpk file found in main_menu.narc without changing the format value, the main menu boots but has those black backgrounds, like the title screen originally had. If I unpack modified the file, the pngs that end with etc1a4 no longer have transparent backgrounds and are black instead.

    - The single player screen has no issues working when I change the xml format value (besides that strange transparency issues shown below), but I noticed that the ctpk file only contains four etc1a4 images while the main menu ctpk has five or six. So maybe that has something to do with it.



     
    Last edited by ongo_gablogian, Jul 14, 2016