User:Ashe/Sandbox2

From Team Fortress Wiki
Jump to: navigation, search

Work in progress. Todo list
FILES:

  • Update tr_karma_event ✅
  • Change name of new tr_karma to tr_karma_2 to avoid demo compatibility issues ✅
  • Include a new link with legacy maps for compatibility ✅
  • Include direct mastercomfig vpk? ❌ probably against mastercomfig's tos
  • Update cfg for 4 and 8 bots ✅
  • Remove embedded vscript from the new maps and add them separately. ✅
  • Improve !n vscript command to support spawning every pack and maybe spells, add !clean to delete all packs ✅ not spells for now

ARTICLE

  • Save demonstration musics to google drive? ❓ risk of leaking info
  • Include mvm related demonstrations tutorial ❓ probably not necessary
  • Minor cleanup ✅
  • Move pyroland cosmetics to archive ✅

GOOGLE DRIVE LINKS ARE TEMPORARY.

Requirements

  • Being able to run TF2 at a resolution of 1920x1080 or higher (must be 16:9 ratio), at more than 60 frames per second, on high settings, with DirectX 9, and at least 4x multisample anti-aliasing (MSAA), and recording with any screen recording programs at the same time.
    • Preferably, you should use mastercomfig with at least the "High" preset with the following changes: Shadows: High, Lighting: Ultra, Model quality: Ultra, Texture quality: Ultra, Player Model: Disabled, Contracts: Disabled, Match HUD: Disabled, HUD Achievements: Disabled, Snapshot Buffer: Anim, no modifying anything in the Weapons tab.
    • In TF2's launch options, use -dxlevel 95 and -no_texture_stream (disables texture streaming).
  • Having the item you want to demonstrate. No name tag, no description tag, no craft number, no gifted item, and no Community quality. Item quality preference will be Normal > Unique > Vintage or Genuine > Other quality. Exceptions can be made for items that cannot exist in any of these qualities. If an item is more abundant or more easily obtainable in a different quality than these (e.g. Haunted quality for Halloween items), that alternate quality is also acceptable. If the item can have a decal applied, don't use a decal on it.
Pictogram comment.png Note: If you edit your game's files there must not be any way for viewers to tell that you did so (identical item level, plausible quality, same attributes, non-visibly-edited loadout screen). This guide will not provide any help on doing that.
  • Some knowledge about TF2, console commands, how to use any screen recording software, and video editing software.

Preparation

  1. Reserve the item demonstration first on the talk page! Check Talk page reservations section for how and why. If you don't have a TF Wiki account yet, you would probably want register one now at the top right corner of the page.
  2. Download necessary custom files: weaponref.zip . This can be extracted using 7zip, WinRAR, or with Windows built-in file explorer. The content of the weaponref folder go into <your team fortress 2 folder>/tf/custom.
  3. Set your game to appropriate graphic settings.
  4. Disable any custom files you may have, such as custom HUDs, custom configs, sounds, models; the included demonstration_hud folder will override custom HUDs. The only exception are mastercomfig's files (the VPK and the CFG files)
  5. Make a backup of your tf/cfg folder! Several cvars will be changed when executing the required config files (for example, the value of cl_hud_playerclass_use_playermodel, the 3D character in the HUD, will be overwritten to use the 2D character), and you may want to keep your preferences. Once you are done with recording the clips, you can delete your cfg folder and replace it with the backup.
  6. Disable the Steam overlay or go offline; quiet or quit all background applications that may interfere with the recording, specially ones that have overlays (such as Discord, Mumble or TeamSpeak) or notification sounds (such as Discord or WhatsApp).
  7. The video should be recorded on tr_karma_wiki (preferred), tr_karma_event_wiki (for Halloween-related items only), or tr_target_weaponref_hdr (legacy, still acceptable if reusing .dem replays recorded on it. Legacy link with the map: weaponref.7z). All maps are included in the download. Open the console and type: map tr_karma_wiki, map tr_karma_event_wiki, or map tr_target_weaponref_hdr.
  8. Once the map has loaded, pick the class corresponding to the item you want to demonstrate.
  9. Before doing the demonstration, use the A loadout. Make sure the only thing equipped is the item that you want to demonstrate (possible exceptions are items that are meant to be demonstrated together, for example, Jarate + Bushwacka). Leave all other item slots with the default item that comes in these slots or empty. If you are demonstrating a taunt, equip it in the first slot and leave all others spaces empty. If you are demonstrating an item set, only equip the pertinent items.
  10. Wait for the setup time to finish and verify that your new loadout has been equipped (by taunting).
  11. Open the console (default key: `) and type exec demonstration_basic. The config file will change some of your settings to meet recording standard, such as FOV, HUD settings, etc., and some server cvars.
    If you execute the tr_karma_4bots config file, four bots should spawn: A Pyro in front of you, a Soldier on the right side at mid-range, a Medic on the left side at long-range, and a Spy behind the crates on the left side (not visible by default). Re-executing the file will respawn all the bots at the correct location, in case you mess up. Pressing F makes the bots fire.
  12. Open your Loadout, click the item you want to demonstrate, and equip it again so that your avatar equips it in the loadout preview. Rotate it to show off the item.
  13. Move your mouse over the item slot and wait for the tooltip to appear.

Things to consider:

  • Always have auto-reloading disabled (cl_autoreload 0).
  • Some demonstration videos may require a split-screen. Try running the game in a window at a half-width (-w 960 -h 1080 -windowed -noborder, for 1920x1080 screens) or third-width resolution (-w 640 -h 1080 -windowed -noborder). If you use Source Recorder, you can record a demo at normal full resolution, then relaunch the game at half-width resolution and render the demo from it.
    • Some HUD elements may break with third-width resolution. If so, ask for help in the Talk page.
  • If the item you will demonstrate has a holiday restriction (e.g. Halloween / Full Moon), set tf_forced_holiday to the proper value in order to use that item. See below for a list of values. Specifically, use tf_forced_holiday 8 (Full Moon) for Halloween-restricted items.

Post-processing

  • You may not modify the contrast, speed, size, etc. of the video.
  • Add one of the training_vid_*.mp3 files extracted from .../steam/steamapps/common/Team Fortress 2/tf/tf2_sound_misc_dir.vpk → sound → misc. If necessary, adjust the relative volumes between music and in-game sounds to match the ratio of the reference video. The default volume should be okay though. You can also use this set of pre-lengthened music files (MediaFire mirror) by Karmacharger.
  • Edit your video so it's just like the video already on the channel. Add fade out effects to the end of the video, at the start of the video, and before and after every scene transition.
  • Export/Convert your video to a web-friendly format: It is recommended that you use HEVC/h265 compression. Only 60 FPS videos are accepted (FPS are capped to 60 in YouTube).

Useful information

Below is a list of console commands that might help when demonstrating more complex behaviors. Most of these work only when sv_cheats has been set to 1.

Map chat commands

As of March 2024, tr_karma includes vscripts that can be used via the chat typing the following commands. Remember that the chat is hidden if you executed demonstration_basic.cfg and can only be seen if you open it.

  • !demo - Enables the same server settings for demonstration from the demonstratin_basic.cfg file
  • !c - Toggles a critical boost on the user.
  • !n - Toggles noclip on the user.
  • !p - Spawns a certain ammo or health pack at the player's crosshair. Usage: !p <<PACK>>. PACK can be: al: ammo large, am: ammo medium, as: ammo small, hl: health large, hm: health medium, hs: health small, clear: delete all packs.
  • !r - Regenerates the player (gives health and ammo).
  • !clear - Deletes ragdolls and weapons on ground.

You can bind a key to one of the commands as follows: bind "kp_end" "say !c".

General console commands

  • bind <key> <command> - Binds a key to a command. Use this to use one of the below commands without opening the console window (for final take) if you don't want to edit it out.
  • impulse 101 - Restores the player's health and ammo.
  • hurtme <number> - Deals the stated amount of damage to the player. Can be used with a negative number to heal or overheal yourself.
  • getpos - Displays the current position and rotation (aiming angle) of the player in x, y, and z coordinates.
  • setpos <x y z> - Teleports the player to a given position. Use the numbers acquired from getpos to place yourself into that same exact position.
  • setang <x y z> - Sets the view angle of the player, akin to setpos. Use with the numbers from getpos to make your crosshair point the exact same way. The <z> parameter should be left at 0, or else the camera will appear to be tilting onto its side.
  • ent_create <entity name> - Spawns a health kit or ammo box at the player's crosshair when used with entity names item_ammopack_small, item_ammopack_medium, item_ammopack_full, item_healthkit_small, item_healthkit_medium, or item_healthkit_full.
If in tr_karma, you can use the !p chat command instead. If not, you can use this script, which binds the spawning of health kits and ammo boxes to Numpad keys.
  • mp_restartgame 1 - Restarts the map without rebooting the server, as opposed to the map command. You can use it with the name of the current map to reload the map, cleaning it of bodies, excess blood, and bullet marks.
  • r_cleardecals - Clears all decals (blood and bullet holes) from the map.
  • cl_jiggle_bone_framerate_cutoff - the minimum framerate at which the item's jigglebones still work. It is set to 20 FPS by default, lower it to the desired value if you're rendering at low FPS.
  • ent_fire team_round_timer addtime <number> - Adds time to the timer of the round. Can be used with a negative number to remove time instead.
  • cl_yawspeed <value> - Adjusts left/right turning (yaw) speed. Value should be changed to match the duration of a taunt (if infinite, simply set to a value that feels right). Use in combination with a +right and +left keybind to smoothly rotate the camera around your class.
  • tf_use_match_hud 0 - Disables the team information HUD on the top of the screen.
  • hud_reloadscheme - Refreshes the TF2 HUD.
  • tf_forced_holiday <0-11> - Forces holiday mode (0: default; 1: TFBirthday; 2: Halloween; 3: Christmas; 8: FullMoon)

Bot scripting commands

  • bot -team XX -class XX -name XX - Adds a puppet bot with the specified parameters. For the sake of consistency, the bots' names must correspond with their classes, with a prefix "Friendly" if it is on the BLU team, and have a single-digit postfix if there is more than one bot of the same class on the given team. This command is not to be confused with addbot, which adds an AI-controlled bot instead of a puppet bot.
Example: bot -team blu -class medic -name "Friendly Medic"; bot -team red -class heavy -name "Heavy 1"; bot -team red -class heavy name "Heavy 2"
  • bot_command <bot name> <console command> - Makes the specified bot perform the specified command. Particularly useful for making engineer bots enter build mode.
Example: bot_command "Friendly Engineer" build <number from 0 to 3> (0 for the Dispenser, 1 for the Teleporter Entrance, 2 for the Sentry, and 3 for the Teleport Exit)
  • bot_mimic <0 or 1> - Makes all the bots mimic the player's actions.
Example: In order to make a Spy disguise, you need to perform the keystrokes for disguising while playing as a Spy and having the mimic option enabled. Similarly, the only way to make Engineer bots rotate buildings is to press Mouse2 with the mimic option on. Note that Engineer bots will not mimic you creating buildings as an Engineer, you must use bot_command <bot name> build <number> instead.
  • bot_mimic_yaw_offset <angle from 0 to 360> - Makes the bots face in a direction this angle from the player while the bot_mimic is active. By default it is set to 180 so each bot faces the player when stared at.
  • bot_dontmove <0 or 1> - Allows or prevents all bots from moving. Takes priority over bot_mimic.
  • bot_refill - Restores ammo and health for all bots.
  • bot_teleport <name> <x y z x1 y1 z1> - Teleports the specified bot to the given coordinates. X, y and z define the position and x1, y1 and z1 define where the bot aims its weapon. The needed numbers can be acquired by placing yourself on the bot's desired future position and using the getpos command.
  • cc_bot_selectweapon <name> <slot> - Forces a bot to switch to a specified weapon slot.
Example: cc_bot_selectweapon heavy 2 will make a bot named "Heavy" switch to his Fists.
  • bot_forcefireweapon <weapon name> - Makes all the bots fire the specified weapon if they possess it. This can be used to make only one bot fire its weapon instead of all the bots when using the bot_forceattack command. If the weapon name is invalid, all bots will stop firing. Scout and Engineer pistols are regarded as different weapons, and so are Soldier, Pyro, Heavy, and Engineer shotguns. See this page for a full list of valid weapon names.
Example:
alias "+rocket" "bot_forcefireweapon tf_weapon_rocketlauncher";
alias "-rocket" "bot_forcefireweapon randomword";
alias "+flame" "bot_forcefireweapon tf_weapon_flamethrower";
alias "-flame" "bot_forcefireweapon herpderp";
bind f +flame;
bind t +rocket
Pictogram comment.png Note: Bots cannot equip non-stock weapons or items. If you need an enemy character to use an unlockable weapon, you'll need a second human player to play as that character. Feel free to ask for cooperation on the discussion page.
  • bot_forceattack <0 or 1> - Make all bots perform their primary attack (+attack)
  • bot_forceattack2 <0 or 1> - Make all bots perform their secondary attack (+attack2)
Whilst the above two commands may not seem as immediately useful as bot_forecefireweapon, they are best suited to making a bot perform their secondary fire for a weapon. For example, using the following code, you can make Sniper bots scope-in or Spy bots engage their cloak:
alias +cloak "bot_forceattack 1; bot_forceattack2 1"
alias -cloak "bot_forceattack 0; bot_forceattack2 0"
bind key +cloak

Pictogram comment.png Note: You cannot alias or bind a bot action to a key if the bot's name has spaces in it. This can be avoided by creating a config file containing the desired commands and binding the execution of said file to a key.

Example:
bind p "bot_teleport Friendly Spy x y z x1 y1 z1" - Wrong.
bind p "exec action.cfg" while the file action.cfg contains bot_teleport "Friendly Spy" x y z x1 y1 z1 - Correct.

List of screen recording programs

These programs have been successfully used to create demonstrations videos in the past.

  • Source Recorder is part of TF2, and should be used for in-game footage when doing so has no visible side-effects.
    • Although not required, SrcDemo² can be used with it to make it less painful to record smooth high-framerate footage.
  • Open Broadcaster Software. Remember to adjust the video quality settings in Output -> Recording -> Recording Quality = High Quality (refrain to use higher values, as it will increase file sizes unnecessarily) and in Video.
  • Fraps (full version only, require purchase)
  • ShadowPlay from Nvidia's Geforce Experience (Nvidia graphics card required)
  • Xbox Game Bar (Windows 10 built-in)