Tool TConvert - Extract content files and convert them back

trigger_segfault

Spazmatism
Heuqc2a.png


A combination tool for managing Terraria content resources. Extract from Xnbs, convert to Xnbs, backup, and restore. The unofficial sequel to TExtract.

Supports: Images, Sounds, Sprite Fonts, ReLogic's Dynamic Sprite Fonts, and Wave Banks


0WIdxpO.png


Preview

(This preview has been sped up)
XWBaOIG.gif


0WIdxpO.png


Features

~ Extract image, sound, and font resources from Terraria's Xnb files, and extract songs from Terraria's Xwb wave bank ~
~ Convert images and sounds back into Xnb format and copy them to the content directory ~
~ Backup and restore your content folder for when you need to remove changes (Glorified file copier) ~
~ Run scripts that give more control over where files go when they are converted or extracted ~
~ Drop files into the window to automatically process them ~
~ Command line support for use with Windows Shell or the command prompt ~
~ Set paths as "." to use the current directory of the executable ~

Requirements

.NET Framework 4.5.2 | Windows 7 or later

Downloads: v1.0.2.1

TConvert-1.0.2.1.exe
(The main UI-based executable)
TConvert-Console-1.0.2.1.exe
(The pure terminal version of TConvert. Works better in command prompt but has no UI)

~ Previous downloads can be found at the bottom of the page ~

0WIdxpO.png


Script Guides

How to Write XML
How to Write Scripts
Example Script


Links

Wiki | Credits | Image Album | Source Code

0WIdxpO.png


⬅ Other Information

v1.0.2.1
  • Program no longer crashes when failing to find the Terraria install directory and trying to extract a Wave Bank.
v1.0.2.0
  • Both now support premultiplying image alpha when converting to XNB. Note: This feature is enabled by default as most users will be expecting it (especially when A == 0 and RGB != Black)
v1.0.1.0
  • Now packaged with the full version of FFmpeg, which drastically increased the file size of the executable.
  • Numerous non-wave audio formats are now supported.
  • Now launches Terraria from the configured save folder in Terra Launcher if present on the computer.
  • A bit of code refactoring.
v1.0.0.4
  • No longer throws an error when encountering comments in xml scripts.
v1.0.0.3
  • Wave Banks can now extract to and from paths with spaces in them.
  • Renamed extracted tracks and TrackList file.
v1.0.0.2
  • Font checkbox in extract tab should properly disable.
  • No more errors related to invalid or null paths.
v1.0.0.1
  • Fixed an outdated error message window using the old program name and not linking to the correct GitHub page.
v1.0.0.0

The first release. Comes with everything you need to convert and extract Xnb files.
 
Last edited:
Nice! Very useful.

Correct it can't extract shader? I get some error message:
Error: Extracting:...amapps\common\Terraria\Content\PixelShader.xnb
Reason: Xnb error (Unsupported asset type: Microsoft.Xna.Framework.Content.EffectReader.)
Error: Extracting: ...amapps\common\Terraria\Content\ScreenShader.xnb
Reason: Xnb error (Unsupported asset type: Microsoft.Xna.Framework.Content.EffectReader.)
Error: Extracting:..mapps\common\Terraria\Content\TileShader.xnb
Reason: Xnb error (Unsupported asset type: Microsoft.Xna.Framework.Content.EffectReader.)

Did you made some change at the image size? E.g. NPC_276.png is 46x842 but has 15 different states. But you cant divide 842 by 15. Last two pixel not needed. Or do you know the reason for those sizes?
 
Last edited:
Nice! Very useful.

Correct it can't extract shader? I get some error message:
Error: Extracting:...amapps\common\Terraria\Content\PixelShader.xnb
Reason: Xnb error (Unsupported asset type: Microsoft.Xna.Framework.Content.EffectReader.)
Error: Extracting: ...amapps\common\Terraria\Content\ScreenShader.xnb
Reason: Xnb error (Unsupported asset type: Microsoft.Xna.Framework.Content.EffectReader.)
Error: Extracting:..mapps\common\Terraria\Content\TileShader.xnb
Reason: Xnb error (Unsupported asset type: Microsoft.Xna.Framework.Content.EffectReader.)

Did you made some change at the image size? E.g. NPC_276.png is 46x842 but has 15 different states. But you cant divide 842 by 15. Last two pixel not needed. Or do you know the reason for those sizes?

Yes, it's correct to say that shaders are not extractable. Whether it's even possible to decompile shaders in the first place is something I'm not sure of.

No changes are made to the extracted images, they are extracted exactly as they are stored. I guess this is either a simple mistake on Terraria's end, or a buffer to prevent looking outside the image. Other reasons are certainly a possibility.
 
I just found out that TConvert has a fairly large 'bug' in it. If you use white transparent pixels in a sprite, these pixels are converted to opaque white pixels. What I mean by 'white transparent pixels' is pixels that are fully transparent, but have an RGB value of 255, 255, 255.
 
I just found out that TConvert has a fairly large 'bug' in it. If you use white transparent pixels in a sprite, these pixels are converted to opaque white pixels. What I mean by 'white transparent pixels' is pixels that are fully transparent, but have an RGB value of 255, 255, 255.

Whoops. Looks like I forgot to premultiply the alpha. Amusingly enough I just pushed this same fix to png_to_xnb a few months ago. I'll get right on this.

A basic rundown for those who aren't familiar: Premultiplying alpha is what XNA does by default to images so that they're ready to be drawn without having to multiply the RGB channels by the alpha every time the image is drawn at runtime.

Edit: And v1.0.2.0 is live with premultiplied alpha (Now the default setting).
 
Last edited:
I'm sorry to bug, but is it at all possible to convert text back to Xnb format? I know your list doesn't say so, but I wanna be sure. And if not, is there anyway? Google isn't helping much at all.
 
I'm sorry to bug, but is it at all possible to convert text back to Xnb format? I know your list doesn't say so, but I wanna be sure. And if not, is there anyway? Google isn't helping much at all.

For the fonts, there's no way to convert them back in TConvert, at least not yet. :dryadcool:

I'll peek at the DynamicSpriteFont reader to see if Terraria's code has an existing way to build them. Otherwise creating a way to build them myself may not be too hard. I can't guarantee anything though.

I need a Mac version
I agree. When TConvert replaced TExtract as the stickied tool for game assets, it made it much harder to find crossplatform support for extraction.

I'll see if it's possible to either
A:
Fix the main crash issue with TExtract and release a new working version. (assuming the original developer is okay with that)​
B:
port the no-UI terminal version of TConvert to Mono (or whatever Terraria currently runs using on Mac) or dotnetcore (which isn't great since most systems won't have dotnetcore installed), I won't be able to port the UI in TConvert. :(
 
I don't if it's just me or, but it doesn't seem to work for 1.4.1 currently. It won't make any of the textures actually appear, only the files are there.
 
Back
Top Bottom