vgeo_idx - themeldingwars/Documentation GitHub Wiki

Virtual Geometry Index

The static.vgeo_idx file is an index coupled to the static.vgeo file, and is needed to parse the data. This static.vgeo data is used to render geometry data for the .gtchunks.

The static.vgeo data consists of vertices, sectioned into pages. Each page can contain up to 2048 vertices.

The system is believed to have been introduced in patch 0.6. The earliest known build with is beta-1586.

Two versions of these files are known, distinguished by the version in the static.vgeo_idx header. These are version 1 and version 3. The difference is that in version 3, data in static.vgeo is compressed with LZMA, and pages do not contain a uniform amount of data. This results in the static.vgeo_idx containing some additional data.

To parse a page from version 1, use the static.vgeo_idx to jump to its offset, then parse 27 bytes per vert as specified by the number of verts in the index.

To parse a page from version 3, after jumping to the startOffset, use the sectionSize to slice out the data of the page. Read the first byte to determine size per vert (0 => 23, 1 => 27). Then decompress the remaining data with LZMA, calculating the output size as the numVerts specified in the index multiplied by the size per vert. Finally, parse the decompressed data as verts of the given size, and use the set bits of vertIndexBitfield to determine the index of each vert.

010 Editor Template