3DS Data Tools

From GameBrew
Revision as of 04:05, 16 June 2021 by HydeWing (talk | contribs) (Created page with "{{Infobox 3DS homebrew | title = 3DS Data Tools | image = https://dlhb.gamebrew.org/3dshomebrew/3DSDataTools.jpg|250px | type = PC Utilities | version = | licence = Mixed | au...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Template:Infobox 3DS homebrew

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:



bflim will utilize OpenCV, if available, for swizzle support (rotate/flip operations on the image)



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.


Advertising: