FGD
What Is It?
FGD is the file extension for Hammer's game definition files. They define all of the entities of a game so mappers can select them from within the editor.
History
FGD stands for Forge Game Data. While Hammer was originally called Worldcraft, it was developed under the name The Forge. Due to trademark issues, that name couldn't be used for the final version.
File format
(this is a work in progress) The FGD file follows a fairly simple format. It is a script file that sets up entity structures and relationships for Hammer. In order to explain the structure, I'll break down the various parts of the Half-Life 2 FGD below.
//====== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======= // // Purpose: Half-Life 2 game definition file (.fgd) // //=============================================================================
Comments are defined simply by starting a line with //. They can be preceeded by spaces or tabs.
@include "base.fgd"
If the game you are writing your FGD for has a lot in common with another game (Half-Life 2 and Counter-Strike: Source, for example), you can include a file that has all of the common structures defined in it. The FGDs for Half-Life 2 and Counter-Strike: Source both include the base.fgd file, and the FGD for Half-Life 2 Deathmatch includes the halflife2.fgd file.
@BaseClass base(BaseNPC) = TalkNPC [ UseSentence(string) : "Use Sentence" UnUseSentence(string) : "Un-Use Sentence" ]
A BaseClass is used to setup structures that are used by several different entities. They are referenced in an entity structure by adding base(BaseClassName) to the main definition line of the structure. The BaseClass structure is defined just like a normal entity, in all respects. The only difference is that it doesn't appear in the entity lists in Hammer. (We'll discuss the complete entity structure below).