Quad Info Struct - sk-zk/md155 GitHub Wiki
The quad_info
struct defines the properties of terrain quads generated by various items.
Field(s) | Description |
---|---|
u16 material_count for each: token material u16 material_rot |
The list of materials applied on this terrain. The first entry is the main material.
|
u16 color_count u32 color (repeated) |
The list of colors applied to this terrain, as RGBA. By default, this list only contains white. |
u16 size_x u16 size_y
|
The amount of terrain quad rows and columns. The grid size of a terrain is determined by the item's length and settings and can't be set freely. The game will complain about it if you do. They are calculated as follows: The game has a hardcoded sequence for row sizes: 1, 1, 1, 2, 6, 6, 10, 10, 10, 20, 40, 50, 50, 50, 100. With a terrain size of 10, for example, you get 5 rows: 1 + 1 + 1 + 2 + 6. TODO: Complete this section |
u32 storage_size
|
Total amount of terrain quads (the above two values multiplied). |
u32 data (repeated)
|
Now we get into the actual quad data; one uint per quad.
Data is stored as nibbles. Nibble 0: Nibble 1: Nibble 2: Nibble 3: Nibble 4: Nibble 5: Nibble 6: Nibble 7: |
u32 offset_count
|
Amount of terrain vertex offsets. |
The following three fields are repeated for each offset: | |
u16 offset_pos_x u16 offset_pos_y |
Coordinates of the quad corner in the grid. |
float3 data
|
The overridden position of the quad, relative to the position of the backward node. |
End of repeated section | |
u32 normal_count
|
Not sure what these normals do exactly, but the structure is the same as above. |
The following three fields are repeated for each normal: | |
u16 offset_pos_x u16 offset_pos_y |
Coordinates of the quad corner in the grid. |
float3 data
|
The overridden normal. |
End of repeated section |