From Valve Developer Community
Revision as of 17:23, 29 August 2005 by [email protected] (talk | contribs) (Final Notes)
Jump to: navigation, search


SourceTV offers the ability to have an unlimited number of spectators watching online games based on the Source Engine. SourceTV spectators are invisible to players and can't interact with the running game in any way. The camera view in SourceTV is controlled by an auto-director AI or a human camera man. The broadcast is usually delayed by a certain amount of time. This ensures that the playing teams can't use SourceTV to get any usable information about their opponents. SourceTV can also record server-side demos that contain the whole game with all entities and events.

Providing a SourceTV broadcast for only a few spectators is an easy task and only needs a single variable change on the game server. Installing a larger SourceTV network for thousands of spectators needs more planning time and experience about required bandwidth, CPU and RAM demands.

Spectating Games

To watch a game via SourceTV, start Steam, and choose Servers from the Steam menu to open the server browser. Click to select the Spectate tab. You can narrow the list of servers by clicking Change filters and selected a specific game. After the list has been updated, double click on a server in the list you want to spectate and you'll be connected.

If game leagues announce upcoming matches to be broadcast on SourceTV, they often provide IP addresses of their SourceTV servers (IP:Port). Instead of searching them via the server list, you can instead go to the Favorites tab and add the SourceTV address to your server list by pressing the right mouse button and choosing Add server by IP address. Alternatively, you can open the Source console window and use the connect command to spectate a certain game. For example:


The default SourceTV port number is 27020, but may be changed. It should always be included in the given SourceTV IP address, since commonly this port number is different from the default game server port number 27015.

When spectating a game that is broadcast via SourceTV, the camera position and camera mode is chosen either by the auto-director or a camera man. Spectators can't switch spectator modes or players to follow as they could do HLTV, this feature was removed to reduce network bandwidth significantly. SourceTV demos still allow to switch modes and free roaming while playback.

Broadcasting Games

SourceTV is fully integrated into the Source Engine and not a separate tool like HLTV anymore. To start broadcasting a game, the game server must enable SourceTV before the map is started by setting tv_enable 1. That will create a SourceTV server instance which can be seen in-game as a bot joining the spectator team. The SourceTV server is living in the same process as the game server and is called the SourceTV master server. The SourceTV master server buffers all game data and events and broadcasts them with a certain delay to prevent cheating. The auto-director is a Mod specific module, that chooses the camera mode and position based on interesting game events (like player killed, bomb exploded etc). Additionally a human spectator can become a camera man and override the auto-director camera with his own view. SourceTV spectators then connect to the same IP address as the game server but using a different port for SourceTV, usually 27020. The port number can be changed with the tv_port console variable.


This configuration is pretty simple but only works for a small number of spectators, since a single server host is serving all player and all spectator clients. For larger number of spectators, this will quickly exceed the available CPU/bandwidth capacity on this machine. Therefore it is necessary to distribute the needed bandwidth and CPU demands over a system of multiple hosts, that can be expanded with increasing numbers of spectators. This is done by setting up other SourceTV servers that are connected to the SourceTV master server and relaying its game broadcast. These servers are called SourceTV relay proxies where each proxy can serve up to 255 spectators again. SourceTV proxies can also connect to other SourceTV proxies and build an unlimited network of relay stations.


To setup a SourceTV relay proxy, start a Source Dedicated Server process without a running a map. The tv_relay command connects the relay proxy to another SourceTV server/proxy. Here an example how to create a SourceTV relay:

srcds.exe -game cstrike -console +tv_relay

The status of your local proxy can always be checked with the tv_status command. Here and example output:

Online 05:15, FPS 75.7, Version 2350 (Win32)
Local IP, KB/sec In 2.0, Out 4.1
Local Slots 128, Spectators 1, Proxies 1
Total Slots 256, Spectators 2, Proxies 1
Master, Delay 30
Game Time 05:16, Mod "cstrike", Map "de_dust", Players 4

Total slot and spectator numbers are the accumulated numbers from all connected relay proxies. If a relay proxies loses connection to it's server, you can try to reconnect quickly with tv_retry. To stop broadcasting and disconnect all clients, execute tv_stop.

Camera Man

The camera view in SourceTV is usually controlled by the auto-director module. Also a player, who joined the spectator team on the game server can become a camera man by pressing the USE key (usually 'E'). This will turn on his view as camera view for all spectators. The camera man can choose any spectator mode (First Person, Free Roaming etc), switch to any player or move around freely. The camera can be turned off by pressing USE again and the auto-director will take over again. Camera men should have a good knowledge of the general gameplay and practice camera movement before broadcasting live. A Dead player in spectator mode can't become a camera man.

Recording Games

The SourceTV master can record games without any data loss or network delay. All events and entities are recorded and the demo file can be played back just like a normal client demo (use the demoui for playback). To start recording a demo file, SourceTV must be enabled before the map was loaded, then execute tv_record demoname. Demo recording will be stopped next time the map changes or with tv_stoprecord. To automatically record every single game you can set tv_autorecord 1. Automatically recorded demo files will be named after the map and date/time when the recording started (auto-YYYYMMDD-hhmm-map.dem). SourceTV spectators can also record the game using the normal record command, but as in normal client demos, you can't change tracked player or spectator mode during replay.

Sometimes you might use SourceTV only to record demos and not actually broadcast the game. You can disable broadcasting by setting the maximum number of client slots to zero (tv_maxclients 0). To enable auto recording on your server, add these lines in your autoexec.cfg:

tv_enable 1
tv_autorecord 1
tv_maxclients 0

Console Commands

tv_enable <0|1>

  • Activates SourceTV on local game server, SourceTV bot will appear as spectator client after next changelevel (master only).

tv_name <name>

  • Sets SourceTV name as it appears in server browser and scoreboard (master only).

tv_maxclients <0..255>

  • Sets maximum client number for local SourceTV server/proxy (default 128).


  • Stops broadcasting the game via SourceTV.


  • Shows SourceTV specific information.


  • Reconnects the SourceTV relay proxy to last known address (relay only).

tv_delay <seconds>

  • Source TV broadcast delay in seconds (master only).

tv_port <port>

  • Set the SourceTV host port (default 27020)

tv_maxrate <bytes>

  • Sets the maximum bandwidth spend per client in bytes/second (default 3500)

tv_password <password>

  • Sets required password for connecting spectators.

tv_relaypassword <password>

  • Sets required password for connecting relay proxies.

tv_record <filename>

  • Starts a SourceTV demo recording that records all entities & events (master only)


  • Stops SourceTV demo recording (master only)

tv_autorecord <0|1>

  • Automatically records every game, demo file name format is auto-YYYYMMDD-hhmm-map.dem

tv_debug <0|1>

  • Shows additional debugging messages

tv_dispatchmode <0|1|2>

  • Sets Source client dispatch mode for connecting clients: 0=never, 1=if appropriate, 2=always

tv_overrideroot <0|1>

  • Overrides the master IP broadcast to spectators with a local IP.

Command Line Parameters

These command line settings can't be changed via console or rcon. They are useful if you want to restrict SourceTV abilities for rental server.

-nohltv / -tvdisable

  • Disables all SourceTV features on this game server.


  • SourceTV can only serve one client and can't be used as relay proxy.

Final Notes

SourceTV is still under development, and the entire design is not yet implemented..