FGD Files
FGD (or Forge Game Data) is a data structure used by Quake for storing data about Entities.
- FGD Files
- Class Reference
- How Qodot uses FGD files
- Creating a new FGD
- Editing an FGD
- Adding an FGD to a Game Definition
Class Reference
How Qodot uses FGD files
FGD files are used in two ways by Qodot:
- Qodot writes FGD files to your Trenchbroom games folder when you create a Game Definition.
- QodotMap reads through all FGDs in the FGD list, looking for matching entity classnames in the map file. This is how Qodot matches map entities to Godot nodes and scenes.
Creating a new FGD
This guide will cover how to create a new FGD file.
Prerequisites
You’ll need to provide Entity Definitions, otherwise there is no point in having an FGD for your Game Definition.
Steps
- Right click the FileSystem and click New Resource.
- Search for “FGDFile” and select it.
- Name the file, retaining the .tres suffix.
It helps to add “fgd” to the filename your FGD resources for clarity.
Editing an FGD
Double click the FGD resource in the FileSystem to open up a window in the Inspector. See FGD Properties for more info on each property.
Adding entity definitions
- Increase the size of the Entity Definitions array
- Drag-and-drop the new entity resource into the array
- Save your FGD resource
Note
All FGDs start with some entities by default, but some are necessary to build map geometry with groups. These are worldspawn_solid
, worldspawn_base
, and group_solid
. These must be present in either your entity definitions, or in the definitions of a base FGD file.
Saving an FGD
When saving the current scene with Ctrl + S, all affected resources are also saved. You can save just the FGD as it’s open by clicking the Save icon at the top of the Inspector.
Adding an FGD to a Game Definition
If you don’t have a game definition, read the Game Definition page to learn how to create one.
- Open
config_folder.tres
and add your FGD to the FGD list - Click Export File in the Inspector
- Press F6 in Trenchbroom to refresh entity collections