Difference between revisions of "Demo"

From P2SR Wiki

m (playback info)
Line 23: Line 23:
 
*<code>sar_stopdemos</code> - Stops the demo queue.
 
*<code>sar_stopdemos</code> - Stops the demo queue.
  
You can use the command <code>demoui</code> for more options while watching demos, or you can use <code>hift + F2</code>.
+
You can use the command <code>demoui</code> for more options while watching demos, or you can use <code>shift + F2</code>.
  
 
==Stopping Demo Recording For Single Player Challenge Mode==
 
==Stopping Demo Recording For Single Player Challenge Mode==

Revision as of 15:55, 14 January 2021

Demos


Overview

1280px-Source engine logo and wordmark.svg.png

Demo files are used in Portal 2 as a form of proof for runs, and a way to carefully analyze a segment of the game.

For More information on the .dem file format visit the Valve Developer Wiki

How to Record a Demo

In the developer console, type record demoname, where demoname is the name of your desired demo file.

The demo files are stored by default in your portal2 folder (SteamLibrary\steamapps\common\Portal 2\portal2)

Demo Playback

Demos can be played back in game for viewing, or for external recording with playdemo demoname where demoname is the name of the demo file you recorded to. Use stopdemo to stop demo playback. startdemos plays a sequence of demos (for example: demo, demo_1, demo_2, etc).

SAR has and improved version of the startdemos commands for demo viewing.

  • sar_startdemos
  • sar_stopdemos - Stops the demo queue.

You can use the command demoui for more options while watching demos, or you can use shift + F2.

Stopping Demo Recording For Single Player Challenge Mode

If a demo recording is not stopped in Single Player Challange Mode, the timer will become inaccurate up to .4 seconds. Meaning when you carry over demo recordings, your times in single player cm could be .4 slower than they would have otherwise been. This does not impact coop Challenge Mode.

To stop demos, simply use the stop command. This can be bound to your restart level key. bind key "stop;restart_level". The reload command will also stop demo records, and restart your level in Single Player Challenge Mode, however it is worth noting that the command will load from a save point in full game, and not work at all for coop Challenge mode.

Saving Demos to a Subfolder

You can save demos to a subfolder by naming the file with a pre-existing folder name, followed by a backslash, and the demo name.

  • NOTE: If the folder does not exist, Portal 2 will not create a folder for you and your demos will not be recorded.

(Ex: record foldername\demoname)

Easy Recording Methods

If you aren't using SAR to handle demo recording, the most common way to record demos easily in Challenge Mode is to bind it to your w key along with +forward. For example, bind w "+forward;record demo"

Challenge Mode

Challenge Mode Demo Tutorial

SAR Demo Recording Tools

SAR has many useful features for demo recording. Particularly during full game runs. These features are mention on the jerrypedia page for SAR.

Blenderiste09's fork of SAR (linked on the SAR Jerrypedia page) includes the commands

  • sar_record_at_demo_name
  • sar_record_at (default value 0)
  • sar_record_at_increment (default value 0)
Note: sar_record_at does not work for the orange bot in coop.

sar_record_at_demo_name takes a value for the name of the demo the functions will record. Example: sar_record_at_demo_name demoname.

sar_record_at has a default of 0, which will not record a demo, but any value higher is the number of ticks in game that will go by before a record starts. For example, to start on the second in-game tick: sar_record_at 2.

Note: If you pause the game with the esc key on the frame that the demo is set to record, the recording will not be processed. Preforming a console pause (pausing by opening the console with ~, the pause will not interrupt the recording.

sar_record_at_increment will add a number after your demoname (Example: demoname_2) if set to 1. This acts as version control, to avoid overriding demos you might have wanted to revisit, but does stack up new demos until the game is restarted, so if you use this feature, it's a good idea to periodically delete demos.

Demo Rendering

gaming's guide on demo rendering