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

User:Eabrace/Demo Edit Example

From Paragon Wiki Archive
Jump to: navigation, search

Initial Preparation

Before you can edit a demo file, you'll need to capture a demo file using /demorecord. The text file this creates can be edited in any text editor.

For the purposes of this walkthrough, we'll use two demo files captured during the Tanker Tuesday visit to the Triumph server.

Tutorial_source_raw_A.cohdemo was recorded during the initial gathering for the event outside the Independence Port gate in Kings Row.

Tutorial_source_raw_B.cohdemo contains the character data for two players that joined the event after teams had been formed and missions were under way.


Step 1: Add Missing Entities to Demo

Before we start doing too much with the demo we recorded, we want to add the two characters that showed up after the event started to the file we want to manipulate.


Step 2: Trim Demo Entities

We have a lot of garbage in the demo file that we really don't need for our purposes, so let's clear out any declarations of extra entities. For example, this is a door we don't care about:

0   82  NEW Dr
0   82  NPC Door_Right_City_01
0   82  POS 608 -34 40.015625
0   82  PYR 0 -3.129317 -0
0   82  MOV READY 0

Let's go ahead and clear out all of the doors, Police Drones, automobiles, and enemy spawns.

In addition, let's clean out any movement (POS) and orientation (PYR) commands except for the initially declared positions for each character.

Something to keep in mind here is that cleaning out all of those movements and extra entities will make the demo file's time span very, very short. In fact, it's going to look like the demo is continuously reloading itself (because it is). To prevent this, we'll add a 25-second dummy delay to the end of the demo.

25000 SKYFILE SKY 2 0 1.000000


Step 3: Reposition Characters

Now that we've pared down the file and only have the entities we're interested in, we can start to reposition the characters to get them where we want them. We want all of the characters standing up on the wall, so we'll take a look at two characters that are already standing on the wall.

  • B. Samson - 1363.040161 11.999969 -63.449478
  • Shield Strike - 1330.203125 12 -62.4375

Based on those positions, we can estimate that the top of the wall is located at Y=12.0, Z=-63.0. Using those numbers we'll alter each character's POS value to "X 12.0 -63.0" where "X" is the existing value of each character's position.

The two character's we pulled in from the second source file are nowhere near our other characters, so we'll pick arbitrary X values near the other characters for their two positions.


Step 4: Reorient Characters

Now we have all of the characters up on the wall, but they're a little crowded and they're all facing different directions. Let's start by adjusting the yaw value in each character's PYR value to get everyone to face the same direction. In this case, we want everyone to face to the north.

Keep in mind these values that correspond to the directions on the compass.

PYR (radians) Compass Heading
-2.3562 Northeast
-1.5708 East
-0.7854 Southeast
0.0 South
0.7854 Southwest
1.5708 West
2.3562 Northwest
3.1416 North


Step 5: Spreading Characters Out

In this step we're going to shuffle the characters around a bit on top of the wall to start spreading them out.

Using the camera's X position at approximately 1360, we'll center the group of characters on the camera. Just for the sake of simplicity, we'll space each of the characters apart by X-values of 2.0 (as a guess), placing 8 on each side of the camera. To keep the camera centered, we'll place the first character to either side at +1.0 and -1.0 from the camera. That gives us the following X-values for the character POS values:

  • 1375
  • 1373
  • 1371
  • 1369
  • 1367
  • 1365
  • 1363
  • 1361
  • 1359
  • 1357
  • 1355
  • 1353
  • 1351
  • 1349
  • 1347
  • 1345


Step 6: "I Need My Personal Space"

The characters are still a little too close together, so we'll try using a gap of 4.0 instead to give them some elbow room.

  • 1390
  • 1386
  • 1382
  • 1378
  • 1374
  • 1370
  • 1366
  • 1362
  • 1360
  • 1358
  • 1354
  • 1350
  • 1346
  • 1342
  • 1338
  • 1334
  • 1330


Step 7: Moving the Camera to the Front

Now that we have our characters in comfortable positions, let's swing the camera around to the other side so we can get a better look at them. Starting with our camera at approximately the same elevation it's been at this whole time, we'll move the camera ahead to the other side of the wall (at approximately Z=100.0 for the moment), and spin the camera around to face South. Keep in mind here that, for whatever reason, that in order to face the camera in the same direction as a character would, the yaw angle of its orientation needs to be offset by 180 degrees (or rather pi radians). So, if we want our camera facing South, its yaw orientation needs to be set to about 3.1416.


Step 8: Adjusting Camera Elevation

Now that we have the camera around in front of our group of characters, we'll see if we can get an optimum elevation from which to view them.

We've already played a bit with manually guessing and checking element positions, but there's another way to do this using the demo file itself.

We'll start by adjusting the pitch of the camera to zero to make its orientation straight and level, remaining at the same approximate elevation. Every five seconds, we'll reposition the camera, moving it down by a value of 5.0, stopping when we reach the height where our characters are placed at 12.0. To make it easier to determine where our camera is located after every reposition, we'll use the "chat" command to make one of the characters call out the current camera elevation. When we see the elevation we want the camera to stop at, we'll just take note of where it's currently at.


Step 9: Zooming Out

A camera elevation of 20 looked good, so we'll stick with that. Next we'll use the same method of walking the camera to a different position to find a distance from the wall sufficient to view all of the characters at once without leaving any large gaps on the sides of the screen (screen resolution will play a part in this, so the final viewpoint that looks best for you may not be the same.) Starting at the same Z-position we had in step 8, we'll walk the camera backwards by a value of 5.0 every five seconds. And once again, we'll use the "chat" command to have a character call out the camera's position.


Step 10: Fine Tuning

We've got everything about set now, so it's just a matter of some fine tuning in the camera position to make sure that our entire group is centered in our view as best possible. We'll just need to skew the camera slightly right or left to accomplish this.

And finally, Firey Red is stuck in the pose at the beginning of a jump, so we'll plant her feet back on solid ground by changing the pose in her MOV line.

And we can grab a screenshot by hitting ` and entering the "screenshot" command into the interface.