3DS Data Tools: Difference between revisions

From GameBrew
No edit summary
No edit summary
Line 3: Line 3:
| image = https://dlhb.gamebrew.org/3dshomebrew/3DSDataTools.jpg|250px
| image = https://dlhb.gamebrew.org/3dshomebrew/3DSDataTools.jpg|250px
| type = PC Utilities
| type = PC Utilities
| version=unknown
| version=2016
| lastupdated = 2016/04/25
| lastupdated = 2016/04/25
| licence = Mixed
| licence = Mixed
Line 9: Line 9:
| website = https://gbatemp.net/threads/release-various-3ds-editing-tools.424118/
| website = https://gbatemp.net/threads/release-various-3ds-editing-tools.424118/
| download = https://dlhb.gamebrew.org/3dshomebrew/3DSDataTools.rar
| download = https://dlhb.gamebrew.org/3dshomebrew/3DSDataTools.rar
| source =  
| source = https://github.com/ObsidianX/3dstools
}}
}}
<youtube>Oa9ICwEm4Ks</youtube>
<youtube>Oa9ICwEm4Ks</youtube>
Line 15: Line 15:
Hey folks,
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 [[File:styles/default/xenforo/clear.png|class=mceSmilieSprite mceSmilie48|:)]]
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.


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.


'''<span style="font-size: 22px">bffnt.py</span>'''
==bflim.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.
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 [[File:styles/default/xenforo/clear.png|class=mceSmilieSprite mceSmilie2|;)]]


'''<span style="font-size: 22px">bflim.py</span>'''
==msbt.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 [[File:styles/default/xenforo/clear.png|class=mceSmilieSprite mceSmilie2|;)]]
Converts the binary &quot;message&quot; 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.


'''<span style="font-size: 22px">msbt.py</span>'''
'''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.


Converts the binary &quot;message&quot; 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==


'''<span style="font-size: 22px">sarc.py</span>'''
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.


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 [[File:styles/default/xenforo/clear.png|class=mceSmilieSprite mceSmilie48|:)]]�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.
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.


'''<span style="font-size: 18px">Dependencies</span>'''
==Dependencies==


bffnt and bflim depend on PyPng:
bffnt and bflim depend on PyPng:


* pypng - https://github.com/drj11/pypng
* pypng - https://github.com/drj11/pypng


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


* OpenCV
* OpenCV
** Windows - http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv
** Windows - http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv
** Linux - use your favorite package manager
** Linux - use your favorite package manager
** OS X - total pain in the ass with brew/macports, sorry [[File:styles/default/xenforo/clear.png|class=mceSmilieSprite mceSmilie29|:(]]
** 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.


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==
 
'''<span style="font-size: 18px">Special Thanks/References</span>'''
 
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.


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)
* MSBT - http://mk8.tockdom.com/wiki/MSBT_(File_Format)
Line 70: Line 68:
* Texture format and ETC1 decompression sanity checking thanks to EveryFileExplorer
* Texture format and ETC1 decompression sanity checking thanks to EveryFileExplorer
** https://github.com/Gericom/EveryFileExplorer/blob/master/3DS/GPU/Textures.cs
** https://github.com/Gericom/EveryFileExplorer/blob/master/3DS/GPU/Textures.cs
<div class="messageTextEndMarker">
</div>

Revision as of 09:56, 19 September 2021

Template:Infobox-3DS-Homebrews

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.

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: