Skip to content

Latest commit

 

History

History
127 lines (84 loc) · 7.41 KB

gameconfig.md

File metadata and controls

127 lines (84 loc) · 7.41 KB

Home | What IS Qodot? | Setting Up Your Project | The Game Manager Autoload | What's an Entity? | Base Classes and Property Definitions | Solid Entities | Point Entities, Part 1 | Point Entities, Part 2 | Game Configuration | Forge Game Data | Textures! | Finally. TrenchBroom. | Building the QodotMap | Helpful Resources | Frequently Asked Qodots


TrenchBroom Game Configuration

One of the two most important resources we'll need is our TrenchBroom Game Configuration. Create a new resource within the res://tb/fgd/ folder and choose TrenchBroomGameConfig.


The TrenchBroom Game Configuration resource defines where TrenchBroom is located and how it understands our game.



  • Export : After everything is set up, press this to export your game configuration. You should only need to do this any time you modify the TrenchBroomGameConfig resource.

  • Trenchbroom Games Folder : Location of the games sub-directory of your TrenchBroom installation (eg: C:/TrenchBroom/games/). This is not your game's unique folder but rather the folder that would contain it. Uses a global path rather than a relative project path.

  • Game Name : The identifier for your game, usually the game's actual name. This is also the name of the folder that will be created for your game in the TrenchBroom/games/ directory.

  • Icon : Image file that represents your game in TrenchBroom's games list.

  • Fgd Files : An array of QodotFGDFile resources. This will be exported when you toggle the Export property at the top of the resource's properties list. You can also export the FGD through the FGD resource itself.

    NOTE: Using more than one FGD resource in this property is currently bugged. Only the first FGD file will be used. If wishing to use multiple FGDs, use the Base Fgd Files property in the FGD resource.

  • Entity Scale : A game-wide display model scale expression. It's recommended you set this to your typical inverse scale ratio so that your display models show up at the right size in TrenchBroom. Stacks with the Point Class entity's model scale definition. Please consult the official TrenchBroom GameConfig docs for more information.

  • Default UV Scale : When textures are first applied or when resetting UV modifications on a brush, this is the scale they are set to. Only affects TrenchBroom. Generated meshes will only have the final texture UVs as defined by your map file. Can be useful if you use higher res textures but want a more manageable inverse scale ratio.

  • Brush Tags : An array of TrenchBroomTag resources. While these tags have no Godot or Qodot import functionality, they do modify certain TrenchBroom brush settings like transparency. Useful for trigger brushes.

  • Face Tags : An array of TrenchBroomTag resources. This one's for per texture settings, again mostly for transparency. Useful for clip and skip textures.

  • Face Attrib Surface Flags / Face Attrib Content Flags : Currently unused by Qodot.

Select your TrenchBroom games folder and set your game's name and icon. Ignore the FGD files for now. We'll get to that later.

TrenchBroom Tags

We will be creating 3 new TrenchBroomTag resources in the res://tb/fgd/tags/ folder.


Name the tag resources as follows:

  • tag_trigger.tres
  • tag_clip.tres
  • tag_skip.tres

Let's take a look at the TrenchBroom Tag resource and see what's going on with it.



  • Tag Name : This should be a unique name to the other tags.

  • Tag Attributes : A typed array of Strings. Defaults with "_transparent".

    NOTE: TrenchBroom does not recognize "_transparent" as an attribute, so you must either remove this attribute or rename it to "transparent" without the underscore. Consider this a bug to be fixed in an upcoming patch.

  • Tag Match Type : The type of TrenchBroom object to apply this tag's attributes to. The only options we're currently interested in are Texture and Classname.

  • Tag Pattern : The pattern for TrenchBroom to filter when applying the Tag Attributes. An asterisk * after the pattern denotes a prefix (eg: trigger* will filter all entities whose classnames begin with "trigger" like "trigger_once"), while placing it before indicates a suffix. If no asterisks are used, then the pattern is taken literally.

  • Texture Name : If the Tag Match Type is set to Classname, an optional texture can be specified. If you use a shortcut command in TrenchBroom to create this type of brush entity, it will automatically be assigned this texture.

The important thing to remember is these tags are purely for the benefit of making things easier for you as a level designer to parse visually, and has no impact on the Qodot import process or the Godot nodes that are created.

For the tag resources we just created, fill them out in a way to match these examples:



Game Configuration, Part 2

After we've finished creating our Tags, let's head back to our Game Config resource. We'll want to add our new Tags to the Brush Tags and Face Tags arrays.

Since tag_trigger.tres defines it as a Classname tag type, we'll add it to Brush Tags. Both tag_clip.tres and tag_skip.tres are meant to be applied to any brush faces textured with clip or skip, so add both of them to Face Tags.


Click Export and our Game Config resource will create our game folder in the TrenchBroom/games/ directory. And with that, our game configuration is done!

Sort of.

While we could use the default example qodot_fgd.tres that comes built-in, we already took all that time to make all of our own entities... so let's instead be the masters of our own fate and create our own QodotFGDFile resource from scratch.


Home | What IS Qodot? | Setting Up Your Project | The Game Manager Autoload | What's an Entity? | Base Classes and Property Definitions | Solid Entities | Point Entities, Part 1 | Point Entities, Part 2 | Game Configuration | Forge Game Data | Textures! | Finally. TrenchBroom. | Building the QodotMap | Helpful Resources | Frequently Asked Qodots