VCD: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(Beginning the examination and explanation of the plain text VCD format. Information still incomplete, this is ongoing.)
Line 1: Line 1:
{{lang|VCD}}
{{lang|VCD}}


'''Valve Choreography Data''' ('''VCD''') is a proprietary file format used to store [[Choreography_Tool|choreography]] data in a vaguely {{wiki|JSON}}-like plain text format.
{{stub}}
 
'''Valve Choreography Data''' ('''VCD''') is a proprietary file format used to store [[Choreography_Tool|choreography]] data.


VCDs are authored in [[Faceposer]] and played in your map via the {{ent|logic_choreographed_scene}} entity. The filename should contain only one period before the file extension; otherwise, the scene file cannot be found.
VCDs are authored in [[Faceposer]] and played in your map via the {{ent|logic_choreographed_scene}} entity. The filename should contain only one period before the file extension; otherwise, the scene file cannot be found.
{{note|VCD files must be compiled into {{ent|scenes.image}} before they can be used {{src07|since}}.}}
{{note|VCD files must be compiled into {{ent|scenes.image}} before they can be used {{src07|since}}.}}
== Format ==
VCD uses a plain-text format that superficially resembles a simplified version of {{wiki|JSON}} and can be edited with any text editor. Each file contains a nested list of objects that each have properties of their own. Properties can be text, numbers, or other objects and are denoted using a simple system of key-value pairs without separators.
The basic notation is as follows:
// comment
object_type (parameters) "name"
{
  property "value"
  property value
  object_type "name"
  {
    property 1
  }
}
=== Objects ===
Each object is denoted using the syntax <code>type parameters "name"</code>. Names and paremeters may be optional depending on object type; the most simple declaration possible consists solely of an object type, such as with <code>scalesettings</code>. Common objects are actors, channels, and events.
==== Object types ====
An incomplete list of object types follows. '''This list is incomplete and based on ongoing examination of the format.''' You can help expand it.
{| class="wikitable"
|-
! Type !! Assumed function !! Known parameters !! Example
|-
| actor|| A single actor, with channels and events as children || name || <code>actor "Alyx" { ... }</code>
|-
| channel || A single channel, as child of an actor object, containing events || name || <code>channel "look at" { ... }</code>
|-
| event || A single event on the Faceposer timeline. || event type (i.e. "lookat", name || <code>event lookat "look_player" { ... }</code>
|-
| event_ramp || Unknown, possibly for blending animations || none known ||
|-
| scalesettings || Unknown, possibly for saving Faceposer UI preferences || none known ||
  scalesettings
  {
    "CChoreoView" "25"
    "ExpressionTool" "100"
    "GestureTool" "100"
    "RampTool" "52"
    "SceneRampTool" "100"
  }
|}
=== Properties ===
Properties of objects are denoted using their name (key) without parentheses, followed by a one or more values separated by spaces. Text is enclosed in double quotes (" "), numbers are not. Properties may be other objects, each with their own properties. The amount and type of available or required properties depend on the object type.
A few properties are common across many object types, such as <code>time (float) (float)</code> and <code> param (string)</code>, indicating time codes and parameters that are to be passed to certain events. One such example is the <code>lookat</code> type event, which takes two time values for its position and duration or end point on the timeline and one param value to determine the entity an actor should look at:
  // from scenes/eli_lab/al_cmon.vcd
  ...
  event lookat "look_player"
  {
    time 0.053333 2.553333
    param "!player"
    ...
  }
=== Comments ===
Single-line comments may be created by prefacing a line with two slashes, for example:
// this is a comment
channel "look_at"
{
    ...
}


[[Category:Choreography]]
[[Category:Choreography]]
[[Category:File formats]]
[[Category:File formats]]
{{stub}}

Revision as of 11:37, 25 March 2024

English (en)中文 (zh)Translate (Translate)

Stub

This article or section is a stub. You can help by expanding it.

Valve Choreography Data (VCD) is a proprietary file format used to store choreography data.

VCDs are authored in Faceposer and played in your map via the logic_choreographed_scene entity. The filename should contain only one period before the file extension; otherwise, the scene file cannot be found.

Note.pngNote:VCD files must be compiled into scenes.image before they can be used (in all games since Source 2007).

Format

VCD uses a plain-text format that superficially resembles a simplified version of Wikipedia icon JSON and can be edited with any text editor. Each file contains a nested list of objects that each have properties of their own. Properties can be text, numbers, or other objects and are denoted using a simple system of key-value pairs without separators.

The basic notation is as follows:

// comment
object_type (parameters) "name"
{
  property "value"
  property value
  object_type "name"
  {
    property 1
  }
}

Objects

Each object is denoted using the syntax type parameters "name". Names and paremeters may be optional depending on object type; the most simple declaration possible consists solely of an object type, such as with scalesettings. Common objects are actors, channels, and events.

Object types

An incomplete list of object types follows. This list is incomplete and based on ongoing examination of the format. You can help expand it.

Type Assumed function Known parameters Example
actor A single actor, with channels and events as children name actor "Alyx" { ... }
channel A single channel, as child of an actor object, containing events name channel "look at" { ... }
event A single event on the Faceposer timeline. event type (i.e. "lookat", name event lookat "look_player" { ... }
event_ramp Unknown, possibly for blending animations none known
scalesettings Unknown, possibly for saving Faceposer UI preferences none known
 scalesettings
 {
   "CChoreoView" "25"
   "ExpressionTool" "100"
   "GestureTool" "100"
   "RampTool" "52"
   "SceneRampTool" "100"
 }

Properties

Properties of objects are denoted using their name (key) without parentheses, followed by a one or more values separated by spaces. Text is enclosed in double quotes (" "), numbers are not. Properties may be other objects, each with their own properties. The amount and type of available or required properties depend on the object type.

A few properties are common across many object types, such as time (float) (float) and param (string), indicating time codes and parameters that are to be passed to certain events. One such example is the lookat type event, which takes two time values for its position and duration or end point on the timeline and one param value to determine the entity an actor should look at:

 // from scenes/eli_lab/al_cmon.vcd
 ...
 event lookat "look_player"
 {
   time 0.053333 2.553333
   param "!player"
   ...
 }

Comments

Single-line comments may be created by prefacing a line with two slashes, for example:

// this is a comment
channel "look_at"
{
   ...
}