Jump to content


Photo

Fable Lev File Format


  • Please log in to reply
2 replies to this topic

#1 Keshire

Keshire

    X-S Senior Member

  • Members
  • PipPip
  • 270 posts
  • Location:The Shire Mountain on the small island of Pokaponesia
  • Interests:Logic, Reasoning, and Psychology.<br />Programming, Graphic design, and The strange and True.
  • Xbox Version:v1.0
  • 360 version:v1 (xenon)

Posted 19 May 2005 - 06:05 AM

So who wants to code a map editor for us?

--------------------------
--- Level file header ----
--------------------------
CODE

4 bytes: A 32 bit integer that's the size of the level file header
(which is always the same as you've noticed).

4 bytes: An 8 bit integer (with 3 bytes of padding) that describes the version number of the header (always the same again).

4 bytes: A 32 bit integer that refers to the position in the file where the map data is.

4 bytes: Unused

4 bytes: A 32 bit integer that refers to the position in the file where some now obsolete data is.

4 bytes: Unused

4 bytes: A 32 bit integer that refers to the position in the file where the navigation data is.


Straight after that header is the header to the map data. If I've
calculated it correctly the third 32 bit integer above should always be
28, which is where the map data header starts.

--------------------------
--- Map data header ------
--------------------------
CODE

4 bytes: A 32 bit integer that's the size of the file header (should always be the same for every level).

4 bytes: An 8 bit integer (with 3 bytes of padding) that describes the version number of the header (always the same again).

8 bytes: A 64 bit integer that describes how many Unique IDs for things that have been used.

4 bytes: The map's width (length along the X axis) (32 bit integer)

4 bytes: The map's height (length along the Y axis - in Fable Z is "up", or height above sea level) (32 bit integer)

4 bytes: A Boolean (with padding) which is always true

33792 bytes: A "palette" of themes that can be on the height field

4 bytes: Another 32 bit integer version number. Will always be 3.

4 bytes: The number of sound themes that are available. Should be the same for all maps.

33792 bytes: A "palette" of sound atmosphere themes that can be on the height field.

4 bytes: A checksum


There then follows a number of sound theme strings saved out. The number
saved out is the one read in above. For each one saved out there's a 4
byte integer giving the number of bytes in the string, then the string
itself.

Then, the real meat of the file: the heightfield data. Width*Height
(read in above) cells are written out. I think they're written out from
the lowest X and Y coordinates, filling in an X row at a time. It
shouldn't be too hard to work out whether that's right or not. smile.gif A cell
consists of the following data:

--------------------------
--- HeightField Data -----
--------------------------
CODE

4 bytes: A 32 bit integer that's the size of the cell being written (should always be the same for every cell).

4 bytes: An 8 bit integer (with 3 bytes of padding) that describes the version number of the cell (always the same again).

4 bytes: A 32 bit floating point number that's the height of the ground at that point divided by 2048.

1 byte: Should be 0.

3 bytes: These are actually an array of 3 single bytes. Each byte refers to a ground theme in the palette defined in the header.

3 bytes: This 3 element array of bytes contains the strength of the ground themes in the previous array. The three numbers should add up to 255.

1 byte: A Boolean that specifies whether the hero can walk on the ground at this point.

1 byte: A Boolean that specifies whether the camera is allowed to pass over the ground at this point.

1 byte: Unused

1 byte: Should be 0.

1 byte: Boolean that specifies whether this cell is a shore point

1 byte: Unused in the game itself.

3 bytes: Padding


There then follows another Width*Height amount of cells. These cells
have the following format:
CODE

4 bytes: A 32 bit integer that's the size of the cell being written (should always be the same for every cell).

4 bytes: An 8 bit integer (with 3 bytes of padding) that describes the version number of the cell (always the same again).

3 bytes: A 3 element array with each byte referring to a sound atmosphere theme in the palette defined in the header.

3 bytes: A 3 element array that contains the strength of the sound atmosphere themes in the previous array. The three numbers should add up to 255.

1 byte: A sound theme palette index.

1 byte: Padding


#2 Keshire

Keshire

    X-S Senior Member

  • Members
  • PipPip
  • 270 posts
  • Location:The Shire Mountain on the small island of Pokaponesia
  • Interests:Logic, Reasoning, and Psychology.<br />Programming, Graphic design, and The strange and True.
  • Xbox Version:v1.0
  • 360 version:v1 (xenon)

Posted 30 June 2005 - 06:22 AM

Bump. The amount of dedicated coders for fable projects has dropped to nil. I'm not a coder myself but know enough about hex to try and crack the file formats (ie LEV/BIG/WAD files). We're also having issues with the navigation data at the end of the files. It's preventing all ground based NPC's from walking on lev files that don't have that data. (ie fillers).

I think it's way-point based, but It's very convulated in how it was set-up.

Also, anyone experianced with model and animation formats, and writing 3d app plug-ins are sorely needed.

have I asked for enough? wink.gif

As a non-coder I've tried my best to make headway into these formats.

#3 Keshire

Keshire

    X-S Senior Member

  • Members
  • PipPip
  • 270 posts
  • Location:The Shire Mountain on the small island of Pokaponesia
  • Interests:Logic, Reasoning, and Psychology.<br />Programming, Graphic design, and The strange and True.
  • Xbox Version:v1.0
  • 360 version:v1 (xenon)

Posted 30 June 2005 - 07:18 AM

Also, for other interested parties.

Here are the various threads in our coding forum.

LEV/STB Level/Level Texture File format
Audio File Format
BBM/BBA Model/Animation File Formats
BIZ/BIG File Format Discussion
Fable WAD Files - C++ Classes
Full list of built-in script, and their location
START_NEW_ENTITY_SCRIPT (or the... so you wanted to make your own script thread)

Edited by Keshire, 30 June 2005 - 07:29 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users