[Tool] TpacTool - An unofficial asset explorer [0.4.0]

Users who are viewing this thread

Hey there. It's been a month since the early access of Bannerlord was released, and its modding community has grown a lot. However there is still no way to manipulate the game assets, so I made a tool to open the asset packages, i.e. tpac files.

Although its name contains "Tool", it still lacks some important features. For example, importing. So far it can only preview and export models, textures and skeletons. That's why I call it an explorer. There is some distance to a complete editor, anyway.

And I'm sure you guys know the rules. Everything extracted from the tpac files belongs to its producer - in other words, belongs to Taleworlds. You should only use them for studying and modding purposes.


Model


Material


Texture






Some exported models in Blender. Show the rigged model and the morph (facial expression ).

Download: https://1drv.ms/u/s!AvLke0JkRmqFgZUQATQ-2opE72JK_A?e=pX29d5

Website: https://github.com/szszss/TpacTool

TpacTool is an open source software. You can keep track of its progress on that website, and even contribute to its development.

v0.4.0
Support latest (1.8.0 beta) Bannerlord.
New OpenGL preview renderer.
Support previewing of BC6 and BC7 textures.
Support previewing of green and blue channels for texture.
Support exporting models in FBX format.
Support exporting skeletal animations and morph animations in FBX format (exporting animations in DAE is not supported).
Support exporting all LODs of model.
Fix the problem that assets could not be selected after clearing filter boxes.
Fix a problem about quaternions, which caused the orientation of bones to be exported incorrectly, and any animation made with this skeleton would twist the character when used in-game.

v0.3.2
Support latest (1.5.8 beta) Bannerlord.

v0.3.1
Fix a bug when exporting morphed models with negative-Y forward.

v0.3.0
Support latest (1.5.7 beta) Bannerlord.
Support exporting models and skeletons with negative-Y forward.
Improve asset trees. Support asset filter.
Fix the orientations of bone when exporting skeleton. Only tested in Blender.
Change the format of morph names. Add a hardcoded facial morph names remapping.

v0.2.0
Support latest (1.5.2) Bannerlord.
Support to load tpac files from sub directories. Now you can assign EmAssetPackages as the working directory. (And it's recommended because the tpacs in EmAssetPackages contain textures!)
New model previewer.
Fixed the broken horse skeleton exporting.
Fixed the crash when export mega textures. (For example, main_map_area. It took me one minute and 5G memory to export it, good luck.)
Fixed a Collada (.dae) exporting bug which caused the exported model cannot be imported by Blender 2.83+
Slight performance improving.

When exporting models with skeletons using TpacTool, It's highly recommended that export them in FBX format. Blender cannot import skeleton correctly from DAE. The orientation (roll) of bones will be different from the actual skeleton. It doesn't affect models you make, but if you make animation based on improper skeleton, it will look weird in game.

When importing skeletons and skeletal animations in FBX to Blender, using these settings:
Armature - Primary Bone Axis: X Axis
Armature - Secondary Bone Axis: Y Axis

When exporting skeletons and skeletal animations in FBX from Blender, using these settings:
Armature - Primary Bone Axis: X Axis
Armature - Secondary Bone Axis: Y Axis
Armature - Add Leaf Bones: Uncheck

When exporting morph animation in FBX from Blender, using these settings. Because of a bug since Blender 2.80 (Issue T66272), if you check either NLA Strips or All Actions, Blender will refuse to export any morph animation:
Geometry - Apply Modifiers: Uncheck (Any model with shape keys should always uncheck this option!)
Bake Animation: Check
Bake Animation - NLA Strips: Uncheck
Bake Animation - All Actions: Uncheck

Eyebrows are not driven by morph. They are driven by mesh deforming. You can use Surface Deform modifier on the eyebrow models and bind them to head models to simulate this effect.

Q: Why are so many textures missing?
A: About half of the textures of Bannerlord are stored in the TileSets archives (*.gtex files). It's a private file format of Graphine, and I can't decode it. Unfortunately, all these textures are important. For example, the diffuse (color) and normal of the material.
I'm still studying the clockwork toy of Graphine. But don't expect it too much, it will cost lots of time, patience, sanity and luck…
Update: Taleworlds has packed most textures into the files in EmAssetPackages. You can select it as the working directory to view those textures.

Q: My Photoshop cannot open some exported DDS textures
A: The dds plugin of your Photoshop is outdated. Install the Nvidia DDS Plugin or the Intel DDS Plugin, or try other alternative software, e.g. Paint.NET.
 
Last edited:
You were saying in your github that you needed help with force fields. What do you need to know about that?
 
You were saying in your github that you needed help with force fields. What do you need to know about that?

I googled the vector field and I learnt that it's a kind of particle system. This should be correct because all PVFs are in the particles package. Whatever, it's beyond my knowledge.
Anyway, it's not a high priority task. There are only two PVFs in the game assets, and they even don't have regular names. Seems that even Taleworlds doesn't take it seriously.
 
Hi there, really nice job on reverse engineering tpacs, i didnt expect it that soon, grats! Just to add, we dont really mind if tpacs are broken or not, but gtex format is not ours, it is Graphine's property, i can't really talk for them but reverse engineering that files can be problematic.
 
I googled the vector field and I learnt that it's a kind of particle system. This should be correct because all PVFs are in the particles package. Whatever, it's beyond my knowledge.
Anyway, it's not a high priority task. There are only two PVFs in the game assets, and they even don't have regular names. Seems that even Taleworlds doesn't take it seriously.

Not exactly, a vector field is like a 3D area (field) where for each point, we can indicate a direction (vector). Usually this is represented using a 3D texture, where the rgb values represent a 3D vector (not necessarily normalized). You can think of it as a 3D flow map if you are familiar with that.
This is usually used for particles as you mentioned, to simulate wind or some kind of motion on particles on a small scale.

Now about the procedural part, I'm really not sure what they mean by this. It could be that the vector fields can be created on the fly and can change over time, so that they don't need to store a 3D texture for that, but instead it's represented by mathematical functions.

I didn't notice any example of them being used in the game so far (maybe on the title screen?), so yeah, probably not the highest prio for now.
 
WXXKA2KCZBHWVCS3S4MVPH2GVA.gif

Ouyeah!
 
If Taleworlds is angry, there may not be a good MOD editor This will kill all mods. Or Taleworlds will be more likely to add more restrictions. . Please stop the import function first. . Taleworlds needs more time to perfect its game.
 
Wow, didn't expect a tool like this so soon!

Having trouble exporting large textures. Mainly main_map_area, main_map_n. Seems to crash. Still a great tool!
 
Wow! It's great! One thing that I could suggest would be using either alembic or USD as export format rather than obj. Both of them are open source and are scene description rather than just geometry description. Trying to add by myself, but I'm still learning C#
 
Last edited:
Hi there, really nice job on reverse engineering tpacs, i didnt expect it that soon, grats! Just to add, we dont really mind if tpacs are broken or not, but gtex format is not ours, it is Graphine's property, i can't really talk for them but reverse engineering that files can be problematic.

tw just release the tools while you have all these people. so modders can fix the game . Great job
 
great job! until objects cannot be imported we are not going to see good mods. I hope they don't take long to release the tools editor.

te red one is from warband, they are quite similar in size, change the position of the arms, and the bannerlord models are lying down
tt110.png

tt210.png
 
Last edited:
Back
Top Bottom