Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Joined: Dec 2025
stranger
OP Online Content
stranger
Joined: Dec 2025
I'm trying to write program with one of purposes to provide browser for all .dv2 assets. That includes reading .dv2 files (which are basically zlib-based achieves), building virtual directory tree and viewing their internal contents.
While .nif files are pretty clear, since they're simple Net Immerse assets containing scenes, .xml files are covered in darkness.
These files seem to contain a lot of important data, such as teleports.xml, so I want to write reader for them.
They are kind of .nif files, but with only one node called "xml::dom::CStreamableNode". All I know about this node data is:
- First 8 bytes seem to be 2 uint32 with unknown purpose
- Next 4 bytes are uint32 representing string pool length
- Next data is a string pool, sized by previous integer
Further data purpose is unknown.
I found absolutely zero information on the web about this "xml::dom::CStreamableNode" block, so it seems to be larian-invented. If someone could help understanding these files, I'll really appreciate it!

Joined: Dec 2025
stranger
OP Online Content
stranger
Joined: Dec 2025
Alright, it seems to be written with StreamLib (larian proprietary library). I've found lslib as reversed alternative, but it was written for original sin. Not sure how it will work for Ego Draconis. And it's on C#.

Joined: Dec 2025
stranger
OP Online Content
stranger
Joined: Dec 2025
Ok, so I managed to figure it out by disassembling the game code.

Structure of block is:
u32 - total amount of nodes
u32 - total amount of properties on all nodes
u32 - total size of string table
u8 * total size of string table - string table itself, act as a queue; where you see string, asume that string should be popped from this queue

next follow nodes. Node layout is:
u8 - node flags
u32 - node id (some random number, it's fine to have absurd big number here)
if have name:
string - node name
if have properties:
u8/u32 - property count
next follow properties. Property layout is:
u32 - property type (not data type actually, assume it as property name; on different nodes, properties that form similar groups with seemingly similar purpose have same types)
string - property value
if have children:
u8/u32 - children count
... - end of block, following bytes define children nodes; when child node have it's own children, it should write them before we move to the next node on same depth

Node flags are:
0x01 - does node have name
0x02 - does node have properties
0x04 - does node have children
0x08 - do property/children counts take 1 byte or 4 (raised flag means 1 byte, i.e. compact number, 4 byte otherwise)

I hope that will help someone doing codding stuff for that game <3


Moderated by  Bvs, ForkTong, Larian_QA, Lar_q, Lynn, Macbeth, Raze 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5