User:Yakumo koishi/Gameinfo Chinese

From Valve Developer Community
Jump to: navigation, search
English Deutsch Español Français Polski Русский 日本語 简体中文 한국어
For Half-Life 1/GoldSrc, see liblist.gam.

GameInfo.txt is a KeyValues config file that describes a Source mod. Apart from containing metadata like the name of the mod or a link to the developer's website, it also defines which games it depends on and the SearchPaths that the engine uses to look up resources. It is stored in the mod's root folder. Source, the SDK tools and Steam rely on it.

Warning.png 警告: 金源游戏没有gameinfo.txt,使用Hammer 3.4版修改半条命地图
Note.png Note: 布尔值表示为0或1。
Note.png Note: 如果一个数值含有空格或者制表,请使用 "引号"进行标注。

Basic settings


Keys that affect the menu and window title.

Game <string>
The name of the mod in ASCII. Displayed in Steam and used as the window title. Only displayed in the main menu if Title isn't specified.
Title <string>
A Unicode string displayed in the main menu of your mod. You can also new line the menu text by adding another key of the same name Title, but append either 2 or a higher number onto it.
Note.png Note: The higher the number, the further down the text will be.
GameLogo <boolean> (in all games since Half-Life 2: Episode TwoHalf-Life 2: Episode Two)
Rather than displaying the Title text on the main menu, display the content in resource\GameLogo.res. See Adding Your Logo to the Menu.


Keys that affect what tabs and options that show up in the Options panel. Also see Customizing Options: Keyboard.

Type <string>
NoDifficulty <boolean>
HasPortals <boolean> (存在于自 Half-Life 2: Episode TwoHalf-Life 2: Episode Two)
NoCrosshair <boolean>
AdvCrosshair <boolean>
启用特殊的高级准星设置。去做: 如何使用?
NoModels <boolean>
NoHIModel <boolean>
隐藏在金源中使用的cl_himodels 切换复选框。只有在cl_himodels首先存在的情况下才会正常显示
Hidden_Maps <subkey>
子键值中的地图名不会出现在“创建服务器”界面中。不过这并不阻止玩家通过控制台读取地图。语法为地图名 1,每行一个条目。不需要包括扩展名,请记住使用 { 和 } 开始和结束子键值。
CommandLine <subkey> (存在于 <Mapbase>)
mod的启动参数列表。语法为-launchoption "value",每行一个参数。请记住使用 { 和 } 开始和结束子键值。

Steam games list

Keys that affect how your game or mod shows up in the Steam Library page.

Developer <string> <Obsolete>
Deprecated. The developer of the mod. Usually either the Mod Team's name, or a single person's name. Doesn't work on current Steam version.
Developer_URL <string> <Obsolete>
Deprecated. Your or the mod's URL. Must start with http://. Doesn't work on current Steam version.
Manual <string> <Obsolete>
Deprecated. URL to the mod's manual; can also be a local file. Doesn't work on current Steam version.
Icon <string>
Local path relative to GameInfo.txt, to an uncompressed 16x16 TGA that will appear as your mod's icon in Steam. Do not include the file extension. The larger 32px pixel icon that appears in Steam's Detail View should be placed next to the 16px one and called <icon>_big.tga.
Note.png Note: For transparency to work, the TGA must be saved in 32-bit mode with active alpha channel.

Engine and tools

Keys that affect how the engine/tools runs and some options for the tools themselves.

Nodegraph <boolean> (in all games since Half-Life 2: Episode TwoHalf-Life 2: Episode Two)
Whether or not to enable building nodegraphs (.ain files) for maps.
GameData <string>
Path to a FGD file, relative to Hammer's location. This is needed for instances to be compiled into maps. It is not used by Hammer itself.
InstancePath <string> (in all games since Source 2013Source 2013)
The default location in which to look for Instance VMFs.
SupportsDX8 <boolean> (in all games since Left 4 Dead)
When false, prevents the game from being ran in older DirectX Versions such as DX8 and below, since they do not support the full range of graphic effects, also prevents Studiomdl from producing .sw.vtx and .dx80.vtx files for models, as they aren't needed.
SupportsVR <boolean> (in all games since Source 2013Source 2013)
Whether or not the game supports being ran in VR mode.
SupportsXBox360 <boolean> (in all games since Left 4 Dead)
Whether or not the game supports Xbox 360.
Confirm:Does this enable being able to use a Xbox 360 controller with the game?


Keys that are within the subkey FileSystem.

SteamAppID <integer>
The AppID of the game the mod is to be based on. The mod will have access to all of this game's content, and will not be playable unless it is installed, the mod will also be ran with the game's executable as well. If you're uploading your Source game to Steam, this will be your game's AppID. Otherwise, this will be 243750 for <Source><Source><Source> Source 2013 Multiplayer , 243730 for Source 2013Source 2013 Source 2013 Singleplayer , 630 for Alien Swarm Alien Swarm , or the AppID of the game you're basing it off of if you're not working with source code.
Note.png Note: Most older Source mods will use AppID 215 for Source 2006 and 218 for Source 2007. If your making a new mod, you shouldn't use these IDs as they're for a obviously deprecated Source engine branch that was replaced by Source 2013 and Alien Swarm. Only use them for legacy support.
Note.png Note: Your mod won't be protected by VAC if it is based on a singleplayer game.
AdditionalContentId <integer> <Obsolete>
Deprecated. Another AppID that the mod has access to. This feature was added to the SDK source code but somehow never made it to Valve's other games; you will have to build your own binaries to use it. If you need to mount multiple apps using this, make these changes.
Bug.png Bug: The engine understands this command, but the SDK tools unfortunately do not. The best solution, currently, is to copy the content of the game to a location on your hard drive and add an absolute SearchPath to it. Remember to delete the SearchPath before you release.
ToolsAppId <integer> <Obsolete>
Deprecated. This is the AppID of the SDK currently in use.


SearchPaths is a subkey within FileSystem. It contains a key for every search path. When the engine needs a file it traverses the search paths, stopping when the desired file has been found, hence the order of the search paths is important.

Note.png Note: A thing to keep in mind, is the order that you put the search paths in is important, if there are 2 files of the same name that are in 2 different search paths, and you list them both, the search path at the top will win, and use that file.


The directory, which is the value of the key, will either be relative to the SteamAppID's root directory (i.e. where the executable of the game is located), relative to GameInfo.txt or absolute. A example of each one respectively would be this:

Game       |All_Source_Engine_Paths|HL2 // Go to the executable directory, and mount a folder called HL2 in it.
Game       |GameInfo_Path|. // Go to the directory of where GameInfo.txt is located, and mount the folder it's in.
Game       "C:\MyFolderOfContent\content" // Mount this absolute directory, useful for mounting content temporarily.
Note.png Note: In order to mount a VPK file, you need to add the VPK's name at the end of the directory with the .vpk extension. If the VPK is a multi-chunck VPK, then put the name of the VPK in without the "_dir" or "_###" at the end.

The 2 variables above will start the search in a certain directory, |All_Source_Engine_Paths| will start the directory within the root folder, and |GameInfo_Path| will start it in the folder where GameInfo.txt is located. Both of these variables can be appended with any number of folders. There are also some special commands you can append in addition to the folders and variables, the known ones are:

  • ../
    Goes back one folder, this will useful for mounting other games' content like Portal, since AdditionalContentID is deprecated. If you wanted to mount Portal, and your game is in, say for example "<SteamFolder>\SteamApps\Common\MyGame\FolderWhereGameInfoIs", you would create a search path like this to mount it's content:
// Start in the executable directory, then go back one folder so we're in Common, and then go into Portal/portal and mount portal_pak.vpk
Game       |All_Source_Engine_Paths|../Portal/portal/portal_pak.vpk 

Here is also an example of how to mount a SourceMod:

// Start in the executable directory, then go back two folders so we're in SteamApps, and then go into SourceMods and mount the MySourceMod folder.
Game       |All_Source_Engine_Paths|../../SourceMods/MySourceMod

  • .
    This stops the search in the current directory, this should only be used if you want to directly mount where |All_Source_Engine_Paths| or |GameInfo_Path| are. An example of both:
// Mount both |All_Source_Engine_Paths| and |GameInfo_Path| variables' path.
Game       |All_Source_Engine_Paths|.
Game       |GameInfo_Path|.

  • /*
    Mount every sub-folder and VPK in the current directory, this command is what makes the custom folder work in most update to date Source games. An example of it's use:
// Mount the custom folder's sub-folders and VPKs.
Game       |GameInfo_Path|custom/*


In most older Source games, the only keys for search pathing is Game and Platform, while these keys will suit most search pathing, in Source 2013 a few new keys where introduced that add more control.

Tip.png Tip: Insurgency and Day of Infamy use the same search pathing system as Source 2013, so commands and keys that work in Source 2013 will work for them as well!

The current keys known so far are:

  • Game
    Adds the path as a simple search path. Will add any content it finds. Also writes sound.cache file in each Game directory.
  • Game_Write (in all games since Source 2013Source 2013)
    Marks the search path as a Game write path. It marks the directory as the default directory for writing (what exactly?) for this game.
    Confirm:Does this do anything?
  • GameBin (in all games since Source 2013Source 2013)
    A special key that requires that the path lead to a game's binary files (where Server.dll and Client.dll are located), and will use any other DLL files it finds. This should lead to your own mod's Bin folder, or the game you're basing it off's Bin folder if you're not building your own DLLs.
  • Platform
    Adds a special search path to the folder containing core engine files, this will usually lead to the game's Platform folder.
  • Mod (in all games since Source 2013Source 2013)
    Marks the search path as a Mod path. This is usually where the game executable is. Essential for displaying chapter list in New Game menu, and probably for something else.
  • Mod_Write (in all games since Source 2013Source 2013)
    Marks the search path as a Mod write path. This is usually where GameInfo.txt is. It marks the directory as the default directory for writing save files and downloadlists for this mod.
  • Default_Write_Path
    Marks the search path as a Default write path. This is usually where GameInfo.txt is. It marks the directory as the default directory for writing config.cfg, node graphs, screenshots and some other files for this mod. Also a fallback for when either Mod_Write or Game_Write isn't specified.
  • VPK (in all games since Contagion)
    Used to mount a VPK by name. Do not put .vpk at the end.

In Source 2013, you may also append keys to each other by separating each key name by a + sign, this way if you need to use one directory for multiple keys, instead of writing this:

Game      |GameInfo_Path|MyFolder
Mod       |GameInfo_Path|MyFolder

It can instead be shortened like this:

Game+Mod  |GameInfo_Path|MyFolder

This saves you time from having to retype the directory over again.

Automatic localization

Source automatically creates localized search paths. If you mount the folder HL2, then when your mod runs in French HL2_French is automatically mounted just above it, overriding any content in HL2. To do: Does this also apply for the mod folder?


A full working GameInfo.txt ready for a Source 2013Source 2013 Source 2013 game.

	game 		"HALF-LIFE 2"
	title 		"HALF-LIFE'"
	type		singleplayer_only
	supportsvr	1

		SteamAppId				220		// This will mount all the GCFs we need (240=CS:S, 220=HL2).
		// The code that loads this file automatically does a few things here:
		// 1. For each "Game" search path, it adds a "GameBin" path, in <dir>\bin
		// 2. For each "Game" search path, it adds another "Game" path in front of it with _<langage> at the end.
		//    For example: c:\hl2\cstrike on a french machine would get a c:\hl2\cstrike_french path added to it.
		// 3. For the first "Game" search path, it adds a search path called "MOD".
		// 4. For the first "Game" search path, it adds a search path called "DEFAULT_WRITE_PATH".

		// Search paths are relative to the base directory, which is where hl2.exe is found.
		// |gameinfo_path| points at the directory where gameinfo.txt is.
		// We always want to mount that directory relative to gameinfo.txt, so
		// people can mount stuff in c:\mymod, and the main game resources are in
		// someplace like c:\program files\valve\steam\steamapps\half-life 2.
			// First, mount all user customizations.  This will search for VPKs and subfolders
			// and mount them in alphabetical order.  The easiest way to distribute a mod is to
			// pack up the custom content into a VPK.  To "install" a mod, just drop it in this
			// folder.
			// Note that this folder is scanned only when the game is booted.
			game+mod			hl2/custom/*

			// We search VPK files before ordinary folders, because most files will be found in
			// VPK and we can avoid making thousands of file system calls to attempt to open files
			// in folders where they don't exist.  (Searching a VPK is much faster than making an operating
			// system call.)
			game_lv				hl2/hl2_lv.vpk
			game+mod			hl2/hl2_sound_vo_english.vpk
			game+mod			hl2/hl2_pak.vpk
			game				|all_source_engine_paths|hl2/hl2_textures.vpk
			game				|all_source_engine_paths|hl2/hl2_sound_misc.vpk
			game				|all_source_engine_paths|hl2/hl2_misc.vpk
			platform			|all_source_engine_paths|platform/platform_misc.vpk

			// Now search loose files.  We'll set the directory containing the gameinfo.txt file
			// as the first "mod" search path (after any user customizations).  This is also the one
			// that's used when writing to the "mod" path.
			mod+mod_write+default_write_path		|gameinfo_path|.

			// Add the HL2 directory as a game search path.  This is also where where writes
			// to the "game" path go.
			game+game_write		hl2

			// Where the game's binaries are
			gamebin				hl2/bin

			// Last, mount in shared HL2 loose files
			game				|all_source_engine_paths|hl2
			platform			|all_source_engine_paths|platform

Editing the game info with XBLAH's Modding Tool

The mod information can be edited with XBLAH's Modding Tool through a comprehensive UI without requiring the modder to mess with text files. It includes all the major keys of Source SDK 2013 Single-player and Source SDK 2013 Multi-player, more than enough for the majority of Source modders.

This can be accessed within the tool through Modding > Game info.

External links