Jump to content

[BG2:ToB] VEF File Format


Ascension64

Recommended Posts

VEF File Format

Visual Effect File

 

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

 

Header

The header is fixed at 0x18 bytes.

 

Offset Size (data type) Description

0x0000 4 (char array) Signature ('VEF ')

0x0004 4 (char array) Version ('')

No version is specified.

 

0x0008 4 (dword) Offset to visual effect components 1

0x000c 4 (dword) Number of visual effect components 1

0x0010 4 (dword) Offset to visual effect components 2

0x0014 4 (dword) Number of visual effect components 2

Note that regardless of which array the visual effect component is in, it is treated the same.

 

Visual effect components

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

How long (in AI updates) does the visual effect run before this component begins.

 

0x0004 4 (dword) Unused

0x0008 4 (dword) Ticks until loop

How long (in AI updates) does it take to run this component again. It is advisable to make sure this value is greater than the duration of the component, otherwise this component will accumulate and cause the game to grind to a halt.

 

0x000c 4 (dword) Resource type

Specifies the type of resource to load. If the first type does not exist, will try the next type, and so on.

0 = WAV

1 = VVC, then BAM

2 = VEF, then VVC, then BAM (also sends CMessage)

 

0x0010 8 (resref) Resource name

0x0018 4 (dword) Continuous cycles

Boolean. If set, will set the continuous cycles value for the component. Only applicable when the resource type is 1.

 

0x001c 124 (bytes) Unused

Unmarshalled but not used.

Link to comment
So this is where vefproj.ids is used!

VEFPROJ.IDS has opcodes like PROJECTL.IDS. The values of VEFPROJ.IDS will be ResRefs for VEF, VVC, or BAM.

 

When a projectile opcode is stated, the game checks the following things. If one of these is satisfied, the others will be ignored.

1. Internal hard-coded projectile

2. VEFPROJ.IDS

3. PROJECTL.IDS

Link to comment
This means if I call a valid .vef file in an extension header, the .vef will play instead of a projectile? How does this work?

 

-Galactygon

Essentially, CreateVisualEffect(foo), which would simplify to:

1. Check if FOO.VEF exists. If so, make a CVisualEffect loading FOO.VEF. Return.

2. Else, check if FOO.VVC exists. If so, make a CVisualEffect loading FOO.VVC. Return.

3. Else, check if FOO.BAM exists. If so, make a CVisualEffect of FOO.BAM. Return.

4. Else, return, or ? assertion error. I cannot remember which.

Link to comment

What I was really asking is, what happens when the extended header of a .spl or .itm calls for FOO.VEF instead of FOO.PRO?

 

This implies .vef files are handled like .pro files:

When a projectile opcode is stated, the game checks the following things. If one of these is satisfied, the others will be ignored.

1. Internal hard-coded projectile

2. VEFPROJ.IDS

3. PROJECTL.IDS

 

But .pro files give you targets and area of effects, wheras .vef files are simply graphics. I'm missing something here.

 

-Galactygon

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...