Tool to extract Valheim inventory item data from asset files.
Note: asset files has to be extracted from the game before using Vide. I've successfully used AssetRipper. Short description on how to do that below. One way of doing it.
I didn't come up with the concept of this program at all. User Brandon-T did, in a discussion here. I just got inspired and wrote my own version in C# and used it as an excuse to explore things related to this. It's somewhat modified to actually work as a real program and not like the hack I started out with.
How use AssetRipper to extract resources from Valheim, steps below (here as a checklist for easy reference).
- Get a release (or the source code) from: https://github.com/AssetRipper/AssetRipper
- Unpack (or build) AssetRipper and run it.
- Load Valheim game content into AssetRipper:
- Select
File > Open Folder. - Locate and select Valheim installation folder, i.e.,
c:\Program Files (x86)\Steam\steamapps\common\Valheim\. - Wait for AssetRipper to load game content.
- Select
- Export loaded game content from AssetRipper:
- Select
Export > Export all Files. - Select (create if needed) an export folder outside the Valheim installation folder, e.g.,
c:\temp\. - Wait for AssetRipper to export game content.
- Select
Nested within the export folder there should be a folder named Assets (e.g., c:\temp\valheim\ExportedProject\Assets).
The path to this folder is what ValheimItemDataExtract expects as "source directory".
ValheimItemDataExtract is just a simple and very specialized text extractor:
- Get localization data from file
localization.txtwithin theResources\subfolder. - Get item data from prefab files (
*.prefab) within thePrefabInstance\subfolder. - Export item data to a CSV (Comma Separated Values) file, on item per line.
Assumptions made (that seems to work good enough):
- The name of a prefab file (without .prefab extension) equals the name of the item it defines.
- Not true beginning with Valheim 0.218.15 (Ashlands). Item data for some items moved to a new file with suffix '_0'.
- For now, fix is just to remove the suffix. Probably should read name of item from within file instead.
- If a prefab file has a section
m_itemDatain it, the data within that section defines item data. - If a prefab file has item data defined, it represents an inventory item only if the item name has a valid translation.