Mapbase makes several unique changes to the Developer Commentary System, although most of them rely on manually editing commentary files (maps/%mapname%_commentary.txt) instead of using the Commentary Editor since the editor tool is not available in the SDK code.


New node UI

Normally, when subtitles are disabled, developer commentary displays a unique HUD element showing the current speaker, a progress bar for the audio file, and which commentary node it is relative to others in the level. All of this information is hidden when subtitles are enabled.

In order to convey this information during commentary without sacrificing subtitles, Mapbase overhauls the UI to display both the commentary UI and subtitles at the same time. The commentary UI becomes as wide as the subtitles box and is re-positioned to where the subtitles box normally is, moving the subtitles box itself to be directly above it.

This behavior can be toggled using the commentary_audio_element_below_cc cvar.

Original commentary bar
Original commentary subtitles
Mapbase's new combination

In addition to this, Mapbase also restores an unused keyvalue (printname) and adds a new keyvalue (footnote) which display additional information on the HUD element.

printname is displayed alongside any specified speaker(s) with a ‘~’ to separate them. footnote is displayed as a set of automatically bulleted footnotes below the progress bar.

The printname combination behavior can be toggled using the commentary_combine_speaker_and_printname cvar.

📄 Note: Multiple footnote bullets requires newline characters (\n). This is currently only possible through localization tokens.

New node types

Mapbase includes 3 new types of commentary nodes which behave differently when the player interacts with them. While the default commentary nodes play audio files, the new nodes can display text, display images, or play VCD files respectively. They serve as new mediums for providing commentary and allow different types of information to be conveyed to the player.

The type of node is set using a new type keyvalue, with 0 as the default audio node. Models are selected automatically, although they can still be overridden with the model keyvalue. The new models can be found in models/extras, just like the original commentary node model.

This includes the following new node types:

Text Node (type 1)

A Text Node displays a body of text. Text nodes can be used to replace voiced commentary, show text from outside sources, etc.

Within a commentary file, Text Nodes can be defined like this:

	// Text Node
	"entity"
	{
		"classname" "point_commentary_node"
		"targetname" "test_node_2"
		"model" "models/extras/info_text.mdl"
		"origin" "-836 -160 64"
		"angles" "0 0 0"
		"precommands" ""
		"postcommands" ""
		"commentaryfile" "#DevCommentaryText_Explanation"
		"viewtarget" ""
		"viewposition" ""
		"prevent_movement" 0
		"type" "1"
		"panelscale" "1.0"
		"x" "-1"
		"y" "-1"
		"speakers" "Blixibon"
		"printname" "Text Commentary Nodes (moddb.com/mods/mapbase; Jul 16, 2021)"
		"footnote" "This is a commentary node which displays text."
	}

Image Node (type 2)

An Image Node displays an image. Image nodes can be used to show screenshots, concept art, etc.

Within a commentary file, Image Nodes can be defined like this:

	// Image Node
	"entity"
	{
		"classname" "point_commentary_node"
		"targetname" "test_node_3"
		"model" "models/extras/info_image.mdl"
		//"origin" "-836 192 64"
		"origin" "-836 -96 64"
		"angles" "0 0 0"
		"precommands" ""
		"postcommands" ""
		"commentaryfile" "mapbase_commentary_test.vmt" // Relative to materials/vgui
		"viewtarget" ""
		"viewposition" ""
		"prevent_movement" 0
		"type" "2"
		"panelscale" "1.25"
		"x" "-1"
		"y" "-1"
		"speakers" "Mapbase"
		"printname" "Image Commentary Node"
		"footnote" "This is a commentary node which displays an image."
	}

Scene Node (type 3)

A Scene Node plays a VCD (scene) file. Scene nodes can be used to split up commentary, play unused dialogue, etc.

Within a commentary file, Scene Nodes can be defined like this:

	// Scene Node
	"entity"
	{
		"classname" "point_commentary_node"
		"targetname" "test_node_4"
		"model" "models/extras/info_scene.mdl"
		"origin" "-836 -32 64"
		"angles" "0 0 0"
		"precommands" ""
		"postcommands" ""
		"commentaryfile" "scenes/eli_lab/labtalk01"
		"viewtarget" ""
		"viewposition" ""
		"prevent_movement" 0
		"type" "3"
		"panelscale" "1.25"
		"x" "-1"
		"y" "-1"
		"speakers" "Mapbase"
		"printname" "Scene Commentary Node"
		"footnote" "This is a commentary node which plays a VCD file."
	}

The images below show Text and Image Nodes in-game. Click on an image to expand it.

New I/KV

point_commentary_node now has additional inputs and keyvalues, including the ones mentioned above. This includes the following:

KeyValues

- View Target Speed (viewtarget_speed) <float>
The speed in which the camera will follow the view target.
- View Position Speed (viewposition_speed) <float>
The speed in which the camera will go to the view position.
- View Position Speed (return_speed) <float>
The speed in which the camera will return to the player once the commentary is over.
- Print Name (printname) <string>
Title of the commentary, which displays in the new UI.
- Footnote(s) (footnote) <string>
Notes that appear at the bottom of the new UI. Bullets are separated by newlines, which require localization tokens.
- Type (type) <integer>
Type of commentary node. See above for specific values.
- Panel Scale (panelscale) <float>
How much to scale the commentary UI's size when active. Only valid for text and image nodes.
- X (x) <float>
The node UI's X position as a 0-1 ratio from left-to-right with -1 for the center, similar to game_text. Only valid for text and image nodes.
- Y (y) <float>
The node UI's Y position as a 0-1 ratio from top-to-bottom with -1 for the center, similar to game_text. Only valid for text and image nodes.

Inputs

- SetViewTarget <target_destination>
Sets the target the camera should follow when the node is active.
- SetViewTargetSpeed <float>
Sets the speed in which the node should follow the view target.
- SetViewPosition <target_destination>
Sets the target the camera should go to when the node is active.
- SetViewPositionSpeed <float>
Sets the speed in which the node should go to the view position.
- SetReturnSpeed <float>
Sets the speed in which the node will return to the player once the commentary is over.

VScript access

VScript access to commentary nodes has been expanded on the server as well as the client, with both ends able to modify most variables (including what audio file plays/what content displays) and add on to the behavior of a node using a new PreStartCommentary hook. This hook can be used to make the commentary change based on a specific condition, like how much health the player has or whether or not the player did something earlier in the map.

For more information, see CPointCommentaryNode in List of Script Functions.