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
m (Replacing page with 'Moved Live: Demo Editing Genuinely just for notes now.')
 
Line 1: Line 1:
{{TOCright}}
+
Moved Live:  [[Demo Editing]]
{{wip}}
+
  
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.
+
Genuinely just for notes now.
 
+
<span style="color:orange;">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]]?</span>
+
 
+
= 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 ([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.
+
 
+
'''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.
+
 
+
[[Image:Victoryatlast01.jpg|500px|thumb|center|<center>"Victory At Last!"<BR/>(Example of a demo edit.)</center>]]
+
<!-- It's a little dark, especially when scaled down (meaning in terms of lighting; I'm fine with the emotional darkness); I may put together something new that's a little brighter. -SB -->
+
 
+
= Understanding Demo Code =
+
 
+
<span style="color:orange;">Some intro text here.</span>
+
 
+
<span style="color:orange;">Think I prefer "Code" over "Commands" given the Time Increment & Entity ID</span>
+
 
+
 
+
 
+
== 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 ==
+
 
+
<span style="color:orange;">Does this even do anything? Or just one of those things you have to have.</span>
+
 
+
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:
+
 
+
<nowiki>0  0  Map maps/City_Zones/City_04_01/City_04_01.txt</nowiki>
+
 
+
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? -SB -->
+
<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.
+
 
+
== 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:
+
 
+
 
+
{| border="1" cellspacing="0" cellpadding="5" align="center"
+
! 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.
+
<!-- That is still correct, yes?  Nothing has changed recently that I missed as far as time of day advancing goes? -->
+
<!-- What happens if you re-issue the Time command part-way through a demo?  I haven't tried that.  Does it change the time?  If so then you could, in theory, splice in a series of incremental Time commands to change the time of day during the playback of a demo.  -->
+
 
+
== 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.  <span style="color:orange;">There are other ways to interpret the ordering of these values.  See [[Coordinates]].</span>.
+
 
+
0  1  POS -1140 102 4592.5
+
 
+
For a given map, the X value corresponds to its East-West position of the ''entity'', the Z value corresponds to altitude or Up-Down position of the ''entity'', and the Y value corresponds to the North-South position. Larger values of X are further to the West, larger values of Z increase altitude, and larger values of Y are further to the South.  Note that, for X & Y, this may be the reverse of what is intuitive for many.
+
 
+
The values for '''POS''' are expressed in feet.  So changing an Y value from 1.0 to 2.0 will move an ''entity'' one foot to the South.  Changing an Y 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 [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 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. -SB -->
+
 
+
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.
+
 
+
{| class="wikitable" style="text-align:center"
+
|-
+
| [[Image:PYRPitch00.jpg | center | thumb | PYR 0 0 0]]
+
| [[Image:PYRPitch08.jpg | center | thumb | PYR 0.8 0 0]] 
+
| [[Image:PYRPitch08neg.jpg | center | thumb | 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.
+
 
+
{| class="wikitable" style="text-align:center"
+
|-
+
| [[Image:PYRYaw00.jpg | center | thumb | PYR 0 0 0]]
+
| [[Image:PYRYaw16.jpg | center | thumb | PYR 0 1.6 0]] 
+
| [[Image:PYRYaw16neg.jpg | center | thumb | 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.
+
 
+
{| class="wikitable" style="text-align:center"
+
|-
+
| [[Image:PYRRoll00.jpg | center | thumb | PYR 0 0 0]]
+
| [[Image:PYRRoll16.jpg | center | thumb | PYR 0 0 1.6]] 
+
| [[Image:PYRRoll16neg.jpg | center | thumb | 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.
+
 
+
<span style="color:orange;">Is there more to say about the NPC command?</span>
+
 
+
<span style="color:orange;">Link to Codex Model List?</span>
+
 
+
== 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''.  <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?  Repeating what I've read in Zloth's posts. -SB -->
+
 
+
<span style="color:orange;">Link to Codex MOV List?</span>
+
 
+
== 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
+
 
+
<!-- Add info on being able to re-use Entity IDs after a DEL. -SB -->
+
 
+
== 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.  The following shows a single line of demo code reflecting all the variables used by the '''COSTUME''' command:
+
 
+
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
+
 
+
<!--
+
{{Divbox|gray||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}}
+
I don't like force-breaking the COSTUME line, but the divbox looks worse. --SB
+
-->
+
<span style="color:orange;">This could possibly use some further detail, possibly identifying what element all of the variables control, playing with character height and stuff like that.</span>
+
 
+
== 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
+
 
+
<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>
+
 
+
== XLU ==
+
 
+
The '''XLU''' command has, at various times, appeared in demo recordings; typically following either the costume data in the case of player characters or after the model information for NPCs.  Whether this code is present in demo recordings or not has changed multiple times over the game's lifetime.  At present, it is appearing attached to some, but not all, player character models after the final line of '''PARTSNAME''' code.  A sample of an instance of the '''XLU''' command line:
+
 
+
0  2366 XLU 0.498039
+
 
+
The function of this command is unknown and modifying the variable attached to it does not affect the demo in any apparent way.  It is possible that this is simply a code artifact which does not have any actual bearing on 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.
+
<!-- Also the Bloody Bay & Warburg terminals, in addition to traditional mission objective glowies, I believe. -SB -->
+
 
+
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).
+
<!-- I do NOT have a mapping of equivalent SEQ to NPC models, sorry. -->
+
 
+
== 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''' is assigned a unique ''FX ID'' to identify it.  This value is always a positive integer and must be unique for any particular '''FX'''.  The other command which utilizes this ID number is the '''FXDESTROY''' command used to end or delete a visual effect.
+
* '''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 is the demo code for 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 line for specifying a power or other FX-based visual effect.  In addition, however, it is followed by a number of other related lines also required for managing visual effects in a demo.  The required lines which must follow are the '''FXSCALE''', '''ORIGIN''', and '''TARGET''' command lines.
+
<!-- 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 ==
+
 
+
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 ==
+
 
+
The third required demo command for visual effects is the "ORIGIN" command.  This command is used to identify the source of an '''FX''', doing so via the '''Entity ID''' which precedes the command:
+
 
+
0  3  ORIGIN ENT 0 0
+
 
+
The values following the '''ORIGIN''' command (''ENT'' to specify an ''entity'' and the numerical values) appear to always be constant, with "ENT 0 0" being the only values to follow the '''ORIGIN''' command.
+
<!-- Note:  This marked as the "ORIGIN" command rather than the "ORIGIN ENT" command becauses the "ENT" text does appear to be a variable used to specify the command as associated with an entity.  See the use of the "TARGET" command with both "ENT" and "POS". -SB -->
+
<!-- Also, I know that many demo folks have previously reported that the numeric variables after the "ORIGIN" command were used to identify the entity that was the FX origin, but I don't see those values being used any more.  It's all just "0 0".  Kind of makes sense.  Would be redundant if you already have the Entity ID telling you who the FX origin is attached to.  But would like to know if someone can show an example (from current I12+ demos) where this isn't the case. -SB -->
+
 
+
== TARGET ==
+
 
+
The '''TARGET''' demo command line is the final line required for managing visual effects.  This command line specifies that target or subject of a particular '''FX'''.  There are, in general, three different cases which may be specified by the '''TARGET''' command.
+
 
+
For the first case, the '''TARGET''' command line specifies an '''FX''' which is self-targeted, where the ''entity'' which is causing or "owns" the '''FX''' is targeting themself or otherwise applying that '''FX''' to themselves.  This is the case for many damage shields, protection toggles, self-heals, and so forth where an ''entity''uses a power that creates a visual effect on themself.  In this case, the '''TARGET''' command will be followed by the ''ENT'' value, to specify that the target subject is an ''entity'' and then by '''Entity ID''' of the target subject.  Because the ''entity'' is self-targeting, the '''Entity ID''' before and after the '''TARGET''' command will be the same:
+
 
+
0  3  TARGET ENT 3 0
+
 
+
In the second case, the '''TARGET''' command is used in a situation where one ''entity'' is using an FX on or against another ''entity''.  This generally the situation which occurs when one ''entity'' shoots at another with an energy bolt or fire blast, but also applies to any circumstance where one ''entity'' is generating the '''FX''' and another, different ''entity'' is the recipeient of the '''FX'''.  In this situation, the '''TARGET''' command will be precede by the '''Entity ID''' of the ''entity'' creating or generating the '''FX''' and the '''Entity ID''' after the '''TARGET''' command (and ''ENT'' value for ''entity'') will be the unique ID of the different ''entity'' which is the target recipient of the '''FX''' being generated:
+
 
+
0  3  TARGET ENT 27 0
+
 
+
In the third case, the '''TARGET''' command is also applied for powers and effects where the target of the '''FX''' is not an ''entity'', but is instead a targeted location or position.  This is the case where the power effect being created is a Targeted AoE power.  For this application, the '''TARGET''' command is not followed by ''ENT'' (since the target is not an ''entity''), but is instead followed by the ''POS'' identifier to flag it as a position being targeted, and then this is followed by the standard '''POS''' coordinates of the specific location being targeted:
+
 
+
0  3  TARGET POS 1678.937500 -448.846710 193.356308
+
 
+
In the first two cases, the end of line value appears to always be a "0" zero, for the '''TARGET''' command line.
+
 
+
== FXDESTROY ==
+
 
+
A ''Maintained'' '''FX''' continues indefinitely.  In order to stop a ''Maintained'' '''FX''', the '''FXDESTROY''' command must be issued.  The '''FXDESTROY''' command tells the game engine to terminate an continuing '''FX'''.  The number which follows the '''FXDESTROY''' command is the ''FX ID'' attached to the effect in the '''FX''' command line.  In the following example, the '''FX''' being ended is the one with the ''FX ID'' of "4" ("3" being the ''Entity ID'' of the ''entity'' which "owns" the '''FX''):
+
 
+
0  3  FXDESTROY 4
+
 
+
== SKY ==
+
 
+
Currently, the '''SKY''' command appears to serve two purposes.
+
 
+
First, the '''SKY''' command line is used as a "generic" time advancer for demo playback.  If there is no other action taking place (no other demo commands being issued), a demo recording will use the '''SKY''' command (maintaining its current variables) to advance the '''Time Increment'''.  If you have a demo recording where nothing is currently happening or changing, other than that time is progressing, the '''SKY''' command line will be used to advance the time in the demo file.  When looking at a demo file, especially one with a significant amount of "idle" activity, you will frequently see '''SKY''' command lines with a non-zero '''Time Increment''':
+
 
+
420 SKYFILE SKY 1 0 1.000000
+
 
+
Second, the '''SKY''' command is also used to control the color change of the sky during a Rikti invasion.  This is done by "swapping" the binary values of the first two variables following the '''SKY''' command:
+
 
+
{| border="1" cellspacing="0" cellpadding="5" align="center"
+
! Sky "Type"
+
! Demo Code
+
|-
+
| Normal/Default Sky
+
| 0 SKYFILE SKY 1 0 1.000000
+
|-
+
| Invasion Sky
+
| 0 SKYFILE SKY 0 1 1.000000
+
|-
+
|}
+
 
+
The intended function of the final variable following the '''SKY''' command is unclear.  Increasing this calue will cause color to start washing out all detail, with varying depth and intensity. It may possibly represent a saturation value, or possibly a depth of field value.  In all known demo recordings, this entry always maintains a constant value of 1.000000.
+
 
+
== DYNARRAY ==
+
 
+
The '''DYNARRAY''' command is used to control dynamic map content in a demo recording.  This command will be followed by an array of data that instructs the game engine how to display the dynamic map content during demo playback.  Not all maps have dynamic content attached to them, and demo recordings on maps that lack dynamic content will not include this command.  Dynamic content in this respect referes to map elements (as opposed to ''entitites'') that may change or vary in appearance.  Examples of such contnet include the [[War Walls]] (which are raised and lowered by the Rikti invasions), the [[Atlas Park]] & [[Grandville]] "war boards" or "status boards" (which display the current control/ownership status of the pillboxes in [[Recluse's Victory]]), and the variable map appearance of [[Recluse's Victory]] itself.
+
<!-- I haven't directly confrimed that last one recently, but I figure that must be how it works.  Correct if wrong. -SB -->
+
 
+
The size of the array which follows the ''DYNARRAY'' command will vary depending on the number of dynamic elements which must be managed for that map.  Many city zones will have only a single array set for managing the display state of the [[War Walls]].  For example:
+
 
+
0  DYNGROUPS DYNARRAY |100,0
+
 
+
Other zones, such as [[Atlas Park]] and [[Grandville]] will have additional array data to manage the [[Recluse's Victory]] status boards.  For example:
+
 
+
0  DYNGROUPS DYNARRAY |100,0|100,0|100,0|100,0|50,0|100,0|50,0|50,0
+
 
+
== CHAT ==
+
 
+
Chat.
+
 
+
== FLOAT ==
+
 
+
"Pop up" text (like "Salvage Found", "Inspirations Full", also the "Recharging"/"Out of Range" messages).  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.  The damage numbers over an ''entity" showing the damage being caused.  Includes the "Critical", "Overpower", and "Assassin's Strike" messages, as well.
+
 
+
Unlike float may be able to modify?
+
 
+
== EntRagdoll ==
+
 
+
Ragdoll stuff.  The code variables manage ragdoll physics playback appearance in some fashion.
+
 
+
== DYNLIB ==
+
 
+
Base entity model code keyed off of previous line NPC call.
+
 
+
= Demo "How To" Info =
+
 
+
== How NPCs/Objects/Models Work ==
+
 
+
How ''Entities'' work.
+
 
+
== How the Camera Works ==
+
 
+
(Remember axis through the head thing.)
+
 
+
== How Movement Works ==
+
 
+
== How FXs Work ==
+
 
+
 
+
== How To Make Models Transparent ==
+
 
+
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 (using BAB):
+
 
+
0  17  NEW "Back Alley Brawler"
+
0  17  NPC Model_Back_Alley_Brawler_Trainer
+
0  17  POS 367 65.921875 -832
+
0  17  PYR 0 -1.570796 -0
+
0  17  MOV READY_XARMS 0
+
0  17  FX Maintained 717 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 BAB.
+
 
+
{| class="wikitable" style="text-align:center"
+
|-
+
| [[Image:BABnoghostfx01.jpg | center | thumb | <center>Back Alley Brawler<BR/>Normal appearance</center>]]
+
| [[Image:BABghostfx01.jpg | center | thumb | <center>Back Alley Brawler<BR/>GHOSTED.FX applied</center>]] 
+
|-
+
|}
+
 
+
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.
+
 
+
== How To Make Invisible Models ==
+
 
+
== How To Create Invasion Effects (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
+
 
+
== How To Make Characters Walk ==
+
 
+
How to make player characters walk.
+
 
+
== How To Do "Greenscreening" ==
+
 
+
 
+
 
+
== How To Manage 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 ...
+
 
+
...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).
+
 
+
= Demo Problems & FAQs =
+
 
+
== Model Does Not Appear During Playback ==
+
 
+
# Destructible Model, needs HP
+
# Mission Objective (SEQ)
+
# POS issues (off screen)
+
# PYR issues (upside down and underground)
+
 
+
= Internal Links =
+
 
+
[[Demo Recording]]
+
 
+
= External Links =
+
 
+
== Guides ==
+
 
+
* [http://boards.cityofheroes.com/showflat.php?Cat=&Board=faq&Number=1838565 Custom Demo Creation Guide] (12/04/04)
+
* [http://boards.cityofheroes.com/showflat.php?Cat=&Board=faq&Number=851259 Demo File Format FAQ] (07/07/04)
+
* [http://files.filefront.com/StormknightsVideoGuide+1+0pdf/;9888227;/fileinfo.html Storm Knight's Video Guide] (08/07/04)
+
* [http://boards.cityofheroes.com/showflat.php?Cat=&Board=faq&Number=1874789 Screenshot and Demo Guide v2] (12/09/04)
+
* [http://boards.cityofheroes.com/showflat.php?Cat=&Board=faq&Number=1939763 A Kitty's guide to making CoH movies!] (12/21/04)
+
* [http://boards.cityofheroes.com/showflat.php?Cat=&Number=3322019 Demo Editing and Videos - The end-to-end guide] (07/20/05)
+
* [http://boards.cityofheroes.com/showflat.php?Cat=0&Board=faq&Number=5659797 Paris' Demo Guide] (06/01/06)
+
* [http://boards.cityofheroes.com/showflat.php?Cat=0&Board=faq&Number=6017752 DEMO File Format: Addendum (character parts)] (07/16/06)
+
* [http://boards.cityofheroes.com/showflat.php?Cat=0&Number=10177900&an=0&page=0#Film Toons on Film City Scoop article] (02/08/08)
+
* [http://boards.cityofheroes.com/showflat.php?Cat=0&Number=10262307 Demo Edit Tutorial: Jumping on a moving truck] (02/21/08)
+
 
+
== Tools & Applications ==
+
 
+
* [http://home.kc.rr.com/dasloth/CoH/Demos/DemoEdit.htm Zloth's CoH Demo Editor]
+
* [http://files.filefront.com/CoH+demo+editor/;9888228;/fileinfo.html Storm_Knight's CoH demo editor]
+
* [http://home.earthlink.net/~balshor/DemoEditorInstaller.exe Balshor's Demo Editor]
+
 
+
== Other ==
+
 
+
* [http://home.twcny.rr.com/scuzzbopper/coh/index.html CoH Codex (Demo Model, MOV, FX, & Maps data)]
+

Latest revision as of 00:24, 11 June 2008

Moved Live: Demo Editing

Genuinely just for notes now.