Tyulis / 3DSkit

A multi-purpose and pluggable program to extract and repack files found in 3DS (and some other Nintendo consoles) games
GNU General Public License v3.0
67 stars 11 forks source link

No Support for packing BFFNT v4.1 #22

Open apolope opened 5 years ago

apolope commented 5 years ago

I can unpack and make changes, but I can not package. I'm new to this and I do not know if I'm doing it right.

I unpacked with these arguments python 3DSkit.py -xf BFFNT -O reverse=true -O origin=NX "MessageFont38.bffnt"

And I try to pack with these arguments python 3DSkit.py -pf BFFNT -O reverse=true -O meta="MessageFont38_meta.json" "MessageFont38_sheet0.png" "MessageFont38_sheet1.png"

Returns this message UnsupportedFormatError: 3DSkit is currently unable to pack this format (101)

FontData.zip

These are files from the Super Mario Odyssey game of the Nintendo Switch

Forgive me for my lack of knowledge.

Tyulis commented 5 years ago

That's because the BFFNT packer is not released yet ^^ Don't know why did i put this in the Readme so early...

apolope commented 5 years ago

Thanks for agile answer, congratulation for your commitment. I'm waiting for the launch of this feature, so I finish the translation of the game. I would like to be able to help you implement, but I do not know much about python. I'm available for whatever I can help. Thanks so very much.

masagrator commented 5 years ago

I see that this was for many months in readme. Is this feature progressing or not? I would be happy for every to->BNTX or to->CMAP converter.

Tyulis commented 5 years ago

I develop 3DSkit on my free time...

And the problem is that i don't have free time. So i try to answer to issues as fast as i can, but i can't work on this as fast as i'd like. Making a module is quite complicated, as it is not always well documented, so i have to document, program, test, re-program, ... And BFFNT is one of the most complicated formats i worked on.

Anyway, don't know why this was in the Readme. I'll try to do that, and as always any help is welcome for other formats ^^

Tyulis commented 5 years ago

It would be very difficult to keep a quick made extractor in the BFFNT module. So this is what i'll do :

It may be a bit longer, but it's necessary to keep the consistency of 3DSkit, and just to rebuild correctly the files.

apolope commented 5 years ago

Thanks for your commitment!

Unfortunately I'm a newbie on this and not know very much. Would like to help...

@masagrator helped me a lot. Just as you have helped a lot of people too and me.

When finish let us know. And we can ends ours projects. Thanks!

Tyulis commented 5 years ago

Just a few news : the BNTX packer is on the way, i'm just struggling with texture compression but it should be done today or tomorrow.

Migushthe2nd commented 5 years ago

Regarding the BNTX extractor:


3DSkit.py -xf BNTX __Combined.bntx -v

--------__Combined.bntx--------
No compression
BNTX file found
Extracting...
File version : 0.4.1.0
Extracting texture BalloonTipShdw^s, element 0
0
Extracting texture BalloonTip^s, element 0
0
Traceback (most recent call last):
  File "K:\NSW\Themes\Very nice theme\tools\clean_3DSKit\3DSkit.py", line 249, in <module>
    result = main(args, opts)
  File "K:\NSW\Themes\Very nice theme\tools\clean_3DSKit\3DSkit.py", line 169, in main
    extract_files(filename, args.big, args.format, args.verbose, opts)
  File "K:\NSW\Themes\Very nice theme\tools\clean_3DSKit\3DSkit.py", line 112, in extract_files
    unpack.extract(filename, file, format, endian, verbose, opts)
  File "K:\NSW\Themes\Very nice theme\tools\clean_3DSKit\unpack\__init__.py", line 16, in extract
    unpacker = cls(*args)
  File "K:\NSW\Themes\Very nice theme\tools\clean_3DSKit\util\utils.py", line 18, in __new__
    return self.main(*args, **kwargs)
  File "K:\NSW\Themes\Very nice theme\tools\clean_3DSKit\unpack\BNTX.py", line 59, in main
    texmeta.append(self.read_texture(data, brtioffset))
  File "K:\NSW\Themes\Very nice theme\tools\clean_3DSKit\unpack\BNTX.py", line 159, in read_texture
    libkit.extractTiledTexture(indata, out, width, height, format, swizzle_value if tilemode == 0 else -1, self.byteorder == '<')
  File "K:\NSW\Themes\Very nice theme\tools\clean_3DSKit\py3DSkit\graphx.py", line 367, in extractTiledTexture
    _extractBC4Texture(input, output, width, height, format, swizzlesize, littleendian)
  File "K:\NSW\Themes\Very nice theme\tools\clean_3DSKit\py3DSkit\graphx.py", line 360, in _extractBC4Texture
    output[outpos] = output[outpos + 1] = output[outpos + 2] = lum
IndexError: index 572 is out of bounds for axis 0 with size 572

The file is from the ResidentMenu of the Nintendo Switch https://drive.google.com/file/d/1aJUnRfWBK6dARm-vLyI0Y_XP3Iviv8rS/view?usp=sharing

Excuse me if I reported this too soon, or it might be

currently only extracts uncompressed 2…

Tyulis commented 5 years ago

Congratulations : you found a new version ^^" If you don't mind I'll first finish the BFFNT stuff and then i'll try to fix that. But thank you very much for your contribution !

Tyulis commented 5 years ago

The BNTX packer is seemingly working, now i start the BFFNT packer ^^

apolope commented 5 years ago

Very good and congratulation for your work. I was job travel, and now go test.

Tyulis commented 5 years ago

Pfff... Really sorry for the wait, no time at all this month... Anyway, it works quite well, just a few things to fix and it should be done

Tyulis commented 5 years ago

So.... Finally it's committed, you can try if it works ^^

TROguz commented 5 years ago

Good new. Can you share bffnt repack tools?

Tyulis commented 5 years ago

They are already in the repo, just pull it ^^

TROguz commented 5 years ago

Oh, nice. Thank you. I want to edit zelda botw and wind waker hd fonts. This bffnt script its work on Wii U games?

TROguz commented 5 years ago

Why give me error script? SyntaxError: unexpected character after line continuation character

TROguz commented 5 years ago

Can you build this tools?

masagrator commented 5 years ago

This is python script. What you want to build? I will test it in couple of days on Super Mario Party fonts.

TROguz commented 5 years ago

I want bffnt unpack repack fonts. But script give me error for unpack. Example Zelda wind waker hd fonts: https://www94.zippyshare.com/v/4JOtjm8y/file.html

masagrator commented 5 years ago

For me your WiiU bffnt is extracting normally, json is good, but textures are broken. python 3dskit.py -x -O origin=CAFE CKingMain.bffnt

TROguz commented 5 years ago

Thanks but where is the problem? https://prnt.sc/nv28fl

masagrator commented 5 years ago

Don't try to run it from python command line. Just put this whole line to cmd with python at the beginning

Tyulis commented 5 years ago

Currently it only repacks Switch fonts, but i'm working on WiiU ones. I'll take a look at your file ^^

TROguz commented 5 years ago

Thanks but i cant unpack. Can you make tutorial video for unpack and repack? Thanks for everything.