Jump to content


Photo

[BG2:ToB] VEF File Format


11 replies to this topic

#1 Ascension64

Ascension64
  • Members
  • 452 posts

Posted 16 June 2010 - 02:53 PM

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.

Edited by Ascension64, 16 June 2010 - 02:54 PM.


#2 Avenger

Avenger
  • Modders
  • 3425 posts
  • Gender:Male
  • Location:Hungary

Posted 19 June 2010 - 11:52 PM

So this is where vefproj.ids is used!

#3 Ascension64

Ascension64
  • Members
  • 452 posts

Posted 20 June 2010 - 04:28 AM

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

Edited by Ascension64, 20 June 2010 - 04:29 AM.


#4 Galactygon

Galactygon

    Nostradoctopus

  • Members
  • 653 posts
  • Location:Hungary

Posted 05 July 2010 - 06:19 AM

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



#5 Ascension64

Ascension64
  • Members
  • 452 posts

Posted 07 July 2010 - 05:13 AM

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.

#6 Galactygon

Galactygon

    Nostradoctopus

  • Members
  • 653 posts
  • Location:Hungary

Posted 08 July 2010 - 12:30 AM

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



#7 Avenger

Avenger
  • Modders
  • 3425 posts
  • Gender:Male
  • Location:Hungary

Posted 08 July 2010 - 01:48 AM

Yes, VEF seems to be a vvc+, not a projectile (with travel graphics), let alone AoE.

#8 igi

igi

    IESDP Guardian

  • Gibberlings
  • 1210 posts
  • Gender:Male

Posted 21 April 2012 - 12:14 PM

Local copy updated, thanks(!)

#9 Avenger

Avenger
  • Modders
  • 3425 posts
  • Gender:Male
  • Location:Hungary

Posted 02 June 2013 - 01:50 AM

When will this info go into public IESDP :)

I mean, main index, heh.

Edited by Avenger, 02 June 2013 - 01:53 AM.


#10 Avenger

Avenger
  • Modders
  • 3425 posts
  • Gender:Male
  • Location:Hungary

Posted 12 July 2013 - 02:00 PM

I think, the empty area is 196 bytes long.
0xe0 - 0x1c = 0xc4

#11 Ascension64

Ascension64
  • Members
  • 452 posts

Posted 12 July 2013 - 02:39 PM

You are probably right, made a boo-boo.

#12 Galactygon

Galactygon

    Nostradoctopus

  • Members
  • 653 posts
  • Location:Hungary

Posted 29 September 2013 - 04:42 AM

Just a stray thought: the VEF file format could be tweaked to allow for cutscenized projectiles aka in PST. There is plenty of space in this format.

-Galactygon





Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users