grid_pc file format

Discussion in 'Guides and Tutorials' started by [V] Knobby, Mar 20, 2017.

  1. [V] Knobby

    [V] Knobby Volition Staff

    The world streaming code uses a grid file to define the zones and zone swaps that exist. This allows us to avoid searching for files at level load. Here is the format of that file:

    Code (Text):

    int32 version (5)
    int32 number of layers (5: always loaded = 0, interior = 1, world = 2, world high lod = 3, mission = 4)

    for each layer
     uint16 layer number
     uint16 number of arrays in this layer(each dlc and the main game had an array of zones)
     uint32 number of zones in this array
     uint16 array index(we saved dlc to their own grid file and it would be built at runtime)
     for each cell
      uint16 cell index
      uint16 layer index
      uint8 grid x coord
      uint8 grid y coord
      uint16 num versions(zone swaps)
      for each version
       string for zone name (probably not null terminated with a number of characters at the beginning) (can be "null" if no base version of zone)
       uint16 version? (always 0xFFFF)
  2. "number of zones in this array" seem to be code on 2 bytes, not 4.
    The next two bytes is actually the size of the string.

    uint16 number of zones in this array
    for each zones in the array

    uint16 size of string for zone name
    string for zone name
    uint16 version? (always 0xFFFF)

    Nevermind, I was mistaken.
    Last edited: Mar 21, 2017
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice