Badge time.png   The Paragon Wiki Archive documents the state of City of Heroes/Villains as it existed on December 1, 2012.

Difference between revisions of "User:Scuzzbopper/Demo Editing"

From Paragon Wiki Archive
Jump to: navigation, search
m (Time)
m
Line 8: Line 8:
 
= Overview =
 
= Overview =
  
'''Demo Editing''' is a term used to describe the modifying of a CoH demo file.  Typically, the modified demo file is then used to produce user-generated screenshots or movies (machinima) of events and situations which did not actually take place during live game play.  A recorded demo is saved as text file, rather than a standard video file, containing all the commands required to instruct the game engine how to play back the recorded demo.  All of this information can edited, changed, deleted, or added to (or even created from scratch); requiring, at its simplest, only a text editor and a reasonable understanding of the demo information/code.  This allows for the creation of custom screenshots and movies via '''Demo Editing''' with relative ease.  
+
'''Demo Editing''' is a term used to describe the modifying of a CoH demo file.  Typically, the modified demo file is then used to produce user-generated screenshots or movies ([http://en.wikipedia.org/wiki/Machinima Machinima]) of events and situations which did not actually take place during live game play.  A recorded demo is saved as text file, rather than a standard video file, containing all the commands required to instruct the game engine how to play back the recorded demo.  All of this information can be edited, changed, deleted, or added to (or even created from scratch), requiring, at its simplest, only a text editor and a reasonable understanding of the demo file code.  This allows for the creation of custom screenshots, comics, and movies via '''Demo Editing''' with relative ease.  
  
The term may be used to strictly refer to just the modification or creation of a custom demo file, or it can be more broadly used to refer to both the editing of a custom demo file and the playback, capture, and production of the modified demo into movies and/or screenshots.
+
'''Demo Editing''' may be used to strictly refer to just the modification or creation of a custom demo file, or it can be more broadly used to refer to both the editing of a custom demo file and the playback, capture, and production of the modified demo into movies and/or screenshots.
  
 
See the [[Demo Recording]] entry for information on how to record and play back a demo.
 
See the [[Demo Recording]] entry for information on how to record and play back a demo.
Line 30: Line 30:
 
Looked at as a whole, rather than line by line, a demo file is formatted in such a way that it is organized into columns.  The first column is always the '''Time Increment'''.
 
Looked at as a whole, rather than line by line, a demo file is formatted in such a way that it is organized into columns.  The first column is always the '''Time Increment'''.
  
The '''Time Increment''' is always a positive value integer and specifies the time in milliseconds (thousandths of a second) that the game engine waits, after the previous line of demo code, before executing the next line.  So a value of 2000 at the beginning of a line of demo code would mean that the 2 seconds of "real" time would pass, after the previous line of code, before the demo playback carries out that commands on that line.
+
The '''Time Increment''' is always a positive integer value and specifies the time in milliseconds (thousandths of a second) that the game engine waits, after the previous line of demo code, before executing the next line.  So a value of 2000 at the beginning of a line of demo code would mean that the 2 seconds of "real" time would pass, after the previous line of code, before the demo playback carries out that commands on that line. The following code sample shows a line from a demo file with a '''Time Increment''' of 400 miliseconds (four-tenths of a second):
  
<span style="color:orange;">Show Demo File Snippet Sample Here with Commentary</span>
+
400 SKYFILE SKY 0 1 0.000000
  
 
Please note that this value, while it controls the advancement of the demo playback, does '''not''' control the time of day in a demo.  The time of day in a demo is fixed by the '''Time''' command, and, once specified, remains fixed throughout the demo playback and does not change.
 
Please note that this value, while it controls the advancement of the demo playback, does '''not''' control the time of day in a demo.  The time of day in a demo is fixed by the '''Time''' command, and, once specified, remains fixed throughout the demo playback and does not change.
Line 42: Line 42:
 
== Entity ID ==
 
== Entity ID ==
  
After the '''Time Increment''', most lines of demo code will have a second positive value integer.  A few special cases will have a text value after the '''Time Increment'''.  This second number (or text entry) is the '''Entity ID'''.  The value is the unique ID associated with every ''entity'' recorded in the demo.  ''entity'' refers to any model, object, mission objective, NPC, or player character in the demo.  Each such element must have a unique ID associated with it, as specified by the '''Entity ID'''.  All lines of code must have an '''Entity ID''' as the second element in the line, usually a positive integer.  The special cases for the '''Entity ID''' are discussed below.
+
After the '''Time Increment''', most lines of demo code will have a second positive integer value.  A few special cases will instead have a text value after the '''Time Increment'''.  This second number (or text entry) is the '''Entity ID'''.  This value is the unique ID associated with every ''entity'' recorded in the demo.  ''Entity'' refers to any model, object, mission objective, NPC, or player character in the demo.  Each such element must have a unique ID associated with it, as specified by the '''Entity ID'''.  All lines of code must have an '''Entity ID''' as the second element in the line, usually a positive integer.  The special cases for the '''Entity ID''' are discussed below. As an example, the following line of demo code has an '''Entity ID''' of "3":
  
<span style="color:orange;">Show Demo File Snippet Sample Here with Commentary</span>
+
0  3  NEW "Senator Decimus Aquila"
  
 
Looked at in terms of a column format, the second column in a demo file is the '''Entity ID'''.
 
Looked at in terms of a column format, the second column in a demo file is the '''Entity ID'''.
  
The '''Entity ID''' is a unique value associated with a specific ''entity''.  The '''Entity ID''' of each line tells the game engine which ''entity'' to apply/attach that line of demo code to.  For example, if a line of demo code includes an animation ('''MOV'''), the '''Entity ID Number''' tells the game engine which ''entity'' to have perform that animation in the demo playback.   
+
The '''Entity ID''' is a unique value associated with a specific ''entity''.  The '''Entity ID''' of each line tells the game engine which ''entity'' to apply/attach that line of demo code to.  For example, if a line of demo code includes an animation ('''MOV'''), the '''Entity ID Number''' tells the game engine which ''entity'' to have perform that animation in the demo playback.  The following line of demo code shows the ''WALKCYCLE'' '''MOV''' attached to the ''entity'' with the ID "113":
  
<span style="color:orange;">Show Demo File Snippet Sample Here with Commentary</span>
+
0  113 MOV WALKCYCLE 0
  
 
=== Special Case Entity IDs ===
 
=== Special Case Entity IDs ===
  
 
* '''0''': "0" (zero) is used as the entity ID value for the '''Version''', '''Map''', '''Base''', and '''Time''' commands.  This is likely used as a "null" value of the '''Entity ID''' to indicate that these commands are not associated with a particular ''entity''.
 
* '''0''': "0" (zero) is used as the entity ID value for the '''Version''', '''Map''', '''Base''', and '''Time''' commands.  This is likely used as a "null" value of the '''Entity ID''' to indicate that these commands are not associated with a particular ''entity''.
* '''CAM''':  The camera information recorded in the demo is identified by the text CAM in the place of the '''Entity ID''' number.  This can be viewed as a special case value of the '''Entity ID''' where it uses the text "CAM" in place of a number.
+
* '''CAM''':  The camera information recorded in the demo is identified by the text ''CAM'' in the place of the '''Entity ID''' number.  This can be viewed as a special case value of the '''Entity ID''' where it uses the text ''CAM'' in place of a number.
* '''SKYFILE''': Similar to CAM, the SKYFILE code appears in demo lines in the place normally associated with the '''Entity ID'''.  This can also be considered a special case value of the Entity ID, specific to the SKY command which always follows.
+
* '''SKYFILE''': Similar to ''CAM'', the ''SKYFILE'' code appears in demo lines in the place normally associated with the '''Entity ID'''.  This can also be considered a special case value of the '''Entity ID''', specific to the '''SKY''' command which always follows.
* '''DYNGROUPS''':  As with CAM and SKYFILE, the DYNGROUPS code can be viewed as a special case non-numeric '''Entity ID''' associated specifically with the DYNARRAY command.
+
* '''DYNGROUPS''':  As with ''CAM'' and ''SKYFILE'', the ''DYNGROUPS'' code can be viewed as a special case non-numeric '''Entity ID''' associated specifically with the '''DYNARRAY''' command.
  
 
== Version ==
 
== Version ==
Line 63: Line 63:
 
<span style="color:orange;">Does this even do anything? Or just one of those things you have to have.</span>
 
<span style="color:orange;">Does this even do anything? Or just one of those things you have to have.</span>
  
Note that always begins with a '''Time Increment''' of 1 (rather than 0).
+
Note that the '''Version''' command line always begins with a '''Time Increment''' of 1 (rather than 0).
  
 
== Map ==
 
== Map ==
Line 71: Line 71:
 
  <nowiki>0  0  Map maps/City_Zones/City_04_01/City_04_01.txt</nowiki>
 
  <nowiki>0  0  Map maps/City_Zones/City_04_01/City_04_01.txt</nowiki>
  
The one exception to this is for demos made in supergroup bases.  Demos recorded in Bases will not have any file name specified after the '''Map''' command.  The '''Map''' command will end the line and will be followed by the '''Base''' command on the next line.
+
The one exception to this is for a demo made in a [[Supergroup Base]].  Demos recorded in bases will not have any file name specified after the '''Map''' command.  The '''Map''' command will end the line and will be followed by the '''Base''' command on the next line.
  
 
== Base ==
 
== Base ==
  
Supergroup bases do not have any pre-defined map associated with them.  This is reflected in recorded demos by the '''Base''' command.  Demos recorded in a base will not have any map file name specified after the '''Map''' command, but the next line of the demo file will include the '''Base''' command, which will precedes a large amount of data apparently used to define and generate the base layout.  For example (note that the binary '''Base''' data is incomplete in this example and would typically continue to fill a page or more):
+
A [[Supergroup Base]] does not have any pre-defined map associated with it.  This is reflected in recorded demos by the '''Base''' command.  Demos recorded in a base will not have any map file name specified after the '''Map''' command, but the next line of the demo file will include the '''Base''' command, which will precede a large amount of data apparently used to define and generate the base layout.  For example (note that the binary '''Base''' data is incomplete in this example and would typically continue to fill a page or more):
  
 
  0  0  Map
 
  0  0  Map
Line 84: Line 84:
 
<span style="color:orange;">Is it worthwhile to have a code sample here or is the binary goop just going to confuse people?  Maybe just say that the binary data used by the base command is beyond the scope of this guide.</span>
 
<span style="color:orange;">Is it worthwhile to have a code sample here or is the binary goop just going to confuse people?  Maybe just say that the binary data used by the base command is beyond the scope of this guide.</span>
  
The '''Base''' command appears only for demos recorded inside a supergroup base.  Demos recorded in any other location, mission, or circumstance will not include the '''Base''' command.
+
The '''Base''' command appears only for demos recorded inside a [[Supergroup Base]].  Demos recorded in any other location, mission, or circumstance will not include the '''Base''' command.
  
 
== Time ==
 
== Time ==
  
The '''Time''' command instructs the game engine what time of day to use for the demo playback.  The value which follows the '''Time''' command on this line is the time of day, in hours, using the military time notation (also known as 24-hour clock notation), with fractions of an hour expressed a decimal value.  Hence values following the '''Time''' command may range from 0.0 to 23.99.  In a demo, this line would appear as follows:
+
The '''Time''' command instructs the game engine what time of day to use for the demo playback.  The value which follows the '''Time''' command on this line is the time of day, in hours, using the military time notation (also known as 24-hour clock notation), with fractions of an hour expressed as a decimal value.  Hence values following the '''Time''' command may range from 0.0 to 23.99.  In a demo, this line would appear as follows:
  
 
  0  0  Time 14.428092
 
  0  0  Time 14.428092
  
Where the value of 14.428092 corresponds to 2:25 PM (and about 41 seconds).  Some examples of '''Time''' values, with their equivalent 12-hour clock notation, are as follows:
+
Where, in this example, the value of 14.428092 corresponds to 2:25 PM (and about 41 seconds).  Some examples of '''Time''' values, with their equivalent 12-hour clock notation, are as follows:
  
  
Line 123: Line 123:
 
== POS ==
 
== POS ==
  
The '''POS''' command refers to "position".  This is used to tell the game engine ''where'' to place a given ''entity'' in the demo playback.  All players, NPC, and objects (all ''entities''), as well as the demo camera (or '''CAM''') must have a associated '''POS''' command in order to appear properly in the demo.  Changing the '''POS''' values for an ''entity'' over the course of a demo controls the movement of that ''entity'' in the demo.  Changing the '''POS''' is how you move something from point A to point B.
+
The '''POS''' command refers to "position." This is used to tell the game engine ''where'' to place a given ''entity'' in the demo playback.  All players, NPC, and objects (all ''entities''), as well as the demo camera (or '''CAM''') must have a associated '''POS''' command in order to appear properly in the demo.  Changing the '''POS''' values for an ''entity'' over the course of a demo controls the movement of that ''entity'' in the demo.  Changing the '''POS''' is how you move something from point A to point B.
  
 
The '''POS''' command is followed by a set of three numerical map coordinates in X Z Y format.  It is important to note that the order is X Z Y (and ''not'' X Y Z).
 
The '''POS''' command is followed by a set of three numerical map coordinates in X Z Y format.  It is important to note that the order is X Z Y (and ''not'' X Y Z).
  
<span style="color:orange;">POS code sample here</span>
+
0  1  POS -1140 102 4592.5
  
 
For a given map, the X value corresponds to the North-South position of the ''entity'', the Z value corresponds to altitude or Up-Down position of the ''entity'', and the Y value corresponds to its East-West position. Larger values of X are further to the South, larger values of Z increase altitude, and larger values of Y are further to the West.  Note that, for X & Y, this may be the reverse of what is intuitive for many.
 
For a given map, the X value corresponds to the North-South position of the ''entity'', the Z value corresponds to altitude or Up-Down position of the ''entity'', and the Y value corresponds to its East-West position. Larger values of X are further to the South, larger values of Z increase altitude, and larger values of Y are further to the West.  Note that, for X & Y, this may be the reverse of what is intuitive for many.
Line 135: Line 135:
 
The values for '''POS''' are expressed in feet.  So changing an X value from 1.0 to 2.0 will move an ''entity'' one foot to the South.  Changing an X value from 1.0 to 2641.0 will move an ''entity'' a half mile to the South.
 
The values for '''POS''' are expressed in feet.  So changing an X value from 1.0 to 2.0 will move an ''entity'' one foot to the South.  Changing an X value from 1.0 to 2641.0 will move an ''entity'' a half mile to the South.
  
The appearance of '''CAM POS''' in the code is worth special note.  As discussed above, ''CAM'' is used as the '''Entity ID''' for the demo camera -- the POV from which the demo is recorded.  The camera, or ''CAM'', is a special pre-defined demo ''entity'' which uses the text ''CAM'' as its '''Entity ID''' rather than a positive value integer like most ''entities''.  With regards to its use of the '''POS''' command, the '''CAM POS''' lines function the same as for any other ''entity'' in that they determine the position and movement (through changing the position) of the demo camera/POV.
+
The appearance of '''CAM POS''' in the code is worth special note.  As discussed above, ''CAM'' is used as the '''Entity ID''' for the demo camera -- the POV from which the demo is recorded.  The camera, or ''CAM'', is a special pre-defined demo ''entity'' which uses the text ''CAM'' as its '''Entity ID''' rather than an  integer value like most ''entities''.  With regards to its use of the '''POS''' command, the '''CAM POS''' lines function the same as for any other ''entity'' in that they determine the position and movement (through changing the position) of the demo camera/demo POV.
  
 
== PYR ==
 
== PYR ==
  
The '''PYR''' command stands for [http://en.wikipedia.org/wiki/Flight_dynamics "Pitch-Yaw-Roll"].  '''PYR''' is used similarly to the '''POS''' command.  Where '''POS''' is used to specify the position of an ''entity'', '''PYR''' specifies the special orientation of an ''entity''.  Put another way, '''POS''' determines where on the map [[Ms. Liberty]] shows up, and '''PYR''' determines whether she is standing on her head or on her feet.
+
The '''PYR''' command stands for [http://en.wikipedia.org/wiki/Flight_dynamics "Pitch-Yaw-Roll"].  '''PYR''' is used similarly to the '''POS''' command.  Where '''POS''' is used to specify the position of an ''entity'', '''PYR''' specifies the spacial orientation of an ''entity''.  Put another way, '''POS''' determines where on the map [[Ms. Liberty]] shows up, and '''PYR''' determines whether she is standing on her head or on her feet.
  
The ''PYR''' command is followed by three numerical values for Pitch, Yaw, and Roll.  These values are expressed in [http://en.wikipedia.org/wiki/Radians radians], with values ranging from -3.14159 to 3.14159 (-pi to +pi).  A total of two pi (6.28319) represents a complete rotation of 360 degrees for any of the three axes.  
+
The '''PYR''' command is followed by three numerical values for Pitch, Yaw, and Roll.  These values are expressed in [http://en.wikipedia.org/wiki/Radians radians], with values ranging from -3.14159 to 3.14159 (-pi to +pi).  A total of 2pi (6.28319) represents a complete rotation of 360 degrees for any of the three axes.  
<!-- Using 0 to 2pi works just as well as -pi to +pi, and so forth. -->
+
<!-- Using 0 to 2pi works just as well as -pi to +pi, and so forth. -SB -->
  
<span style="color:orange;">PYR code sample here</span>
+
0  1  PYR 0 2.626175 0
  
The Pitch (or "P") value determines the up-down orientation of an NPC, object, or other ''entity'' -- whether an ''entity'' is tilting forward or back.
+
The Pitch (or "P") value determines the front-to-back up-down orientation of an NPC, object, or other ''entity'' -- whether an ''entity'' is tilting forward or back.
  
 
{| class="wikitable" style="text-align:center"
 
{| class="wikitable" style="text-align:center"
Line 174: Line 174:
 
|-
 
|-
 
|}
 
|}
Note that the axis of rotation for most models is at the ''base'' of the model and not through their apparent center/center of mass.
+
Note that the axis of rotation for most models is at the ''base'' of the model and not through their apparent center.
  
All of the additional comments made regarding '''CAM POS''' also apply for '''CAM PYR''' (relative to the '''PYR''') command.  '''CAM PYR''' is just a '''PYR''' command applied to the ''CAM'' (camera) '''Entity ID'''.
+
The combination of these three values allows you to adjust an ''entity'' in all three dimensions to obtain any orientation desired.
  
== New ==
+
All of the additional comments made regarding '''CAM POS''' also apply for '''CAM PYR''' (relative to the '''PYR''') command, where '''CAM PYR''' is a '''PYR''' command applied to the ''CAM'' (camera) '''Entity ID'''.
  
'''NEW'' is the command used by the demo to tell the game engine that it is adding a new ''entity'' (NPC, player, object, mission objective, etc.).  The line with the '''NEW''' command is where the unique '''Entity ID''' is first specified (the second numerical value in the line, after the '''Time Increment''') and is the most important value associated with the '''NEW''' command.  When you use the '''NEW''' command to add a new ''entity'', that ''entity'' and anything associated with it must use the same '''Entity ID''' throughout the demo thereafter.
+
== NEW ==
 +
 
 +
'''NEW''' is the command used by the demo to tell the game engine that it is adding a new ''entity'' (NPC, player, object, mission objective, etc.).  The line with the '''NEW''' command is (with one exception) where the unique '''Entity ID''' is first specified (the second numerical value in the line, after the '''Time Increment''') and is the most important value associated with the '''NEW''' command.  When you use the '''NEW''' command to add a new ''entity'', that ''entity'' and anything associated with it must use the same '''Entity ID''' throughout the demo thereafter.  For example, in the following line of demo code, "37" is the '''Entity ID''' which must be associated with [[Ms. Liberty]] and all commands attached to the [[Ms. Liberty]] ''entity'' for the remainder of the demo.
  
 
  0  37  NEW "Ms. Liberty"
 
  0  37  NEW "Ms. Liberty"
  
The '''NEW''' command is followed by the name to be attached to that entity.  This can be left blank; the ''entity'' does not ''require'' that a name be attached.  If the name is one word with no spaces, then quotes are not required for the name:
+
The '''NEW''' command is followed by the name to be attached to that entity.  This can be left blank.  The ''entity'' does not ''require'' that a name be attached.  If the name is one word, with no spaces, then quotes are not required for the name:
  
 
  0  26  NEW Statesman
 
  0  26  NEW Statesman
Line 196: Line 198:
 
  0  26  NEW "Statesman"
 
  0  26  NEW "Statesman"
  
NPC, model, and mission objective names do not display during demo playback, but player character names do display.  If you do not want player names to appear over their heads during demo playback, this can be done via demo editing by leaving the name field blank:
+
NPC, model, and mission objective names do not display during demo playback, but player character names do display.  If you do not want player names to appear over their heads during demo playback,one way to do this is via demo editing by leaving the name field blank:
  
 
  0  26  NEW  
 
  0  26  NEW  
  
Or by entering a blank or space between quotation marks for a name:
+
Or by entering a blank space between quotation marks for a name:
  
 
  0  26  NEW " "
 
  0  26  NEW " "
Line 213: Line 215:
 
  0  14  NPC Rikti_Armour_Lieutenant_01
 
  0  14  NPC Rikti_Armour_Lieutenant_01
  
''Entities'' classed an ''NPC'' include all "normal" non-player characters (enemies, allies, monsters, etc.), but also all destructible objects.  Any object in a mission or map which can be destroyed (such as mailboxes, fire hydrants, and everything else in [[Mayhem Missions]]) is considered an ''NPC'' its appearance is managed by the '''NPC''' command.
+
''Entities'' classed as an ''NPC'' include all "normal" non-player characters (enemies, allies, monsters, etc.), but also all destructible objects.  Any object in a mission or map which can be destroyed (such as mailboxes, fire hydrants, and everything else in [[Mayhem Missions]]) is considered an ''NPC'' and its appearance is managed by the '''NPC''' command and the model assigned thereby.
<!-- Is that info on destructible objects necessary or worthwhile to include? -->
+
  
 
<span style="color:orange;">Is there more to say about the NPC command?</span>
 
<span style="color:orange;">Is there more to say about the NPC command?</span>
Line 222: Line 223:
 
== MOV ==
 
== MOV ==
  
The '''MOV''' command determines the animation performed by an ''entity''.  The animation named after the '''MOV''' command is executed by the ''entity'' specified by the unique '''Entity ID''' on this line.  For example, the following '''MOV''' command will cause the ''entity'' with the unique '''Entity ID''' of "10" to perform the "bow down" emote:
+
The '''MOV''' command determines the animation performed by an ''entity''.  The animation named after the '''MOV''' command is executed by the ''entity'' as specified by the unique '''Entity ID''' on the '''MOV''' line.  For example, the following '''MOV''' command will cause the ''entity'' with the unique '''Entity ID''' of "10" to perform the "bow down" emote:
  
 
  0  10  MOV EMOTE_BOW_DOWN 0
 
  0  10  MOV EMOTE_BOW_DOWN 0
  
The number at the end of the line is a new feature added to demos with [[Issue 12]].  A "0" (zero) is the default or null value and executes the animation unmodified.  Other values, besides zero, relate the animation to a weapon or object attached to the ''entity''.  <span style="color:orange;">Is this bit on the trailing number right?</span>
+
The number at the end of the line is a new feature added to demos with [[Issue 12]].  A "0" (zero) is the default or null value and executes the animation unmodified.  Other positive integer values, besides zero, relate the animation to a weapon or object attached to the ''entity''.  <span style="color:orange;">Is this bit on the trailing number right?</span>
<!-- I haven't tried to figure these out yet, so maybe someone else who has.  Do I even have it right, so far as it goes? -->
+
<!-- I haven't tried to figure these out yet, so maybe someone else who has.  Do I even have it right, so far as it goes? Repeating what I've read in Zloth's posts. -SB -->
  
 
<span style="color:orange;">Link to Codex MOV List?</span>
 
<span style="color:orange;">Link to Codex MOV List?</span>
Line 233: Line 234:
 
== HP ==
 
== HP ==
  
The '''HP''' code specifies the ''current'' [[Health]] of a destructible NPC.  This code is associated only with NPCs which can be damaged or destroyed.  NPCs or other ''entities'' which can not be damaged do not use this code.  Hence, the '''HP''' code will not be seen in a demo as attached to such NPCs as pedestrians, trainers, contacts, or stores, but will be seen attached to enemies and destructible objects.
+
The '''HP''' code specifies the ''current'' [[Health]] of a destructible ''NPC''.  This code is associated only with ''NPCs'' which can be damaged or destroyed.  ''NPCs'' or other ''entities'' which can not be damaged do not use this code.  Hence, the '''HP''' code will not be seen in a demo file for such ''NPCs'' as pedestrians, trainers, contacts, or stores; but will be seen attached to enemies and destructible objects.
  
Any NPC which uses the '''HP''' code must also have the '''HPMAX''' code associated to it.  '''HP''' specifies the current Health and '''HPMAX''' specifies the maximum [[Health]].  Both codes must be associated with any destructible NPC.
+
Any ''NPC'' which uses the '''HP''' code must also have the '''HPMAX''' code associated to it.  '''HP''' specifies the current Health and '''HPMAX''' specifies the maximum [[Health]].  Both codes must be associated with any destructible ''NPC''. For example:
  
 
  0  5  NEW "Blood Brother Slammer"
 
  0  5  NEW "Blood Brother Slammer"
Line 245: Line 246:
 
  0  5  HPMAX 60.00
 
  0  5  HPMAX 60.00
  
For NPC ''characters'' (enemy/ally types), this code is not normally required simply with regards to making such an ''entity'' appear in a demo.  However, this is vital for properly displaying destructible ''objects''.  Many destructible objects have a variable appearance which is based on the relative values of '''HP''' and '''HPMAX'''.  If these lines are not included in the demo for such '''entities''', the game engine will render the destructible objects as if they had zero '''HP'''; which typically (though not always) means that the object will be treated as destroyed and will not be visible in the demo playback.
+
For ''NPC'' ''characters'' (enemy/ally types), this code is not normally required when simply making such an ''entity'' appear in a demo.  However, this is vital for properly displaying destructible ''objects''.  Many destructible objects have a variable appearance which is based on the relative values of '''HP''' and '''HPMAX'''.  If these lines are not included in the demo for such ''NPCs'', the game engine will render the destructible objects as if they had zero '''HP'''; which typically (though not always) means that the object will be treated as destroyed and will not be visible in the demo playback.
  
The values of '''HP''' for an NPC will change over the course of a demo recording as that NPC is damaged or healed.
+
The values of '''HP''' for an ''NPC'' will change over the course of a demo recording as that ''NPC'' is damaged or healed.
  
If you are adding an NPC or object to a demo, and are uncertain whether it is destructible and requires the '''HP'''/'''HPMAX''' code, it is harmless to add this code to an NPC, even if it is not required.
+
If you are adding an ''NPC'' or object to a demo, and are uncertain whether it is destructible and requires the '''HP'''/'''HPMAX''' code, it is harmless to add this code to an ''NPC'', even if it is not required.
  
 
== HPMAX ==
 
== HPMAX ==
  
'''HPMAX''' specifies the maximum [[Health]] of an NPC entity.  As mentioned above under the '''HP''' detail, this command is attached to destructible NPCs and objects, which must also have the '''HP''' code attached.
+
'''HPMAX''' specifies the maximum [[Health]] of an ''NPC''.  As mentioned above under the '''HP''' detail, this command is attached to destructible ''NPCs'' and objects, which must also have the '''HP''' code attached.
  
 
For destructible objects which have a variable appearance, the relative proportion of the values for '''HP''' and '''HPMAX''' determines the appearance of those destructible objects in the demo playback.
 
For destructible objects which have a variable appearance, the relative proportion of the values for '''HP''' and '''HPMAX''' determines the appearance of those destructible objects in the demo playback.
Line 264: Line 265:
  
 
  0  70  DEL
 
  0  70  DEL
 +
 +
<!-- Add info on being able to re-use Entity IDs after a DEL. -SB -->
  
 
== Player ==
 
== Player ==
Line 282: Line 285:
 
  0 1026 COSTUME 0 aad2f6 2.802201 -0.269841 -0.015873 -0.015873 -0.301587 -0.238095 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873
 
  0 1026 COSTUME 0 aad2f6 2.802201 -0.269841 -0.015873 -0.015873 -0.301587 -0.238095 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873
  
<span style="color:orange;">DOESN'T WRAP, Maybe use a div box instead?</span>
+
<span style="color:orange;">DOESN'T WRAP. Maybe use a div box instead?</span>
 +
 
 
<span style="color:orange;">This could possibly use some further detail</span>
 
<span style="color:orange;">This could possibly use some further detail</span>
  
 
== PARTSNAME ==  
 
== PARTSNAME ==  
  
The '''COSTUME''' line is followed immediately by (currently) 27 lines of the '''PARTSNAME''' code used to specify the costume parts and colors of a player character.  The '''PARTSNAME''' code is also used to specify things such as [[Auras]] and [[Custom Weapons]].  Essentially all things associated with a player character's costume or standard appearance are controlled by the '''COSTUME''' and '''PARTNAME''' code.
+
The '''COSTUME''' line is followed immediately by (currently) 27 lines of the '''PARTSNAME''' code used to specify the costume parts and colors of a player character's complete costume.  The '''PARTSNAME''' code includes specifying features such as [[Auras]] and [[Custom Weapons]].  Essentially all things associated with a player character's costume or standard appearance are controlled by the '''COSTUME''' and '''PARTSNAME''' code.
  
 
  0  48  COSTUME 1 89a0ea 0.000000 0.000000 0.000000 -0.118681 -0.006593 -0.102857 -0.253846 0.014769 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
 
  0  48  COSTUME 1 89a0ea 0.000000 0.000000 0.000000 -0.118681 -0.006593 -0.102857 -0.253846 0.014769 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
Line 317: Line 321:
 
  0  48  PARTSNAME none none none 00000000 00000000
 
  0  48  PARTSNAME none none none 00000000 00000000
 
  0  48  PARTSNAME none none none 00000000 00000000
 
  0  48  PARTSNAME none none none 00000000 00000000
 +
 +
<span style="color:orange;">Again: DOESN'T WRAP. Maybe use a div box instead?</span>
  
 
<span style="color:orange;">Tackling these in greater detail -- what line is what costume section, for  example, talking about colors, etc. -- might be a good addition.</span>
 
<span style="color:orange;">Tackling these in greater detail -- what line is what costume section, for  example, talking about colors, etc. -- might be a good addition.</span>
Line 326: Line 332:
 
== SEQ ==
 
== SEQ ==
  
Just as the '''NPC''' command is used to specify the appearance (and model) of an NPC, the '''SEQ''' command is used to specify the appearance of a non-destructible, clickable object.  '''SEQ''' is attached specifically to the type of ''entity'' used for non-destructible, clickable mission objective objects ("clickies" or "glowies").  These particular types of ''entities'' are distinct from NPCs, with a different type of model code.
+
Just as the '''NPC''' command is used to specify the model (and thereby appearance) of an ''NPC'', the '''SEQ''' command is used to specify the model of a non-destructible, clickable object.  '''SEQ''' is attached specifically to the type of ''entity'' used for non-destructible, clickable mission objectives ("clickies" or "glowies").  These particular types of ''entities'' are distinct from ''NPCs'', with a different set of model codes.
<!-- Also the Bloody Bay & Warburg terminals, in addition to traditional mission objective glowies, I believe. -->
+
<!-- Also the Bloody Bay & Warburg terminals, in addition to traditional mission objective glowies, I believe. -SB -->
  
However, these '''SEQ''' ''entities'' do not current appear during demo playback (and this has been the case since demos were first introduced).  '''SEQ''' objects are invisible when the demo is played back and do not show up.
+
However, these '''SEQ''' ''entities'' do not currently appear during demo playback (and this has been the case since demos were first introduced).  '''SEQ''' objects are invisible when the demo is played back and do not show up.
  
Additionally, please note that the '''SEQ''' ''entities'' use a different set of model names specific to the '''SEQ''' command.  This means that you can not simply replace the '''SEQ''' command with '''NPC''' to make these models appear during demo playback.  Swapping the commands in this way would only work if you also changed the model name to use an '''NPC''' model equivalent to the '''SEQ''' model (most ''do'' appear to have equivalent '''NPC''' models, however).
+
Additionally, please note that the '''SEQ''' ''entities'' use a different set of model names specific to the '''SEQ''' command.  This means that you can not simply replace the '''SEQ''' command with the '''NPC''' command, keeping the original '''SEQ''' model name, to make these objects appear during demo playback.  Swapping the commands in this way would only work if you also changed the model name to use an '''NPC''' model equivalent to the '''SEQ''' model (most ''do'' appear to have equivalent '''NPC''' models, however).
 
<!-- I do NOT have a mapping of equivalent SEQ to NPC models, sorry. -->
 
<!-- I do NOT have a mapping of equivalent SEQ to NPC models, sorry. -->
  
 
== FX ==
 
== FX ==
  
Tells you what the FX is.  Here's a sample:
+
The '''FX''' command is used to specify the creation in demos of the "effects" used by the game; namely, the powers, the explosions, and essentially any visual effect that is not otherwise produced by an ''entity's'' model or by an animation ('''MOV''').
  
0  3  FX Maintained 4 POWERS/KINETICS/KINSPEEDCONTINUING.FX 0
+
The '''FX''' command line includes a fair amount of data. Here is a sample line:
  
* First number = time index
+
0  3  FX OneShot 4 POWERS/FIRECONTROL/FIREPHOENIX.FX 0
* Second number = unique ID of the entity that "owns" this FX
+
 
* '''FX''' code = "Hi, I'm an FX."
+
A detailed breakdown of this line is as follows:
* After '''FX''' ("Maintained," here) = Duration Type of FX, either ''Maintained'' (ongoing) or '''OneShot'' (goes "bam" and it's gone)Usually FXs are one or the other, but some Maintained/OneShot FX are the same (and just loop the OneShot or whatever if they're Maintained.
+
 
* Next number is the unique ID of the FX.  Not the unique ID of the entity shooting the FX off or afflicted by it, but a new/different unique ID just for the FX itself.
+
* '''0''':  The first number of the line is, as always the '''Time Increment'''.
* Then the code for the particular FX.
+
* '''3''':  The second number in the line is, as usual, the '''Entity ID'''.  This specifies the unique ID of the ''entity'' which "owns" this effect.
* Then a zero, that I think is just an end-of-line type thingie (need to check).
+
* '''FX''': The '''FX''' demo command itself, specifying that this line is executing an effects command.
 +
* '''OneShot''': After the '''FX''', a demo also specifies the duration type of the '''FX'''.  There are two possible values which may be used here -- ''OneShot'' or ''Maintained''.  ''OneShot'' defines this '''FX''' as a one-time event that lasts just as long as it takes the particular '''FX''' to execute''Maintained'' identifies an ongoing '''FX''' which will continue until the demo ends, the ''entity'' it is attached to is removed from the demo, or an '''FX''' termination command is given.
 +
* '''4''': The number after the duration type is a unique ID number assigned to this specific '''FX'''Much like demos must include a unique '''Entity ID''' for every NPC, player character, or object used in the demo, every '''FX''' must be assigned a unique ''FX ID'' to function properly and prevent one '''FX''' from conflicting with another.  This value is always a positive integer and must be unique for any particular '''FX'''.
 +
* '''POWERS/FIRECONTROL/FIREPHOENIX.FX''': This is the demo code of the particular '''FX''' which the game engine is instructed to execute. (In this particular case, this the demo code of the [[Rise of the Phoenix]] power.)
 +
* '''0''':  After the demo code of the '''FX''' to be used, the line ends with a number.  This appears to always be a ''0'' and may simply represent and end of line identifier for the '''FX''' command.
 +
<span style="color:orange;">Need to re-check the trailing 0 info to make sure this is correct.</span>
 +
 
 +
 
 +
This represents the core demo code for specifying a power or other FX-based visual effect.  It is followed by a number of other related lines also required for managing visual effects in a demo.
 +
<!-- I'm calling these visual effects even though they include audio components.  Just for simplicity.  Don't think that would generally cause much confusion. -SB -->
  
 
== FXSCALE ==
 
== FXSCALE ==
  
Just put in "FXSCALE 10.000000 10".  I forget what messing with this does, if anything.
+
The '''FXSCALE''' code is a standard effects-related command which always follows the main '''FX''' line.  This command is always expressed with a standard set of variables as ''"FXSCALE 10.000000 10"''For example:
 +
 
 +
0  3  FXSCALE 10.000000 10
 +
 
 +
Modifying these variables does not appear to produce any change in demo playback or in the scale or appearance of the relevant visual effects.
 +
 
 +
<span style="color:orange;">Correct?</span>
  
 
== ORIGIN ==
 
== ORIGIN ==

Revision as of 00:44, 6 June 2008

Pulling together some Demo Editing notes here. Ok, admittedly it's well beyond just "notes" at this point. I'll start thinking about pushing it live when I get it a little further.

Too big now, eh? Ok, I'll have to think about how best to break this up. A main page with overview, contents, and links, and then sub-pages for the other stuff? Kind of like the The Players' Guide to the Cities?

Overview

Demo Editing is a term used to describe the modifying of a CoH demo file. Typically, the modified demo file is then used to produce user-generated screenshots or movies (Machinima) of events and situations which did not actually take place during live game play. A recorded demo is saved as text file, rather than a standard video file, containing all the commands required to instruct the game engine how to play back the recorded demo. All of this information can be edited, changed, deleted, or added to (or even created from scratch), requiring, at its simplest, only a text editor and a reasonable understanding of the demo file code. This allows for the creation of custom screenshots, comics, and movies via Demo Editing with relative ease.

Demo Editing may be used to strictly refer to just the modification or creation of a custom demo file, or it can be more broadly used to refer to both the editing of a custom demo file and the playback, capture, and production of the modified demo into movies and/or screenshots.

See the Demo Recording entry for information on how to record and play back a demo.

"Victory At Last!"
(Example of a demo edit.)

Understanding Demo Code

Some intro text here.

Think I prefer "Code" over "Commands" given the Time Increment & Entity ID


Time Increment

The Time Increment is the information that tells the demo how to advance the play of the recording. Each line of demo code begins with a number that tells the game engine how much time to advance the demo playback since the previous line, hence this number is referred to as the Time Increment (among other terms). Looked at as a whole, rather than line by line, a demo file is formatted in such a way that it is organized into columns. The first column is always the Time Increment.

The Time Increment is always a positive integer value and specifies the time in milliseconds (thousandths of a second) that the game engine waits, after the previous line of demo code, before executing the next line. So a value of 2000 at the beginning of a line of demo code would mean that the 2 seconds of "real" time would pass, after the previous line of code, before the demo playback carries out that commands on that line. The following code sample shows a line from a demo file with a Time Increment of 400 miliseconds (four-tenths of a second):

400 SKYFILE SKY 0 1 0.000000

Please note that this value, while it controls the advancement of the demo playback, does not control the time of day in a demo. The time of day in a demo is fixed by the Time command, and, once specified, remains fixed throughout the demo playback and does not change.

The Time Increment is required for every line in a demo, and must begin each line, even if the Time Increment is just zero.

The SKY command is frequently used for lines of demo code that serve no purpose other than to advance the Time Increment.

Entity ID

After the Time Increment, most lines of demo code will have a second positive integer value. A few special cases will instead have a text value after the Time Increment. This second number (or text entry) is the Entity ID. This value is the unique ID associated with every entity recorded in the demo. Entity refers to any model, object, mission objective, NPC, or player character in the demo. Each such element must have a unique ID associated with it, as specified by the Entity ID. All lines of code must have an Entity ID as the second element in the line, usually a positive integer. The special cases for the Entity ID are discussed below. As an example, the following line of demo code has an Entity ID of "3":

0   3   NEW "Senator Decimus Aquila"

Looked at in terms of a column format, the second column in a demo file is the Entity ID.

The Entity ID is a unique value associated with a specific entity. The Entity ID of each line tells the game engine which entity to apply/attach that line of demo code to. For example, if a line of demo code includes an animation (MOV), the Entity ID Number tells the game engine which entity to have perform that animation in the demo playback. The following line of demo code shows the WALKCYCLE MOV attached to the entity with the ID "113":

0   113 MOV WALKCYCLE 0

Special Case Entity IDs

  • 0: "0" (zero) is used as the entity ID value for the Version, Map, Base, and Time commands. This is likely used as a "null" value of the Entity ID to indicate that these commands are not associated with a particular entity.
  • CAM: The camera information recorded in the demo is identified by the text CAM in the place of the Entity ID number. This can be viewed as a special case value of the Entity ID where it uses the text CAM in place of a number.
  • SKYFILE: Similar to CAM, the SKYFILE code appears in demo lines in the place normally associated with the Entity ID. This can also be considered a special case value of the Entity ID, specific to the SKY command which always follows.
  • DYNGROUPS: As with CAM and SKYFILE, the DYNGROUPS code can be viewed as a special case non-numeric Entity ID associated specifically with the DYNARRAY command.

Version

Does this even do anything? Or just one of those things you have to have.

Note that the Version command line always begins with a Time Increment of 1 (rather than 0).

Map

The Map command tells the game engine what map to display for the demo playback. The Map command will be followed on the same line by the file name of the map to be displayed, like so:

0   0   Map maps/City_Zones/City_04_01/City_04_01.txt

The one exception to this is for a demo made in a Supergroup Base. Demos recorded in bases will not have any file name specified after the Map command. The Map command will end the line and will be followed by the Base command on the next line.

Base

A Supergroup Base does not have any pre-defined map associated with it. This is reflected in recorded demos by the Base command. Demos recorded in a base will not have any map file name specified after the Map command, but the next line of the demo file will include the Base command, which will precede a large amount of data apparently used to define and generate the base layout. For example (note that the binary Base data is incomplete in this example and would typically continue to fill a page or more):

0   0   Map
0   0   Base "UÀ�\0x^íYsÛ¸–€ç5©Ê`õ˼Ü8Ü\pùÍ–—¤oÜí±Ü[35¥‚)Äâ5Eª¸\dQ~ý�¸H¤D� \de...


Is it worthwhile to have a code sample here or is the binary goop just going to confuse people? Maybe just say that the binary data used by the base command is beyond the scope of this guide.

The Base command appears only for demos recorded inside a Supergroup Base. Demos recorded in any other location, mission, or circumstance will not include the Base command.

Time

The Time command instructs the game engine what time of day to use for the demo playback. The value which follows the Time command on this line is the time of day, in hours, using the military time notation (also known as 24-hour clock notation), with fractions of an hour expressed as a decimal value. Hence values following the Time command may range from 0.0 to 23.99. In a demo, this line would appear as follows:

0   0   Time 14.428092

Where, in this example, the value of 14.428092 corresponds to 2:25 PM (and about 41 seconds). Some examples of Time values, with their equivalent 12-hour clock notation, are as follows:


Demo Time Value Equivalent 12-Hour Clock Time
0.000 12:00 Midnight
6.500 6:30 AM
12.000 12:00 Noon
16.667 4:40 PM
22.000 10:00 PM


Note that, unlike in-game, the time of day does not advance in demo playback, so whatever the time is as specified in the demo code is what the time of day will be for the entire demo playback.

POS

The POS command refers to "position." This is used to tell the game engine where to place a given entity in the demo playback. All players, NPC, and objects (all entities), as well as the demo camera (or CAM) must have a associated POS command in order to appear properly in the demo. Changing the POS values for an entity over the course of a demo controls the movement of that entity in the demo. Changing the POS is how you move something from point A to point B.

The POS command is followed by a set of three numerical map coordinates in X Z Y format. It is important to note that the order is X Z Y (and not X Y Z).

0   1   POS -1140 102 4592.5

For a given map, the X value corresponds to the North-South position of the entity, the Z value corresponds to altitude or Up-Down position of the entity, and the Y value corresponds to its East-West position. Larger values of X are further to the South, larger values of Z increase altitude, and larger values of Y are further to the West. Note that, for X & Y, this may be the reverse of what is intuitive for many.

Map image here, marked up with X & Y

The values for POS are expressed in feet. So changing an X value from 1.0 to 2.0 will move an entity one foot to the South. Changing an X value from 1.0 to 2641.0 will move an entity a half mile to the South.

The appearance of CAM POS in the code is worth special note. As discussed above, CAM is used as the Entity ID for the demo camera -- the POV from which the demo is recorded. The camera, or CAM, is a special pre-defined demo entity which uses the text CAM as its Entity ID rather than an integer value like most entities. With regards to its use of the POS command, the CAM POS lines function the same as for any other entity in that they determine the position and movement (through changing the position) of the demo camera/demo POV.

PYR

The PYR command stands for "Pitch-Yaw-Roll". PYR is used similarly to the POS command. Where POS is used to specify the position of an entity, PYR specifies the spacial orientation of an entity. Put another way, POS determines where on the map Ms. Liberty shows up, and PYR determines whether she is standing on her head or on her feet.

The PYR command is followed by three numerical values for Pitch, Yaw, and Roll. These values are expressed in radians, with values ranging from -3.14159 to 3.14159 (-pi to +pi). A total of 2pi (6.28319) represents a complete rotation of 360 degrees for any of the three axes.

0   1   PYR 0 2.626175 0

The Pitch (or "P") value determines the front-to-back up-down orientation of an NPC, object, or other entity -- whether an entity is tilting forward or back.

PYR 0 0 0
PYR 0.8 0 0
PYR -0.8 0 0

The Yaw (or "Y") value determines the left-right facing of an NPC, object, or other entity -- whether an entity is facing to the right or left, rotating around its vertical axis.

PYR 0 0 0
PYR 0 1.6 0
PYR 0 1.6 0

The Roll (or "R") value determines the side-to-side tilt of an NPC, object, or other entity -- whether an entity is leaning/rotated to the left or to the right.

PYR 0 0 0
PYR 0 0 1.6
PYR 0 0 -1.6

Note that the axis of rotation for most models is at the base of the model and not through their apparent center.

The combination of these three values allows you to adjust an entity in all three dimensions to obtain any orientation desired.

All of the additional comments made regarding CAM POS also apply for CAM PYR (relative to the PYR) command, where CAM PYR is a PYR command applied to the CAM (camera) Entity ID.

NEW

NEW is the command used by the demo to tell the game engine that it is adding a new entity (NPC, player, object, mission objective, etc.). The line with the NEW command is (with one exception) where the unique Entity ID is first specified (the second numerical value in the line, after the Time Increment) and is the most important value associated with the NEW command. When you use the NEW command to add a new entity, that entity and anything associated with it must use the same Entity ID throughout the demo thereafter. For example, in the following line of demo code, "37" is the Entity ID which must be associated with Ms. Liberty and all commands attached to the Ms. Liberty entity for the remainder of the demo.

0   37  NEW "Ms. Liberty"

The NEW command is followed by the name to be attached to that entity. This can be left blank. The entity does not require that a name be attached. If the name is one word, with no spaces, then quotes are not required for the name:

0   26  NEW Statesman

If the name includes spaces (more than one word), then the name must be enclosed by quotation marks:

0   14  NEW "Sister Psyche"

You may enclose single-word names in quotation marks and this will not cause any harm, although recorded demos do not use this convention:

0   26  NEW "Statesman"

NPC, model, and mission objective names do not display during demo playback, but player character names do display. If you do not want player names to appear over their heads during demo playback,one way to do this is via demo editing by leaving the name field blank:

0   26  NEW 

Or by entering a blank space between quotation marks for a name:

0   26  NEW " "

The NEW command can be used mid-way through a demo to add an entity that was not there at the start of the demo.

NPC

The NPC command specifies the game model to display for an NPC. Remember that the Entity ID for the NPC line must match the unique Entity ID assigned by the NEW command. For example:

0   14  NEW "Chief Mentalist"
0   14  NPC Rikti_Armour_Lieutenant_01

Entities classed as an NPC include all "normal" non-player characters (enemies, allies, monsters, etc.), but also all destructible objects. Any object in a mission or map which can be destroyed (such as mailboxes, fire hydrants, and everything else in Mayhem Missions) is considered an NPC and its appearance is managed by the NPC command and the model assigned thereby.

Is there more to say about the NPC command?

Link to Codex Model List?

MOV

The MOV command determines the animation performed by an entity. The animation named after the MOV command is executed by the entity as specified by the unique Entity ID on the MOV line. For example, the following MOV command will cause the entity with the unique Entity ID of "10" to perform the "bow down" emote:

0   10  MOV EMOTE_BOW_DOWN 0

The number at the end of the line is a new feature added to demos with Issue 12. A "0" (zero) is the default or null value and executes the animation unmodified. Other positive integer values, besides zero, relate the animation to a weapon or object attached to the entity. Is this bit on the trailing number right?

Link to Codex MOV List?

HP

The HP code specifies the current Health of a destructible NPC. This code is associated only with NPCs which can be damaged or destroyed. NPCs or other entities which can not be damaged do not use this code. Hence, the HP code will not be seen in a demo file for such NPCs as pedestrians, trainers, contacts, or stores; but will be seen attached to enemies and destructible objects.

Any NPC which uses the HP code must also have the HPMAX code associated to it. HP specifies the current Health and HPMAX specifies the maximum Health. Both codes must be associated with any destructible NPC. For example:

0   5   NEW "Blood Brother Slammer"
0   5   NPC Thug_Hellion_01
0   5   POS -227.15625 0 130.203125
0   5   PYR 0 -0.380427 -0
0   5   MOV LOITER_READYC 0
0   5   HP 60.00
0   5   HPMAX 60.00

For NPC characters (enemy/ally types), this code is not normally required when simply making such an entity appear in a demo. However, this is vital for properly displaying destructible objects. Many destructible objects have a variable appearance which is based on the relative values of HP and HPMAX. If these lines are not included in the demo for such NPCs, the game engine will render the destructible objects as if they had zero HP; which typically (though not always) means that the object will be treated as destroyed and will not be visible in the demo playback.

The values of HP for an NPC will change over the course of a demo recording as that NPC is damaged or healed.

If you are adding an NPC or object to a demo, and are uncertain whether it is destructible and requires the HP/HPMAX code, it is harmless to add this code to an NPC, even if it is not required.

HPMAX

HPMAX specifies the maximum Health of an NPC. As mentioned above under the HP detail, this command is attached to destructible NPCs and objects, which must also have the HP code attached.

For destructible objects which have a variable appearance, the relative proportion of the values for HP and HPMAX determines the appearance of those destructible objects in the demo playback.

DEL

Just as the NEW command is used to add an entity to a demo, entities can also be removed from a demo via the DEL command. This command will delete the specified entity, removing them from the demo.

This command is not accompanied by any variables after the command, requiring only the Time Increment (as all lines do) and the Entity ID, which is the ID of the entity to be deleted from the demo.

0   70  DEL


Player

The Player command is used to specify the particular player character around which the demo is being recorded. It is used just to flag that one specific player character, and only that one character should have the Player command attached to it. Other player characters that appear in the demo, that are not the POV character of the demo recording, do not have this flag attached.

This command is an exception to the usual convention for the NEW command in that the Player command is issued first and is when the unique Entity ID is attached to the POV player character (immediately before the NEW line), appearing like so:

0   48  Player
0   48  NEW "Lady Briton"

The Player command has no associated trailing values or variables.

COSTUME

The COSTUME command is required for every player character in a demo. The COSTUME line includes the variables used to specify the body type, build, and facial dimensions of a character. It is followed, on subsequent lines, by the PARTSNAME code which specifies the remainder of the player character costume.

0 1026 COSTUME 0 aad2f6 2.802201 -0.269841 -0.015873 -0.015873 -0.301587 -0.238095 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873 -0.015873

DOESN'T WRAP. Maybe use a div box instead?

This could possibly use some further detail

PARTSNAME

The COSTUME line is followed immediately by (currently) 27 lines of the PARTSNAME code used to specify the costume parts and colors of a player character's complete costume. The PARTSNAME code includes specifying features such as Auras and Custom Weapons. Essentially all things associated with a player character's costume or standard appearance are controlled by the COSTUME and PARTSNAME code.

0   48  COSTUME 1 89a0ea 0.000000 0.000000 0.000000 -0.118681 -0.006593 -0.102857 -0.253846 0.014769 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
0   48  PARTSNAME Tight tights !Hips_V_Pattern_Strips_01 0000d4 990002
0   48  PARTSNAME Tight tights !chest_Fat_Stripe 0000d4 990002
0   48  PARTSNAME V_fem_Head.GEO/GEO_Head_V_Asym_Standard !Face_Skin_V_Fem_Head_19 !Face_V_Mask_Executioner_01 0000d4 ffffff
0   48  PARTSNAME Flare smooth_matte !glove_Sharp 0000d4 ffffff
0   48  PARTSNAME Smooth tights !Boot_V_Pattern_Stripe_01 0000d4 990002
0   48  PARTSNAME none none none ffffff ffffff
0   48  PARTSNAME Student_01 Long_01a Long_01b 00fdff 1c67ff
0   48  PARTSNAME none none none 00000000 00000000
0   48  PARTSNAME none none none 00000000 00000000
0   48  PARTSNAME Tight base Lion_01 00fdff 00cacc
0   48  PARTSNAME Smooth spiked_01a spiked_01b 0000d4 ffffff
0   48  PARTSNAME none none none 00000000 00000000
0   48  PARTSNAME none none none 00fdff 00fdff ffffff ffffff WEAPONS/Custom_Claws/Fem_ClawsRight_TalsorianBlade01.fx
0   48  PARTSNAME none none none 00000000 00000000
0   48  PARTSNAME none none none 00000000 00000000
0   48  PARTSNAME Half Cape_Top_01 none ffffff ffffff
0   48  PARTSNAME Half_31 Generic_01a Generic_01b 00fdff 3fbeff
0   48  PARTSNAME none Cape_01 none ffffff ffffff ffffff ffffff capes/CapeLongFem.fx
0   48  PARTSNAME none none none 00000000 00000000
0   48  PARTSNAME none none none 00000000 00000000
0   48  PARTSNAME none none none 00000000 00000000
0   48  PARTSNAME none none none 00000000 00000000
0   48  PARTSNAME none none none 00000000 00000000
0   48  PARTSNAME none none none 00000000 00000000
0   48  PARTSNAME none none none 00fdff 00fdff ffffff ffffff WEAPONS/Custom_Claws/Fem_ClawsLeft_TalsorianBlade01.fx
0   48  PARTSNAME none none none 00000000 00000000
0   48  PARTSNAME none none none 00000000 00000000

Again: DOESN'T WRAP. Maybe use a div box instead?

Tackling these in greater detail -- what line is what costume section, for example, talking about colors, etc. -- might be a good addition.

XLU

Function unknown. Does changing this have any affect on character appearance or demo playback?

SEQ

Just as the NPC command is used to specify the model (and thereby appearance) of an NPC, the SEQ command is used to specify the model of a non-destructible, clickable object. SEQ is attached specifically to the type of entity used for non-destructible, clickable mission objectives ("clickies" or "glowies"). These particular types of entities are distinct from NPCs, with a different set of model codes.

However, these SEQ entities do not currently appear during demo playback (and this has been the case since demos were first introduced). SEQ objects are invisible when the demo is played back and do not show up.

Additionally, please note that the SEQ entities use a different set of model names specific to the SEQ command. This means that you can not simply replace the SEQ command with the NPC command, keeping the original SEQ model name, to make these objects appear during demo playback. Swapping the commands in this way would only work if you also changed the model name to use an NPC model equivalent to the SEQ model (most do appear to have equivalent NPC models, however).

FX

The FX command is used to specify the creation in demos of the "effects" used by the game; namely, the powers, the explosions, and essentially any visual effect that is not otherwise produced by an entity's model or by an animation (MOV).

The FX command line includes a fair amount of data. Here is a sample line:

0   3   FX OneShot 4 POWERS/FIRECONTROL/FIREPHOENIX.FX 0

A detailed breakdown of this line is as follows:

  • 0: The first number of the line is, as always the Time Increment.
  • 3: The second number in the line is, as usual, the Entity ID. This specifies the unique ID of the entity which "owns" this effect.
  • FX: The FX demo command itself, specifying that this line is executing an effects command.
  • OneShot: After the FX, a demo also specifies the duration type of the FX. There are two possible values which may be used here -- OneShot or Maintained. OneShot defines this FX as a one-time event that lasts just as long as it takes the particular FX to execute. Maintained identifies an ongoing FX which will continue until the demo ends, the entity it is attached to is removed from the demo, or an FX termination command is given.
  • 4: The number after the duration type is a unique ID number assigned to this specific FX. Much like demos must include a unique Entity ID for every NPC, player character, or object used in the demo, every FX must be assigned a unique FX ID to function properly and prevent one FX from conflicting with another. This value is always a positive integer and must be unique for any particular FX.
  • POWERS/FIRECONTROL/FIREPHOENIX.FX: This is the demo code of the particular FX which the game engine is instructed to execute. (In this particular case, this the demo code of the Rise of the Phoenix power.)
  • 0: After the demo code of the FX to be used, the line ends with a number. This appears to always be a 0 and may simply represent and end of line identifier for the FX command.

Need to re-check the trailing 0 info to make sure this is correct.


This represents the core demo code for specifying a power or other FX-based visual effect. It is followed by a number of other related lines also required for managing visual effects in a demo.

FXSCALE

The FXSCALE code is a standard effects-related command which always follows the main FX line. This command is always expressed with a standard set of variables as "FXSCALE 10.000000 10". For example:

0   3   FXSCALE 10.000000 10

Modifying these variables does not appear to produce any change in demo playback or in the scale or appearance of the relevant visual effects.

Correct?

ORIGIN

Who is shooting this FX off. Where the FX is coming from. When you've got an FX in play, you need to specify who's catching and who's pitching. Need to do both even if it's a self-only power and you're doing both the pitching and the catching.

0   3   ORIGIN ENT 0 0

If it's a self-only power, both numbers after ENT ("Entity" I figure) are 0. If it's a beam thing and needs at origin point, then the number after ENT is the unique ID of the shooter (pitcher).

I THINK. Need to double-check. Haven't played with FX in a while. Need to review ORIGIN/TARGET. Probably got something wrong in here since I'm going just by memory. Last number always zero for both of these? Is origin always 0 0 or do beam effects, where the zap can be seen traveling from A to B have an ORIGIN line that includes the source Entity ID.</spam>

TARGET

Who's on the receiving end of the FX.

0   3   TARGET ENT 3 0

First number after ENT is the unique ID of the entity getting hit by the FX.

Can also be

TARGET POS X Z Y

For Targeted AoE powers ("shoot at the ground" powers/targeting recticle powers).

FXDESTROY

Ends an FX.

SKY

Controls invasion sky color. Binary control for first two fields. Third field unknown, but lets you do some wonky color/depth-of-field stuff if you crank up the value. Haven't tried negative values. Should do that.

Also frequently used as a generic time (demo play) advancer (advancing time index of first column number).

DYNARRAY

Controls war walls up down. Also controls other "dynamic" effects, like the Recluse's Victory "war boards" in Atlas and Grandville, the appearance of Recluse's Victory itself (I think, verify), etc.

Only appears for maps/demo recordings that need it, so may not appear in all demo file code.

Bases are DYNLIB.

CHAT

Chat. Did I12 remove chat from global channels and such from demos? Haven't noticed anything but local-type stuff in a few I've looked at.

FLOAT

"Pop up" text (like "Salvage Found"). Note that it makes calls to pre-defined text strings, so doesn't look like you can customize the text seen, just pick from the pre-defined messages.

floatdmg

Damage-specific float text.

EntRagdoll

Ragdoll stuff. The code variables obviously manage ragdoll physics playback appearance (but no idea what they all mean)

DYNLIB

Base entity code based off of previous line NPC call.

How Tos & FAQs

How NPCs/Objects/Models Work

How Entities work.

How the Camera Works

(Remember axis through the head thing.)

How Movement Works

How FXs Work

Transparency (Stealth)

Most stealth/invisibility/transparency effects don't play back in demos. The few exceptions (like trainer War Witch and Numina) are built into the model and not something you can apply.

However, although the standard stealth powers don't work, this FX does:

OBJECTIVEOBJECTFX/GHOSTED.FX

This is the placeable mission objective effect (like for planting bombs) that make the objects transparent until you place them. I did a quick demo test as follows (splicing States onto the City Rep):

0 6 NEW "City Representative"
0 6 NPC Model_Statesman
0 6 POS 128.5 -768 -639.5
0 6 PYR 0 0 0
0 6 MOV ALTREADY_TRANS_XARMS
0 6 FX Maintained 7 OBJECTIVEOBJECTFX/GHOSTED.FX 0


The FX line is the only one I added (make sure it doesn't conflict with any other FX) and voila! Transparent Statesman.

Qualifiers:

  • The transparency effect pulsates, so it's not a consistent steady level of transparency.
  • The FX also includes the mission objective noise, so you might have to work with the audio.


Invasion Sky & War Walls

Normal sky: SKYFILE SKY 1 0 1.000000
Invasion sky: SKYFILE SKY 0 1 1.000000

That's using the first two fields (which is how it records during an actual invasion), which appear to be binary.

You can also play with the final number to tweak things, though I don't know how that functions. My best guess being that it's a saturation value of some sort -- the more you increase it, the more color starts washing out all detail, although interestingly it seems to predominate in the foreground, rather than the sky or distance. Possibly a depth of field value. Dunno.

War Walls Up:  0   DYNGROUPS DYNARRAY |100,0
War Walls Down:  0   DYNGROUPS DYNARRAY |0,0

Walking

How to make player characters walk here.

Destructible Objects

Object-based NPCs that are classed as "destructible" have a variable appearance based on their hit points, sometimes as simple as destroyed/not-destroyed, sometimes with multiple different appearances including partly-damaged states.

To make these work in demos, you have to assign hit points to the models. If you don't do that, then the game assumes the hit points are zero and treats the model as "destroyed", which usually, but not always, means that it's just gone.

So when you're splicing these into the demo code, include hit points for them like so:

0 23 NPC v_destcldrn_cauldron
0 23 MOV READY
0 23 HP 150.00
0 23 HPMAX 150.00

Setting the HP equal to HPMAX will give you the default, undestroyed appearance, and hopefully that should make them appear for you. If you want to see if there are transitional appearances, you can try setting HP to half of HPMAX, and so forth. Not all have transitional appearances, but some do. The Clockwork Paladin construction comes to mind as an object with multiple different transitional appearances depending on HP. This is also how the Rikti A Bomb warning lights color is controlled.

Not all object models are destructible, but seeing "dest" anywhere in the object name is generally a guarantee that it is one of these. But there are also destructible models that don't have "dest" in the name. If in doubt, add HP & HPMAX (at 100% HP) to the model code.


Fixing "Player" FX

What it looks like is happening is that many FXs are not working if they are attached to the Player (meaning the character flagged as the Player in the demo). I pasted in some other NPCs and players (not as the "Player") and they appeared to work fine.

I suspect that this may have been something that crept in with I11, because some of the Maintained FXs that I was able to get to work are the Willpower FX, but older power set FXs didn't work for me (just based on 1 or 2 that I tried quickly). I also tried inserting the moneybag FX into some of my own demos and had the same problem with it not appearing on my "Player".

So, although you're doing everything right, it appears to be an issue with demos that isn't working. As I said, it appears to only be the one character flagged as the "Player" that is the problem. Other players and NPCs look like they work OK, so here's a quick fix. What you can do to get by this issue is create an invisible model attached to the "Player" flag and turn your character into just a regular player. You can do this by making the following code into the beginning of your demo:

1 0 Version 2
0 0 Map maps/City_Zones/Trial_06_01/Trial_06_01.txt
0 0 Time 21.028650
0 CAM POS 1818.146851 -318.060516 9450.268555
0 CAM PYR -0.346 1.370835 0
0 50 Player
0 50 NEW "Invisible Placeholder"
0 50 NPC Puddle
0 50 POS 1803.004883 -319.173309 9443.212891
0 50 PYR 0 3.11 0
0 50 MOV READY
0 1 NEW " "
0 1 COSTUME 1 ffffff -3.297710 -1.000000 -0.015873 -1.000000 -0.523810 -0.777778 -0.682540 -0.047619 -0.015873 -0.428571 0.714286 -0.015873 -0.492063 0.015873 -0.650794 -0.460317 -0.523810 0.428571 -1.000000 0.396825 -0.142857 -0.301587 0.682540 0.015873 -0.746032 -1.000000 1.000000 -0.492063 0.460317 0.365079
0 1 PARTSNAME shorts skin_tights bikini_3 000000 000055

...the end there being the rest of your character's costume as normal. Puddle is an invisible model, so by inserting that as the "Player" it gets you past this bug (I also changed your character's name field to <0 1 NEW " ">, otherwise, as you are no longer the "Player", the character's name would appear above your head).


Internal Links

Demo Recording

External Links

Guides

Tools & Applications

Other