AREA file

Description

This file format describes the content of an area, rather than its visual representation. It contains the list of actors, items, entrances and exits, spawn points, and other assorted area-associated info. Essentially, this format is all about how the characters interact with the area and how the area responds, whereas the WED file is all about how the area appears graphically.

AREA file versions

AREA V1.0

Overall structure

Note: The order of the sections in an AREA file do actually vary. In many files the sections are always found in a particular order. In AREA files, the same resource in its normal state and in its "post-save" state will have the different sections in different orders. The sections here, then, are stored in the order in which they are referenced in the header.

V1.0 File header

OffsetSize (datatype)Description
0x00004 (char array)Signature ('AREA')
0x00044 (char array)Version ('V1.0')
0x00088 (resref)It is unknown precisely what the function of this ResRef is. It may, according to the documents inherited from the original BGFFHP, express some sort of data dependency -- i.e. express that this area requires data from another area. Or it may be used to determine when the resources for this should be unloaded. (For instance, if you are in area X, and you enter a building contained in area X, it should not unload the data for area X, since the long reload times for entering and leaving a building would be an annoyance.) Or possibly the resref of the WED file corresopnding to this file.
0x00104 (dword)Unknown; however, this field is called m_lastSaved in the BG source.
0x00144 (dword)(usually 3)
0x00188 (resref)Resref of the area to the North of this area.
0x00204 (dword)(usually 3)
0x00248 (resref)Resref of the area to the West of this area.
0x002c4 (dword)(usually 3)
0x00308 (resref)Resref of the area to the South of this area.
0x00384 (dword)(usually 3)
0x003c8 (resref)Resref of the area to the East of this area.
0x00444 (dword)Unknown
0x00484 (dword)Flags:
  • bit 0: Outdoor
  • bit 1: day/night
  • bit 2: weather
  • bit 3: city
  • bit 4: forest
  • bit 5: dungeon
  • bit 6: extended night
0x004a2 (word)Rain probability
0x004c2 (word)Snow probability
0x004e2 (word)Fog probability
0x00502 (word)Lightning probability
0x00522 (word)Unknown
0x00544 (dword)Offset of actors (i.e. creatures and NPCs).
0x00582 (word)Count of actors in this area (i.e. creatures and NPCs).
0x005a2 (word)Count of info points, trigger points, and exits in this area.
0x005c4 (dword)Offset of info points, trigger points, and exits.
0x00604 (dword)Offset of spawn points.
0x00644 (dword)Count of spawn points.
0x00684 (dword)Offset of entrances.
0x006c4 (dword)Count of entrances.
0x00704 (dword)Offset of containers.
0x00742 (word)Count of containers.
0x00762 (word)Count of items.
0x00784 (dword)Offset of items.
0x007c4 (dword)Offset of vertices.
0x00802 (word)Count of vertices.
0x00822 (word)Count of ambients (i.e. ambient sounds).
0x00844 (dword)Offset of ambients.
0x00884 (dword)Offset of variables.
0x008c4 (dword)Count of variables.
0x00904 (dword)Unknown
0x00948 (resref)Script file corresponding to this area
0x009c4 (dword)"Explored" bitmask size
0x00a04 (dword)Offset to "explored" bitmask
0x00a44 (dword)Count of doors in this area
0x00a84 (dword)Offset to doors structures.
0x00ac4 (dword)Count of animations in this area.
0x00b04 (dword)Offset to animation structures.
0x00b44 (dword)Tiled object count
0x00b84 (dword)Tiled objects offset
0x00bc4*2 (dword)Offsets to ??? unknown sections, only found in savegames
0x00c44 (dword)offset of the automap note section, if any
0x00c84 (dword)number of entries in the automap note section
0x00cc4*20 (dword)Unknown

V1.0 Actors

OffsetSize (datatype)Description
0x000032 (char array)Name of this actor (this is the full name, as would appear, for instance, as a label in a dialog, or in a tooltip.)
0x00204 (point)Current position of this actor within the area.
0x00244 (point)Current destination of this actor within the area.
0x00284 (dword)Visible flag (i.e. 1 iff actor is "present", 0 if actor is not "present")
0x002c4 (dword)Unknown (usually 0)
0x00304 (dword)Unknown (actor type?) No apparent effect in game.
0x00344 (dword)Unknown (usually 0)
0x00384 (dword)Unknown (usually negative)
0x003c4 (dword)Unknown
0x00404 (dword)Unknown (usually negative)
0x00444 (dword)Unknown (usually 0)
0x00488 (resref)Resref of a dialog file associated with this creature. Presumably this is so that a creature can have their own dialog overridden in specific areas?
0x00508 (resref)Resref of a script file ("override" script?). As in the CRE file, there appear to be 5 slots for scripts, not all of which need be occupied.
0x00588 (resref)Resref of a script file ("class" script?)
0x00608 (resref)Resref of a script file ("race" script?)
0x00688 (resref)Resref of a script file ("general" script?)
0x00708 (resref)Resref of a script file ("default" script?)
0x00788 (resref)Resref of a script file ("specific" script?)
0x00808 (resref)Resref of the CRE file for this actor
0x00884 (dword)Offset to CRE structure (stored if the status of this creature is changed from its original status in the CRE file)
0x008c4 (dword)Size of stored CRE structure
0x0090128 (bytes)Unknown. Most of these bytes are probably placeholders for fields which are used in-memory by either the game or the editor, since many of them contain what appears to be garbage of the sort which is left by not initializing a block of memory.

V1.0 Info points, trigger points, and exits

Note: These are referred to as info points. A more appropriate name might be "active regions"; the name "Info point" comes from the names seen in the file as assigned to the various objects. Likely, the Bioware editors automatically name these as "Info point 1", "Info point 2", ..., and "Trigger point 1", "Trigger point 2", ..., and "toXXXX", where XXXX is replaced with the 4-digit area specifier (i.e. AR2600 == 2600, etc). This can be seen in that many of the names will appear as "Name1\0oint 3" -- i.e. the old name can be seen, only having been partially overwritten. Anyway, some of the objects are, in fact, info points, but many of them are exits or "trigger points" (e.g. traps and other special regions).

OffsetSize (datatype)Description
0x000032 (char array)Name of this info point (this is the full name, probably used only in the editor?)
0x00202 (word)Type of this "trigger point":
  • 00: proximity trigger
  • 01: info trigger (sign, point of notice, etc)
  • 02: travel trigger
0x00228 (rect)Minimum bounding box of this point.
0x002a2 (word)Count of vertices composing the perimeter of this info point.
0x002c4 (dword)Index of first vertex for this info point.
0x00304 (dword)Unknown. (usually 0)
0x00344 (dword)Index of cursor to use for this region (i.e. usually '22' for info point, '28' for inside exits, '30' for outside exits. It is unclear which BAM file these come from, but this is likely the frame number to use for the cursor.
0x00388 (resref)Resref of the destination area, if this is an exit. Unused for other object types.
0x004032 (char array)Name of the entrance within the destination area where we will appear if we pass through this door. Only used for "exit" objects.
0x00604 (dword)Flags:
  • bit 0
  • bit 1: Reset trap flag (for proximity triggers)
  • bit 2: Party Required flag (for travel triggers). Responsible for the "You must gather your party before venturing forth" message
0x00644 (strref)The text associated with this "info point", if this is actually an "info point" (i.e. if type==01).
0x00682 (word)Trap detection difficulty (%)
0x006a2 (word)Trap removal difficulty (%)
0x006c2 (word)trapped flag
0x006e2 (word)trap detected flag
0x00704 (point)"trap launch" location.
0x00748 (bytes)Key type (usage unknown)
0x007c8 (resref)The script associated with this region, if it is a "trigger point". This script is activated when a member of your party passes over one of the edges of the polygon defining this region.
0x008448 (bytes)Unknown
0x00b44 (point)Unknown.
0x00b84 (dword)Unknown.
0x00bc8 (resref)Dialog file to be activated when this trigger is activated. Associated with proximity triggers. Whether it is used for other types is unknown.

V1.0 Spawn points

OffsetSize (datatype)Description
0x000032 (char array)Name of this spawn point (this is the full name, probably used only in the editor?)
0x00204 (point)The "location" of this spawn point

V1.0 Entrances

OffsetSize (datatype)Description
0x000032 (char array)Name of this entrance -- as referenced by exits which lead to this entrance (specified in the source area's Info points, trigger points, and exits section.
0x00204 (point)The "location" of this entrance -- when you enter the area via this entrance, where does your party actually appear?
0x002468 (bytes)Unknown.

V1.0 Containers

OffsetSize (datatype)Description
0x000032 (char array)Name of this container -- Probably only used by the editor, since the name makes it fairly obvious which containers are trapped.
0x00204 (point)Location of this container. Exactly what qualifies as the "position" of the container is unclear. Perhaps this, too, is used by the editor?
0x00242 (word)Container type:
  • 00: <n/a>
  • 01: BAG
  • 02: CHEST
  • 03: DRAWER
  • 04: PILE
  • 05: TABLE
  • 06: SHELF
  • 07: ALTAR
  • 08: NONVISIBLE
  • 09: SPELLBOOK
  • 0a: BODY
  • 0b: BARREL
  • 0c: CRATE
0x00262 (word)Lock difficulty
0x00282 (word)Is locked? (1 if locked, 0 otherwise)
0x002a2 (word)Unknown
0x002c2 (word)Trap detection difficulty
0x002e2 (word)Trap removal difficulty
0x00302 (word)Container is trapped
0x00322 (word)Trap has been detected
0x00344 (point)Trap launch target
0x00388 (rect)Minimum bounding box of container polygon
0x00404 (dword)Index of first item in this container.
0x00444 (dword)Count of items in this container.
0x00488 (resref)Resref of script to trigger if container trap is set off.
0x00504 (dword)Index of first vertex making up the outline of this container.
0x00544 (dword)Count of vertices making up the outline of this container.
0x005832 (bytes)Unknown
0x00788 (resref)Resref of a "key" item, which, if posessed allows this chest to be opened.
0x008064 (bytes)Unknown.

V1.0 Items

For those of you that have been paying attention, you may recognize this struct as being used in both the CRE file and the STO file.

OffsetSize (datatype)Description
0x00008 (resref)Resref of the ITM resource for this particular item.
0x00082 (word)Unknown
0x000a2 (word)Usage 1 (typically the number of stacked items or the number of uses of the primary facility of a magical item)
0x000c2 (word)Usage 2 (typically the number of uses of the secondary facility of a magical item)
0x000e2 (word)Usage 3 (typically the number of uses of the tertiary facility of a magical item)
0x00104 (dword)Flags:
  • bit 0: identified
  • bit 2: stolen

V1.0 Vertices

This is an array of points which are used to create the outlines of trigger/info/exit regions and for containers. Not much else to say. Lots of 16-bit words stored x0, y0, x1, y1...

V1.0 Ambients

OffsetSize (datatype)Description
0x000032 (char array)Name of this particular ambient. Typically a descriptive name, like "Tavern", "Dogs", or "Kids". Sometimes a not-so-descriptive name, like "ambi".
0x00204 (point)"Origin" (center) of this particular sound
0x00242 (word)Likely, the radius of this sound.
0x00262 (bytes)Unknown
0x00286 (bytes)Unknown
0x002e2 (word)Volume of this sound? (i.e. as a percentage of the maximum)
0x00308*10 (resref array)Resref of up to 10 sounds. The noise for this ambient sound is chosen at random from the (up to) 10 available sounds.
0x00802 (word)Number of sounds in the array of sound resource at 0x30
0x00822 (word)Unknown
0x00844 (dword)Unknown
0x00884 (dword)Unknown
0x008c4 (dword)Unknown
0x00904 (dword)Flags of some sort.
0x009464 (bytes)Unknown

V1.0 Variables

Each area can have associated variables. Variables not associated with an area are associated with either "GLOBAL" for global variables, or "LOCALS" for local variables. This stores variables associated with this particular area (this is keyed on the resref of this area, which is assumed to be a 6 character code, even though a resref is 8 characters long). For instance, the variable accessed via 'Global("AR2600","FooBarDead")' would be stored in the ARE file for AR2600. Typically these blocks are found only in saved ARE files (i.e. extracted from .SAV files.). The structure, as much as is known, is:

OffsetSize (datatype)Description
0x000032 (char array)Name of this variable.
0x00208 (bytes)Unknown
0x00284 (dword)Variable value
0x002c40 (bytes)Unknown

V1.0 Explored bitmask

The explored bitmask is an array of bits, one bit for each 16x16 pixel cell on the map. If a bit is 1, then the cell has been explored. Otherwise, it has not.

V1.0 Doors

Doors in an AREA file are the "door" objects that the user interacts with, to be distinguished from the "door" objects in the WED file. The WED file deals with how the opening and closing of a door changes the appearance of the world. A door in an AREA file details what happens when the user tries to open the door, what polygon the mouse must be inside of in order for mouse clicks to affect the door in question. The two types of door objects are linked through the id field in each -- the 8-byte character array which contains an identifier for the door. If the names in the two files match, the doors are the same, and toggling the state of the AREA door will toggle the state of the WED door.

OffsetSize (datatype)Description
0x000032 (char array)A long name for this door.
0x00208 (char array)A short identifier for this door. Probably used to establish a mapping between doors in the AREA file and doors in the WED file.
0x00284 (dword)Flags related to this door.
0x002c4 (dword)Index of first vertex comprising the outline of this door while the door is open.
0x00302 (word)Count of vertices comprising the outline of this door while the door is open.
0x00322 (word)Count of vertices comprising the outline of this door while the door is closed.
0x00344 (dword)Index of first vertex comprising the outline of this door while the door is closed.
0x00388 (rect)Minimum bounding box of the door polygon when it is open.
0x00408 (rect)Minimum bounding box of the door polygon when it is closed.
0x00484 (dword)Index of first "vertex" in "impeded cell block" for "door closed" state. These vertices are not actually vertices, but instead, cell coordinates (each cell corresponding to one tile in the WED file's Tilemap structures. When the door is closed, these cells cannot be entered by any object.
0x004c2 (word)Count of "vertices" in "impeded cell block" for "door closed" state. See note at offset 0x48 in this structure for details.
0x004e2 (word)Count of "vertices" in "impeded cell block" for "door open" state. This is the same as the above field, except it is used when the door is open, instead of when the door is closed.
0x00504 (dword)Index of first "vertex" in "impeded cell block" for "door open" state. This is the same as the field at 0x48, except it is used when the door is open, instead of when the door is closed.
0x00542 (word)Unknown
0x00562 (word)Unknown
0x005816 (bytes)Unknown
0x00684 (dword)Unknown
0x006c2 (word)Trap detection difficulty
0x006e2 (word)Trap removal difficulty
0x00702 (word)Trapped flag
0x00722 (word)Trap detected flag
0x00744 (point)Trap launch target point
0x00788 (resref)Resref of key item needed to unlock door.
0x00808 (resref)Resref of script for this item. (Script is activated when "open" attempt is made on item.)
0x00884 (dword)Unknown
0x008c4 (dword)Lock difficulty (0-100)
0x00908 (rect)Bounding box for...?
0x009828 (bytes)Unknown
0x00b44 (strref)Name of this door, if it has one. Name is used if the door initiates dialog with the user.
0x00b88 (resref)Resref of the dialog resource associated with this door, if any. This dialog will be used if the door initiates dialog with the user in its associated script.
0x00c08 (bytes)Unknown

V1.0 Animations

OffsetSize (datatype)Description
0x000032 (char array)A long name for this animation.
0x00204 (point)The point at which the "center" of the animation is to be played -- i.e. each frame in the BAM file has its center placed at this precise coordinate.
0x00244 (dword)Unknown
0x00288 (resref)The resref of the BAM file to be played for this animation.
0x00302 (word)Sequence number within the BAM resource
0x00322 (word)Unknown
0x00344 (dword)Unknown
0x00384 (dword)Unknown
0x003c16 (bytes)Unknown

V1.0 Automap notes

These are textual notes which either you can add to your map, or which, in Torment, are automatically added to your map. This format isn't too well known, but it also isn't too complicated.

OffsetSize (datatype)Description
0x00002 (word)X coordinate
0x00022 (word)Y coordinate
0x000448 (bytes)text of note
0x0034...(unused bytes of padding in Torment)

V1.0 Tiled objects

This information comes from Dmitry Jemerov. Neither of us have seen any instances of areas which include objects of this type, but he has managed to determine the format of these objects, nonetheless. Since there are no examples, we don't know precisely what they are used for. If more information becomes available, this space will be updated.

OffsetSize (datatype)Description
0x000032 (char array)Name
0x00208 (resref)Unknown
0x00284 (dword)Unknown
0x002c4 (dword)Primary search squares start. The primary search squares are the squares which are impeded when the object is in one state (i.e. the search squares through which a creature cannot travel).
0x00304 (dword)Primary search squares count
0x00344 (dword)Secondary search squares start. The secondary search squares are like the primary search squares, except for when the object is in an alternate state of some sort.
0x00384 (dword)Secondary search squares count
0x003c48 (bytes)Unknown (unused?)

[ back to index ]