Hello!
I recently had a problem with DS3 materials and mapped out layout of almost all GX## GXItems. I think, it would like be beneficial if this data was included in SoulsFormats for others to use.
Data sources
All the results and claims I make below are based on Data from DS1, DS2, DS3, Bloodborne, Sekiro, and Elden Ring. I collected the material information (Material + GXLists) of all FLVER files (.flver, or .flv) in those games. All the raw data can be found here.
I want to thank Rayan(Dahoom) for providing me with the Bloodborne data.
The GX## data
The mapping includes:
- The Unk04 for all GX## (where ## are digits).
Turns out, that this number is determined by the GXItem ID.
Correction: Unk04 is unique for all GX## except GX00. For GX00, there exists 100 (used in BB, DS3, SK, ER), 101 (used in SK), and 102 (used in SK, ER). The data format of all these GX00 variants are different. This is why I now believe that Unk04 is a version number for GX## (where ## are digits). If 100, 101, and 102 are read as v1.0, v1.1, and v1.2, then those differences make some sense. This also explains why most Unk04 values are 100 across BB, DS3, SK, and ER.
- The layout and corresponding DS3 debug menu settings of almost all GXItems's data bytes.
The data bytes are especially useful. It's obvious that those bytes are just a list of either int32 or float32 values. Turns out, the number of those values + their type (int or float) is determined by the GXItem ID + Unk04. So I created a mapping of almost all GXItem data values to their corresponding DS3 debug menu entries. This mapping includes:
- The name of the corresponding setting in DS3's Debug menu.
- The type of the value (int32/float32/bool/enum).
- The ranges of the values. If the data type is an int or float, I included min and max bounds if the debug menu had them. So we know that e.g. BlendMaskIntensity is a float between 0 and 100. I included this information so that others can potentially build UI tooling around this data. If the value is an enum, I also included a mapping of all possible values to their names.
DS3, SK, and ER also have GXMD GXItems (items with "GXMD" as their ID). They are rare, and their bytes have a custom format. The bytes essentially contain a map<ID, Value>
where ID
is an int and Value
is either a float, float2, float3, or float5. Other value types are likely also possible, but I only found GXMD with those types. Unfortunately, I don't really understand GXMD. The strange thing about it is that the same ID can have different types of data. E.g. the ID 95 has a float2 value in some files and a float3 value in others. No idea what that is about.
So I don't have a mapping for GXMD, but I did write a parser for it.
Data
Here is a JSON with descriptors for almost all GX## (where ## are digits) items. The descriptors follow this format, so you can use JsonSerializer.Deserialize
to parse the JSON.
Here is a JSON list of all Unk04 values I found for GXMD items in DS3, SK, and ER.
Example
This is the descriptor (simplified) for GX03 v1.0:
{
"ID": "GX03",
"Unk04": 100,
"Items": [
{
"Name": "[Emissive] EmissiveIntensity",
"Type": 2,
"Min": 0,
"Max": 8
},
{
"Name": "Unknown",
"Type": 0
},
{
"Name": "Unknown",
"Type": 0
},
{
"Name": "Unknown",
"Type": 0
}
]
}
This data layout (Items) of the GX item. The data of every GX03 item always contains 4 values. The first value is a float between 0 and 8 that is called "[Emissive] EmissiveIntensity" in the debug menu. The 3 remaining values are unused.
Almost
I said "almost" a few times. That's because a few GX## items are not mapped or only partially mapped.
- I did not find the GXItem values for the settings "[Shadow] DisableCasting" and "[Shadow] CullingMode".
- GX15 is only partially mapped. It controls SSS (sub surface scattering) settings, and messing with them crashed my game, so I stopped investigating them.
- GX16-GX19 are not mapped. DS3 contains no file with these GXItems, so I didn't map them. They likely also control SSS settings.
- GX10 and GX11 are not mapped. Same reason as before, no file contains them.
Apart from that, everything is mapped. All remaining "Unknown" items (example) are unused values. They do not appear in the debug menu and all files in DS3 set them to 0. It's likely that From added a few vacant items for future extensions. I believe that this can already be seen in GX07 where the ScrollSpeeds for Normal3 are suspiciously last.
GXMD format
While the parser also knows the format, I wanted to write it down here. The GXMD bytes have the following format:
The bytes are either int32 or float32 values (meaning that the total number of bytes is a multiple of 4).
The stream of values starts with an int32 that is the number of items. This number is always present. After this, only items follow. Each item start with 2 int32s. The first int is the id of the item. The second int is the data type. Depending on the data type, some number of floats follow. The stream ends after all items have been read. There is no ending 0 or similar.
It's important to note that item ids are unique, but may appear in any order. That's why I said that GXMD data is essentially a map.
Correction: What I said above is correct for DS3. In SK and ER, From extended the GXMD format. Each item can now be optionally followed by a "flag". This flag is a boolean value that is kinda like a second value for that item. While an unflagged item has the format id, dataType, data
, a flagged item has the format id, dataType, data, id, dataType=0, data=0|1
. I have no idea what those flags do in SK and ER. They are also somewhat rare.
Adding it to SoulsFormats
This data is applicable to Bloodborne, Dark Souls 3, Sekiro, and Elden Ring. DS1 PTDE does not use GXItems. DS2 has a weird GXItem format that I don't really understand, but it seems to be similar. I have not tested DS1 Remastered and Demon Souls.
I do not plan on making a PR, but feel free to ask me anything if you have questions.
All my code and data is licensed under CC0, so take whatever you want.