String Table Dictionary: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (clean up, added orphan tag)
(More info)
Line 6: Line 6:
__NOTOC__
__NOTOC__


String tables are used to lower network bandwidth for multiplayer games. It's created automatically when the map is first loaded.  
String tables are a collection of internal game strings used to lower network bandwidth for multiplayer games, embedded into the [[BSP (Source)|BSP]] as a .dct file. It is prompted to be made automatically when a map is first loaded.
{{important|It is saved into the map file after you leave the map.}}
{{important|It is saved into the BSP map file after you leave the map, but will be cleared upon recompiling.}}
{{warning|String table cannot be generated if the map is already packed in vpk}}
{{warning|String tables cannot be generated if the map is already packed in a [[VPK]].}}
{{note|This page was created considering only {{l4d2}}'s existence}}
{{note|This page was created considering only {{l4d2}}'s existence.}}


== Making sure string table is created ==
== Making sure string table is created ==
# Load a map that is not packed in vpk
# Load a map that is not packed in a VPK.
# Use stringtabledictionary command
# Run the '''stringtabledictionary''' command in case the automatic string table building from launching the map fails.
# Leave the map
# Leave the map.
# Check the map file last modified timestamp
# Check the BSP map file's last modified timestamp or open it with [[GCFScape]] or a similar package-viewing tool to check for the existence of '''stringtable_dictionary.dct'''.
 
{{bug|Having the BSP file in an alternate directory loaded from gameinfo will cause the BSP to be duplicated into the ''<exe name>/maps'' folder when the game tries to embed the string tables into the BSP. This copy will contain the new string tables while the other will not.}}


== Example ==
== Example ==
To get the general idea what they are for let's say we have string table.
As a general idea of their purpose, here we have a string table structured as shown.
{| class="wikitable"
{| class="wikitable"
|-
|-
Line 32: Line 34:
|}
|}


In a case string Rochelle is used what needs to be sent over the network is just the index of this string (3). This is a reason why all connected players need to have identical string table that their game looks into.
Whenever a Rochelle string is used, what is sent over the network is the index of this string (3). Embedded into the BSP file, all connected players should have an identical string table that their game looks into. Mismatches will cause players to disconnect with a failure message stating that their string table differs from the server's.


== ConVars ==
== ConVars ==

Revision as of 08:14, 10 December 2024

Wikipedia - Letter.png
This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages)
Broom icon.png
This article or section needs to be cleaned up to conform to a higher standard of quality.
For help, see the VDC Editing Help and Wikipedia cleanup process. Also, remember to check for any notes left by the tagger at this article's talk page.


String tables are a collection of internal game strings used to lower network bandwidth for multiplayer games, embedded into the BSP as a .dct file. It is prompted to be made automatically when a map is first loaded.

Icon-Important.pngImportant:It is saved into the BSP map file after you leave the map, but will be cleared upon recompiling.
Warning.pngWarning:String tables cannot be generated if the map is already packed in a VPK.
Note.pngNote:This page was created considering only Left 4 Dead 2's existence.

Making sure string table is created

  1. Load a map that is not packed in a VPK.
  2. Run the stringtabledictionary command in case the automatic string table building from launching the map fails.
  3. Leave the map.
  4. Check the BSP map file's last modified timestamp or open it with GCFScape or a similar package-viewing tool to check for the existence of stringtable_dictionary.dct.
Icon-Bug.pngBug:Having the BSP file in an alternate directory loaded from gameinfo will cause the BSP to be duplicated into the <exe name>/maps folder when the game tries to embed the string tables into the BSP. This copy will contain the new string tables while the other will not.  [todo tested in ?]

Example

As a general idea of their purpose, here we have a string table structured as shown.

Index String
0 Nick
1 Ellis
2 Coach
3 Rochelle

Whenever a Rochelle string is used, what is sent over the network is the index of this string (3). Embedded into the BSP file, all connected players should have an identical string table that their game looks into. Mismatches will cause players to disconnect with a failure message stating that their string table differs from the server's.

ConVars

Cvar/Command Parameters or default value Descriptor Effect
sv_dumpstringtables 0 bool Dump info about string tables when loading a map
stringtable_alwaysrebuilddictionaries 0 bool Rebuild dictionary file on every level load
stringtable_usedictionaries 1 bool Use dictionaries for string table networking

ConCommands

Cvar/Command Parameters or default value Descriptor Effect
dumpgamestringtable Dump the contents of the game string table to the console.
dumpstringtables Print string tables to console.
stringtabledictionary Create dictionary for current strings.

Tables

Table Name Max size
downloadables 8192
modelprecache 2048
genericprecache 512
soundprecache 20000
decalprecache 512
instancebaseline 1024
lightstyles 64
userinfo 32
server_query_info 4
ParticleEffectNames 1024
EffectDispatch 1024
VguiScreen 256
Materials 1024
InfoPanel 128
Scenes 16384
MeleeWeapons 16
GameRulesCreation 1


Stub

This article or section is a stub. You can help by expanding it.