Starfield Mod:Biome File Format

'BIOME files are found in one of Starfield's ESM file and appear to contain data related to the biomes of each planet.

Overall Structure
Header (14-54 bytes) Color Data 1 (262144 bytes) Index Data 1 (65536 + 4 bytes) Color Data 2 (262144 bytes) Index Data 2 (65536 + 4 bytes)

The two image sections appear to form the top half and bottom half of a rectangular 256x512 image matching the aspect ratio of the planet textures.

Header
The first 14-54 bytes at the start of the file is a variable sized header: word U1        (261) dword Count    (1-8) dword U3[Count] (color RGB, same as in data?) dword U4       (2)

U3 appears to match the colors in the color data but its purpose is not known.

Count appears to correlate to the possible file sizes:
 * 655,406 bytes = 1
 * 655,410 bytes = 2
 * 655,414 bytes = 3
 * 655,418 bytes = 4
 * 655,422 bytes = 5
 * 655,426 bytes = 6
 * 655,430 bytes = 7
 * 655,434 bytes = 8

Color Data
Appears to be color RGBA values, 4 bytes per pixel. Has a 12 byte header indicating the image/data size. dword Width (256) dword Height (256) dword Size  (65546) rgba_t Color[Size]

== Index Data Appears to be indexed or bitflag value, usually lower numbers starting at 0, 1 byte per pixel. Has a 4 byte head indicating the size in bytes. dword Size  (65546) byte Index[Size]