Gameinfo.txt

From Valve Developer Community
Revision as of 15:12, 16 July 2009 by TomEdwards (talk | contribs) (finished rewrite - added AdditionalContentId details)
Jump to navigation Jump to search

Template:Otherlang2

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.

Note.pngNote:Boolean values are represented as integers.
Warning.pngWarning:If a value has any spaces or tabs in it, wrap it in "quote marks".

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.pngNote: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.
Template:EP2 add
Rather than displaying the title/title2 text, display the content in resource/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
Template:EP2 add
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 if cl_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 }.
Template:EP2 add
Prevents the engine from creating nodegraphs for NPCs.

Mounted content and required games

There are two stages to getting at a game's content:

  1. Mount its AppID
  2. Mount its folder as a searchpath

This all happens within the filesystem key.

Warning.pngWarning:Your mod will not be protected by VAC if it is based on a single-player game.
SteamAppID <int>
The appid of the game the mod is to be based on. The mod will have access to all of its content, and not be playable unless it is installed.
For most mods this will be either 215 (Ep1) or 218 (OB), both of which point to different versions of Source SDK Base.
Template:EP2 add
Another game that the mod both has access to and depends on. Any number of AdditionalContentIds can be specified.
Note.pngNote: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 (see below). Remember to delete the SearchPath before you release.
ToolsAppId <int>
This is the appid of the SDK currently in use. Currently, the only valid value is 211 (i.e. the Source SDK).

SearchPaths

SearchPaths is a further subkey group within FileSystem. It contains a list of folders that the engine will search for content in, with the pattern Game <path>.

The engine starts its search in the first path, and stops as soon as it finds the file it's looking for. This means that the order in which you provide search paths is important: files in one search path override those in paths below it.

A path is normally relative to SteamAppID's root directory (i.e. where hl2.exe is located) or absolute (e.g. C:\SomeFolder\). There are two "magic words" you can use to overcome this:

  1. |all_source_engine_paths| (points to the folders of both the SteamAppID and any AdditionalContentIds you have used)
  2. |gameinfo_path| (points to the folder containing your mod's gameinfo.txt)

Finally, Source automatically creates localised search paths from each path you provide. For example, passing hl2 means that hl2_french is added too (if the player runs your mod in that language).

Todo: Does this also apply for the mod folder itself?

Example

The following code would mount the content of both Episode Two and Portal:

FileSystem
{
	SteamAppId	420	// Ep2
	ToolsAppId	211
	AdditionalContentId	400	// Portal

	SearchPaths
	{
		Game	|gameinfo_path|.	// Your mod folder should always come first
		Game	|all_source_engine_paths|ep2
		Game	|all_source_engine_paths|episodic	// Ep2 also uses some Ep1 content
		Game	|all_source_engine_paths|portal
		Game	|all_source_engine_paths|hl2	// HL2 should always come last
	}
}

Episode Two comes first and so has priority. This means that you won't be able to use portals, as the Ep2 game code will be loaded - but you could pitch GLaDOS against a pack of Hunters!

If you did want to use Portal's game code, you would simply promote its search path above Ep2's.