VEF file format

Applies to:
BG2, BG2: ToB

General Description
Visual effects allow you to group other visual effects, animations, and sounds together and specify the timing with which each component plays. This is powerful in the sense that you can create a whole visual effect display with these files. VEF files can be used with the actions CreateVisualEffect(S:Object*,P:Location*) and CreateVisualEffectObject(S:Object*,O:Target*), and in effect opcode 215 (Graphics: Play 3D Effect).

Detailed Description
Overall structure


The header is fixed at 0x18 bytes.

Offset Size (data type) Description
0x0000 4 (char array) Signature ('VEF ')
0x0004 4 (char array) Version (' ')
0x0008 4 (dword) Offset to visual effect components 1
0x000c 4 (dword) Count of visual effect components 1
0x0010 4 (dword) Offset to visual effect components 1
0x0014 4 (dword) Count of visual effect components 2


Visual components can be VEF, VVC, BAM, or WAV. Support for VEF means that you can actually nest components within each other. Each visual effect entry has a fixed size of 0xe0 bytes. It is advisable not to use looping components because this will accumulate visual effect components and cause the game to grind to a halt.

Offset Size (data type) Description
0x0000 4 (dword) Ticks until start
0x0004 4 (dword) Unused
0x0008 4 (dword) Ticks until loop
0x000c 4 (dword) Resource Type
  • 0 WAV
  • 1 VVC / BAM
  • 2 VEF / VVC / BAM
0x0010 8 (resref) Resource name
0x0018 4 (dword) Continuous Cycles (only for Resource Type 1)
0x001c 124 (bytes) Unused