FuncGodot FGD Resources

FuncGodotFGDFile

Resource file used to express a set of FuncGodotFGDEntity definitions. Can be exported as an FGD file for use with a Quake map editor. Used in conjunction with a FuncGodotMapSettings resource to generate nodes in a FuncGodotMap node.

Level Design Book FGD Chapter
Valve Developer Wiki FGD Article


Property Type Description
Export File Bool Used as a button to build and export the FGD file. Automatically sets to off after exporting.
Map Editor
Target Map Editor FuncGodotTargetMapEditor Some map editors do not support the features found in others (ex: TrenchBroom supports the "model" key word while others require "studio", J.A.C.K. uses the "shader" key word while others use "material", etc...). If you get errors in your map editor, try changing this setting and re-exporting. This setting is overridden when the FGD is built via a game config resource.
FGD
Fgd Name String FGD output filename without the extension.
Base Fgd Files Array[Resource] Array of FuncGodotFGDFile resources to include in FGD file output. All of the entities included with these FuncGodotFGDFile resources will be prepended to the outputted FGD file.
Entity Definitions Array[Resource] Array of resources that inherit from FuncGodotFGDEntityClass. This array defines the entities that will be added to the exported FGD file and the nodes that will be generated in a FuncGodotMap.


FuncGodotFGDEntityClass

Base entity definition class. Not to be used directly, use FuncGodotFGDBaseClass, FuncGodotFGDSolidClass, or FuncGodotFGDPointClass instead.

Quake Wiki Entity Article
Level Design Book: Entity Types and Settings
Valve Developer Wiki FGD Article
Valve Developer Wiki Entity Descriptions


Property Type Description
Entity Definition
Classname String Entity classname. This is a required field in all entity types as it is parsed by both the map editor and by FuncGodot on map build.
Description String Entity description that appears in the map editor. Not required.
Func Godot Internal Bool Entity does not get written to the exported FGD. Entity is only used for FuncGodotMap build process.
Base Classes Array[Resource] FuncGodotFGDBaseClass resources to inherit Class Properties and Class Descriptions from.
Class Properties Dictionary Key value pair properties that will appear in the map editor. After building the FuncGodotMap in Godot, these properties will be added to a func_godot_properties Dictionary that gets applied to the generated node, as long as that node is a @tool script with an exported func_godot_properties Dictionary. See Entity Key Value Pairs for more information.
Class Property Descriptions Dictionary Map editor descriptions for the previously defined key value pair properties. Optional but recommended.
Auto Apply To Matching Node Properties Bool Automatically applies entity class properties to matching properties in the generated node. When using this feature, class properties need to be the correct type or you may run into errors on map build.
Meta Properties Dictionary Appearance properties for the map editor. See the Valve Developer Wiki and TrenchBroom documentation for more information.
Node Generation
Node Class String Node to generate on map build. This can be a built-in Godot class, a GDScript class, or a GDExtension class.

For Point Class entities that use Scene File instantiation leave this blank.

There is no restriction on what Node Classes can be generated.
Name Property String Optional class property to use in naming the generated node. Overrides FuncGodotMapSettings' name_property. Naming occurs before adding to the SceneTree and applying properties. Nodes will be named "entity_" + name_property. An entity's name should be unique, otherwise you may run into unexpected behavior.


FuncGodotFGDBaseClass

Special inheritance class for Solid Class and Point Class entity definitions. Useful for adding shared or common properties and descriptions. Does not have any unique properties on its own but is defined separately to facilitate FGD building and lookup.

Quake Wiki Entity Article
Level Design Book: Entity Types and Settings
Valve Developer Wiki FGD Article



FuncGodotFGDSolidClass

FGD SolidClass entity definition that generates a mesh from Brush Data
.

A MeshInstance3D will be generated by FuncGodotMap according to this definition's Visual Build settings. If node_class inherits CollisionObject3D then one or more CollisionShape3D nodes will be generated according to Collision Build settings.

Quake Wiki Entity Article
Level Design Book: Entity Types and Settings
Valve Developer Wiki FGD Article
Valve Developer Wiki Entity Descriptions
dumptruck_ds' Quake Mapping Entities Tutorial


Property Type Description
Spawn Type SpawnType Controls whether this Solid Class is the worldspawn, is combined with the worldspawn, or is spawned as its own free-standing entity.
  • WORLDSPAWN : Builds the geometry of this entity relative to the FuncGodotMap position.
  • MERGE WORLDSPAWN : This entity's geometry is merged with the worldspawn entity and this entity is removed. Behavior mimics func_group in modern Quake compilers.
  • ENTITY : This entity is built as its own object. It finds the origin of the entity based on origin_type.
Origin Type OriginType Controls how this Solid Class determines its center position. Only valid if Spawn Type is set to ENTITY.
  • AVERAGED : Use averaged brush vertices for center position. This is the old Qodot behavior.
  • ABSOLUTE : Use origin class property in global coordinates as the center position.
  • RELATIVE : Calculate center position using origin class property as an offset to the entity's bounding box center.
  • BRUSH : Calculate center position based on the bounding box center of all brushes using the origin texture specified in the FuncGodotMapSettings. If no Origin Brush is found, fall back to BOUNDS_CENTER. This is the default option and recommended for most entities.
  • BOUNDS_CENTER : Use the center of the entity's bounding box for center position.
  • BOUNDS_MINS : Use the lowest bounding box coordinates for center position. This is standard Quake and Half-Life brush entity behavior.
  • BOUNDS_MAXS : Use the highest bounding box coordinates for center position.
Visual Build
Build Visuals Bool Controls whether a MeshInstance3D is built for this Solid Class.
Global Illumination Mode GIMode Global illumination mode for the generated MeshInstance3D. Setting to GI_MODE_STATIC will unwrap the mesh's UV2 during build. See the Godot documentation for more information.
Shadow Casting Setting ShadowCastingSetting Shadow casting setting allows for further lightmapping customization. See the Godot documentation for more information.
Build Occlusion Bool Automatically build OccluderInstance3D nodes for this entity. See the Godot documentation on Occlusion Culling for more information.
Render Layers Int, 3D Render Flags This Solid Class' MeshInstance3D will only be visible for Camera3Ds whose cull mask includes any of these render layers.
Collision Build
Collision Shape Type CollisionShapeType Controls how collisions are built for this Solid Class.
  • None : No collision shape is built. Useful for decorative geometry like vines, hanging wires, grass, etc...
  • Convex : Will build a Convex CollisionShape3D for each brush used to make this Solid Class. Required for non-StaticBody3D nodes like Area3D and RigidBody3D.
  • Concave : Will build a single Concave CollisionShape3D from the entire set of brushes. Skips brush faces textured with the FuncGodotMapSettings' Skip Texture.

See the Godot documentation to make an informed decision on what collision type would work best for this entity for your game's needs.
Collision Layer Int, 3D Physics Flags The physics layers this Solid Class can be detected in.
Collision Mask Int, 3D Physics Flags The physics layers this Solid Class scans.
Collision Priority Float The priority used to solve colliding when penetration occurs. The higher the priority is, the lower the penetration into the SolidClass will be. This can for example be used to prevent the player from breaking through the boundaries of a level.
Collision Shape Margin Float The collision margin for the Solid Class' collision shapes. Not used in Godot Physics. See Shape3D documentation for details.
Mesh Metadata The following properties tell FuncGodot to add a "func_godot_mesh_data" Dictionary to the metadata of the generated node upon build. This data is parallelized, so that each element of the array is ordered to reference the same face in the mesh.
Add Textures Metadata Bool Add a texture lookup table to the generated node's metadata on build.

The data is split between an Array of StringName called "texture_names" containing all currently used texture materials and a PackedInt32Array called "textures" where each element is an index corresponding to the "texture_names" entries.
Add Vertex Metadata Bool Add a PackedVector3Array called "vertices" to the generated node's metadata on build.

This is a list of every vertex in the generated node's MeshInstance3D. Every 3 vertices represent a single face.
Add Face Position Metadata Bool Add a PackedVector3Array called "positions" to the generated node's metadata on build.

This is a list of positions for each face, local to the generated node, calculated by averaging the face's vertices to find its center.
Add Face Normal Metadata Bool Add a PackedVector3Array called "normals" in the generated node's metadata on build.

Contains a list of each face's normal.
Scripting
Script Class Script An optional Script file to attach to the node generated on map build.


FuncGodotFGDPointClass

A resource used to define an FGD PointClass entity. PointClass entities can use either the Node Class or the Scene File property to tell a FuncGodotMap what to generate on map build.

Quake Wiki Entity Article
Level Design Book: Entity Types and Settings
Valve Developer Wiki FGD Article
dumptruck_ds' Quake Mapping Entities Tutorial
Level Design Book: Display Models for Entities
Valve Developer Wiki FGD Article: Entity Description Section
TrenchBroom Manual: Display Models for Entities


Property Type Description
Scene
Scene File PackedScene An optional scene file to instantiate on map build. Overrides Node Class and Script Class.
Scripting
Script Class Script An optional Script resource to attach to the node generated on map build. Ignored if scene_file is specified.
Build
Apply Rotation On Map Build Bool Toggles whether entity will use angles, mangle, or angle to determine rotations on FuncGodotMap build, prioritizing the key value pairs in that order. Set to false if you would like to define how the generated node is rotated yourself.
Apply Scale On Map Build Bool Toggles whether entity will use `scale` to determine the generated node or scene's scale. This is performed on the top level node. The property can be a float, Vector3, or Vector2. Set to false if you would like to define how the generated node is scaled yourself.


FuncGodotFGDModelPointClass

A special type of FuncGodotFGDPointClass entity that automatically generates a special simplified, scaled, and reoriented GLB model file for the map editor display. Only supported in map editors that support GLTF or GLB.

Quake Wiki Entity Article
Level Design Book: Entity Types and Settings
Valve Developer Wiki FGD Article
dumptruck_ds' Quake Mapping Entities Tutorial
Level Design Book: Display Models for Entities
Valve Developer Wiki FGD Article: Entity Description Section
TrenchBroom Manual: Display Models for Entities


Property Type Description
Target Map Editor TargetMapEditor Determines how the entity definition defines the display model.

GENERIC: Entity definition uses the @studio key word. scale_expression is ignored. Supported by all map editors.

TRENCHBROOM: Entity definition uses the @model key word. scale_expression is applied if set.
Models Sub Folder String Display model export folder relative to ProjectSettings func_godot/model_point_class_save_path.
Scale Expression String Scale expression applied to model. Only used by TrenchBroom. If left empty, uses ProjectSettings func_godot/default_inverse_scale_factor.

See the TrenchBroom Documentation for more information.
Generate Size Property Bool Model Point Class can override the size meta property by auto-generating a value from the meshes' AABB. Proper generation requires scale_expression set to a float or Vector3.

WARNING: Generated size property unlikely to align cleanly to grid!
Rotation Offset Vector3 Degrees to rotate model prior to export. Different editors may handle GLTF transformations differently. If your model isn't oriented correctly, try modifying this property.
Generate GD Ignore File Button Creates a .gdignore file in the model export folder to prevent Godot importing the display models. Only needs to be generated once.