More actions
Hey folks,
A while back I started translating Rhythm Tengoku The Best+ (before Nintendo announced the US release -_-) and couldn't find tools that were cross-platform and worked with the specific (newer?) NintendoWare formats found in RTG, so I decided to write my own :)
https://github.com/ObsidianX/3dstools
These tools are all written in Python and should be cross-platform compatible, though I wrote them all in Linux and haven't tested them in Windows so patches/bug reports are welcome.
bffnt.py
Extract, edit, and re-create fonts in the bffnt format.�It outputs a PNG of each texture sheet found in the source bffnt (usually just one) and a JSON manifest that describes each glyph.
bflim.py
Convert bflim images to and from PNG format for editing.�Supports conversion of all texture formats but cannot create ETC1 bflim files because I didn't need it at the time and ETC1 compression is a bit more involved than just re-encoding pixels ;)
msbt.py
Converts the binary "message" text files to a JSON object for editing and re-packing.�Has minimal support for the color format found in RTG and a couple other games I'd found that use colored text.�Fair forewarning: the JSON format is horrible in order to maintain the original binary structure in the event that it matters to the game.�I never tested whether I could modify the structure since this worked well enough.
sarc.py
Extracts and creates SARC archives with zlib compression support.�In RTG all SARC files are zlib-compressed with the size of the original file prepended to the beginning of the file.�This feature may not be needed outside of RTG but it's there :)�The SARC archives were the main thing keeping the game from accepting my modified files until I had figured out the big thing that differentiates them from the other *ARC formats: sorted entires.�The files are sorted within the archive based on the hash associated with each file entry.�Once that part was figured out the game would boot and everything was spiffy.
Dependencies
bffnt and bflim depend on PyPng:
- pypng - https://github.com/drj11/pypng
bflim will utilize OpenCV, if available, for swizzle support (rotate/flip operations on the image)
- OpenCV
- Windows - http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv
- Linux - use your favorite package manager
- OS X - total pain in the ass with brew/macports, sorry :(
If you don't install OpenCV you can perform the de-swizzling yourself with your favorite image editor, but ensure that you re-swizzle images to the orientation they were in before repacking and set the right flag.�In RTG at least, the swizzle still needed to be applied, perhaps because of the Layout remembering or something.
Special Thanks/References
Most of the RE work for these file formats were done by other wonderful homebrew developers with only a little extra work needed for the different format versions and missing pieces (The hardest being BFFNT).�None of my work is based off of any proprietary NintendoWare code or tools.
- MSBT - http://mk8.tockdom.com/wiki/MSBT_(File_Format)
- BFLIM
- BFFNT - http://3dbrew.org/wiki/BCFNT (v4 data added by me)
- v4 info gleaned from https://github.com/dnasdw/3dsfont
- SARC - http://mk8.tockdom.com/wiki/SARC_(File_Format)
- Texture format and ETC1 decompression sanity checking thanks to EveryFileExplorer