Demo

From P2SR Wiki

Revision as of 15:05, 5 December 2020 by BigDaniel (talk | contribs)

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)

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