Gameinfo.txt: Difference between revisions
TomEdwards (talk | contribs) m (The GameInfo.txt File Structure moved to Gameinfo.txt over redirect: shorter name) |
TomEdwards (talk | contribs) (otherlang2; first half reformatted) |
||
Line 1: | Line 1: | ||
The | {{otherlang2|ru=The GameInfo.txt File Structure:ru|pl=The GameInfo.txt File Structure:pl|jp=The GameInfo.txt File Structure:jp|es=The GameInfo.txt File Structure:es}} | ||
:''For Half-Life 1 (i.e. [[GoldSrc]]), see [[The liblist.gam File Structure|liblist.gam]].'' | |||
{{toc-right}} | |||
'''<code>GameInfo.txt</code>''' describes your mod. It contains metadata like its name, a link to your website and a manual, and defines which games it needs to run. It is also the marker that Steam, Source and the SDK tools use to detect the location of your project. | |||
The SDK launcher generates a gameinfo.txt when you run the Create a Mod Wizard. This will work fine for development, but before release you will want to edit it and add new data. | |||
{{note|[[Boolean]] values are represented as [[integer]]s.}} | |||
{{warning|If a value has any spaces or tabs in it, wrap it in "quote marks".}} | |||
== UI settings == | == UI settings == | ||
=== Name === | |||
;<code>game <[[string]]></code> | |||
: The name of your mod. Displayed in Steam, on the Windows task bar, but ''not'' on the main menu (unless you don't define a <code>title</code>). | |||
; <code>title <string></code> | |||
; <code>title2 <string></code> | |||
: These are the strings displayed in the main menu of your mod. They might be different from the strings displayed in Steam and on the desktop if you are using a fancy font. | |||
: <code>title2</code> (and 3, 4, etc.) are to enable you to apply different styles to different parts of your title. {{note|It's likely your title won't display right until you edit ClientTitleFont in <code>resource/clientscheme.res</code> to change its font. [[Half-Life 2]] uses a specially-made font ("HalfLife2") that only has a specific set of characters; it won't display most text properly.}} | |||
; <code>gamelogo <[[boolean]]></code> | |||
: Rather than displaying the <code>title</code>/<code>title2</code> text, display the content in <code>resource/GameLogo.res</code>. This was used for all three of the games in the [[Orange Box]]. | |||
=== Options === | |||
; <code>type <singleplayer_only | multiplayer_only></code> | |||
: Affects which tabs appear in which order the Options panel. May also affect Steam's download speed. Omit if your mod has both SP and MP modes. | |||
; <code>nodifficulty <boolean></code> | |||
: Hides the difficulty tab | |||
; <code>hasportals <boolean></code> | |||
: Shows the Portal options tab | |||
; <code>nocrosshair <boolean></code> | |||
: Hides the multiplayer crosshair selection menu | |||
; <code>nomodels <boolean></code> | |||
: Hides the multiplayer model selection menu | |||
; <code>nohimodel <boolean></code> | |||
: Hides toggle checkbox for <code>cl_himodels</code>. Only displayed properly if <code>cl_himodels</code> exists in the first place! | |||
=== Steam Games list === | |||
; <code>developer <[[string]]></code> | |||
: Your team's name (or just yours!) | |||
; <code>developer_url <string></code> | |||
: Your or the mod's website. Must start with <code><nowiki>http://</nowiki></code>. | |||
; <code>manual <string></code> | |||
: URL to the mod's manual; can be local. | |||
; <code>icon <string></code> | |||
: 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. For transparency to work, the TGA must be saved in 32-bit mode with active alpha channel. | |||
=== Miscellaneous === | |||
; <code>hidden_maps <subkey></code> | |||
: Maps in the subkey do not appear in the "create server" dialogue (but can still be loaded from the console). | |||
: Syntax is <code>mapname 1</code>, with one entry per line. Don't include <code>.bsp</code>. Remember to open and close the subkey with { and }. | |||
; <code>nodegraph <[[boolean]]></code> | |||
: Prevents the engine from creating [[nodegraph]]s for NPCs. | |||
== Mounted content and required games == | |||
== SteamAppId == | == SteamAppId == | ||
Line 152: | Line 150: | ||
[[Category:Modding]] | [[Category:Modding]] | ||
[[Category:Source SDK FAQ]] | [[Category:Source SDK FAQ]] | ||
Revision as of 13:31, 15 July 2009
- For Half-Life 1 (i.e. GoldSrc), see liblist.gam.
GameInfo.txt
describes your mod. It contains metadata like its name, a link to your website and a manual, and defines which games it needs to run. It is also the marker that Steam, Source and the SDK tools use to detect the location of your project.
The SDK launcher generates a gameinfo.txt when you run the Create a Mod Wizard. This will work fine for development, but before release you will want to edit it and add new data.

UI settings
Name
game <string>
- The name of your mod. Displayed in Steam, on the Windows task bar, but not on the main menu (unless you don't define a
title
). title <string>
title2 <string>
- These are the strings displayed in the main menu of your mod. They might be different from the strings displayed in Steam and on the desktop if you are using a fancy font.
title2
(and 3, 4, etc.) are to enable you to apply different styles to different parts of your title.Note:It's likely your title won't display right until you edit ClientTitleFont in
resource/clientscheme.res
to change its font. Half-Life 2 uses a specially-made font ("HalfLife2") that only has a specific set of characters; it won't display most text properly.gamelogo <boolean>
- Rather than displaying the
title
/title2
text, display the content inresource/GameLogo.res
. This was used for all three of the games in the Orange Box.
Options
type <singleplayer_only | multiplayer_only>
- Affects which tabs appear in which order the Options panel. May also affect Steam's download speed. Omit if your mod has both SP and MP modes.
nodifficulty <boolean>
- Hides the difficulty tab
hasportals <boolean>
- Shows the Portal options tab
nocrosshair <boolean>
- Hides the multiplayer crosshair selection menu
nomodels <boolean>
- Hides the multiplayer model selection menu
nohimodel <boolean>
- Hides toggle checkbox for
cl_himodels
. Only displayed properly ifcl_himodels
exists in the first place!
Steam Games list
developer <string>
- Your team's name (or just yours!)
developer_url <string>
- Your or the mod's website. Must start with
http://
. manual <string>
- URL to the mod's manual; can be local.
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. For transparency to work, the TGA must be saved in 32-bit mode with active alpha channel.
Miscellaneous
hidden_maps <subkey>
- Maps in the subkey do not appear in the "create server" dialogue (but can still be loaded from the console).
- Syntax is
mapname 1
, with one entry per line. Don't include.bsp
. Remember to open and close the subkey with { and }. nodegraph <boolean>
- Prevents the engine from creating nodegraphs for NPCs.
Mounted content and required games
SteamAppId
The main relevant thing in the GameInfo.txt
file is the SteamAppId
variable. If you look inside GameInfo.txt, you'll see a section that looks something like this:
SteamAppId 215 //This will mount all the GCFs we need (240=CS:S, 220=HL2).
The SteamAppId
value specifies which game content (i.e. GCF files) is accessible to the game.

215
AppId unless there is a specific need for another, such as 218 to load the Orange Box Source Engine.

The SteamAppId
values for the core Source games can be found at Steam Application IDs. Shared GCFs will have 'shared' in their filename and can always be accessed; everything else is private to the game in question.
FileSystem
This section describes various components of FileSystem in detail
ToolsAppId
All GameInfo.txt
files should contain a line like this:
ToolsAppId 211 //Tools will load this (ie: source SDK caches) to get //things like materials\debug, materials\editor, etc.
This is a special case that tools use so they can load special content that is used by the tools, but is not used by the games.
SearchPaths
The SearchPaths
section of the GameInfo.txt
file describes where the content is to be found, either on your hard drive or inside Steam cache files. To understand this part, we must take a detour into how programmers using the Source engine access the game's files. All files that a programmer accesses in code must exist under a path ID. A path ID describes one or more locations on your hard drive or inside virtual Steam file systems.
As an example, most of your game's resources like scripts, sounds, model files, and materials are accessed under the "Game"
path ID. A programmer might say, "open a file called scripts\weapon_m4a1.txt
inside the 'Game'
path ID". If you were running a mod in C:\MyMod\Blasters
, and you used SteamAppId 240
which would load in the Counter-Strike: Source content, then it would look for the file in these locations:
C:\MyMod\Blasters\scripts\weapon_m4a1.txt
<Steam install directory>\Steam\SteamApps\username\Counter-Strike Source\cstrike\scripts\weapon_m4a1.txt
<inside the virtual Steam file system>\cstrike\scripts\weapon_m4a1.txt
Using path IDs to describe where the files are saves the programmer and artist from having to worry about all these different directories. They can use names relative to the game directory (like scripts\weapon_m4a1.txt
or materials\brick\brickwall001a.vmt
) and the engine and tools will find the full path to the file wherever it exists, as long as GameInfo.txt
describes what the "Game"
path ID means.
Inside the GameInfo.txt
file, there is a section called "SearchPaths"
, which describes the path IDs. Most mods will never need to modify the way these are setup from the way they are created when you run Create a Mod from the SDK launcher.
The first part of each line is the name of the path ID, and the second part is where to look for files when this path ID is used. A simple example, which is illustrative, but you would never use (because it uses absolute paths including drive letters, which you can never assume exist on a user's machine) is this:
SearchPaths { TestPathID C:\TestMod1 TestPathID C:\TestMod2 TestPathID C:\TestMod3 }
If a programmer were to write code that asked for scripts\weapon_m4a1.txt and specify "TestPathID" as the path ID in code, then the engine would look for the file in these locations:
C:\TestMod1\scripts\weapon_m4a1.txt
C:\TestMod2\scripts\weapon_m4a1.txt
C:\TestMod3\scripts\weapon_m4a1.txt
Since the Source games access most of their content in the "Game"
path ID, they do some things for you automatically if you have a path ID called "Game"
. For each entry with a path ID of "Game"
:
- It adds a
"GameBin"
path ID, in<dir>\bin
- It adds another
"Game"
path in front of it with_<language>
at the end. For example:c:\hl2\cstrike
would get ac:\hl2\cstrike_french
path added to it if you were running on a French-localized machine.
For the first "Game"
search path:
- It adds a search path called
"MOD"
under the same folder. - It adds a search path called
"DEFAULT_WRITE_PATH"
.
The default SearchPaths
that would be used in most mods are like this:
SearchPaths { Game |gameinfo_path|. Game hl2 }
Normally, a path specifier (the part on the right side) is relative to the base directory --The directory where hl2.exe
is found. If |gameinfo_path|
precedes the path, then it is relative to the directory where GameInfo.txt
file instead. For example, if the GameInfo.txt
file were in C:\MyMod\Blasters
, and it had a path like |gameinfo_path|SomeTestDirectory
, then the path ID you were creating would refer to:
C:\MyMod\Blasters\SomeTestDirectory
For Counter-Strike: Source, the GameInfo.txt
file has a SearchPaths
section that looks like the one above. If your Counter-Strike directory was:
C:\Program Files\Valve\Steam\SteamApps\username\Counter-Strike Source
then it would be saying to look in these two directories:
C:\Program Files\Valve\Steam\SteamApps\username\Counter-Strike Source\cstrike
because GameInfo.txt exists here.
C:\Program Files\Valve\Steam\SteamApps\username\Counter-Strike Source\hl2
which only exists inside a virtual Steam file system.