9.4 KiB
Setting Up a New Godot Project with FuncGodot + TrenchBroom
Step-by-step guide for using TrenchBroom as a level editor with Godot via the FuncGodot addon. Tested on Linux with Godot 4.6, FuncGodot 2025.12, and TrenchBroom (v9 game config format).
Overview
There are three things you configure, and they must agree with each other:
| What | Where it lives | What it controls |
|---|---|---|
| FuncGodotLocalConfig | addons/func_godot/func_godot_local_config.tres |
Machine-specific paths (where to export configs, where your project lives on disk) |
| Your FGD resource | A .tres you create in your project |
Entity definitions + the FGD filename used in TrenchBroom |
| Your TrenchBroom GameConfig resource | A .tres you create in your project |
Game name, texture root, FGD reference — exports to TrenchBroom's games directory |
FuncGodotMapSettings also matters but has sane defaults. The critical thing is that paths line up.
Step 1: Install FuncGodot
- Copy the
addons/func_godot/folder into your project'saddons/directory (or install via AssetLib). - In Godot: Project > Project Settings > Plugins — enable FuncGodot.
- Restart the editor if prompted.
Step 2: Create Your Texture Directory
Put your textures in a subdirectory inside res://textures/. Do NOT put them directly in res://textures/.
your_project/
textures/
my_textures/ <-- subdirectory required
brick.png
stone.png
metal.png
Linux users: Make sure file extensions are lowercase (.png not .PNG). Both TrenchBroom and Godot are case-sensitive on Linux.
Step 3: Create Your FGD Resource
Do NOT edit the default addons/func_godot/fgd/func_godot_fgd.tres. Create your own.
- In the Godot FileSystem panel, right-click your project root.
- New Resource > search for
FuncGodotFGDFile> Create. - Save it as something like
my_game_fgd.tresin your project root. - In the inspector, set:
- FGD Name:
my_game(this becomes the.fgdfilename — no spaces, no extension) - Base FGD Files: Add
res://addons/func_godot/fgd/func_godot_fgd.tres(this pulls in all the default entities like worldspawn, func_geo, etc.) - Entity Definitions: Leave empty for now. Add your custom entities here later.
- FGD Name:
Why this matters: The FGD Name you set here becomes both the exported .fgd filename AND the filename referenced inside GameConfig.cfg. If these don't match, TrenchBroom silently falls back to a different FGD or fails to load entities.
Step 4: Create Your TrenchBroom GameConfig Resource
- In Godot FileSystem, right-click your project root.
- New Resource > search for
TrenchBroomGameConfig> Create. - Save it as something like
my_game_tb_config.tresin your project root. - In the inspector, set:
- Game Name: Something unique to this project (e.g.
my_game). This is the name shown in TrenchBroom's game list. Do not reuse "FuncGodot" — it will collide with other projects. - Textures > Textures Root Folder:
textures(this is relative to the game path, NOT a res:// path) - Entities > FGD File: Point to your FGD resource from Step 3 (
res://my_game_fgd.tres) - Leave everything else at defaults unless you have a reason to change it.
- Game Name: Something unique to this project (e.g.
Step 5: Configure FuncGodotLocalConfig
This stores machine-specific paths in a JSON file outside your project, so it won't break when you move the project or work on a different machine.
- Open
addons/func_godot/func_godot_local_config.tresin the inspector. - Set these fields:
| Field | Value | Example |
|---|---|---|
| Trenchbroom Game Config Folder | The folder inside TrenchBroom's games directory for THIS game. Must be a full filesystem path. | /home/you/.TrenchBroom/games/my_game |
| Map Editor Game Path | Your Godot project root as a full filesystem path. TrenchBroom uses this to find textures. | /home/you/godot_projects/my_game |
| FGD Output Folder | Usually same as your project root. Only used for standalone FGD export. | /home/you/godot_projects/my_game |
- Click Export func_godot settings (the save button) to write these to disk.
Where this actually saves: ~/.local/share/godot/app_userdata/<YourProjectName>/func_godot_config.json on Linux. If you clone the project to a new machine, you'll need to redo this step.
Step 6: Export the GameConfig to TrenchBroom
- Click on your TrenchBroom GameConfig resource (
my_game_tb_config.tres) in the inspector. - Click Export GameConfig (the button at the top of the inspector).
- Check the Godot output panel — it should print paths for the icon, GameConfig.cfg, and FGD file.
This creates three files in your TrenchBroom games folder:
~/.TrenchBroom/games/my_game/
GameConfig.cfg <-- tells TrenchBroom about your game
my_game.fgd <-- entity definitions (name matches your fgd_name)
icon.png <-- 32x32 icon
Step 7: Configure TrenchBroom
- Open TrenchBroom.
- Your game should appear in the game list on the welcome screen. Select it.
- If it doesn't appear or textures don't load, go to View > Preferences > Games:
- Select your game name.
- Set Game Path to your Godot project root (same path as Map Editor Game Path from Step 5).
- Create a new map. Choose Valve format (recommended — it has per-face UV axes).
Your textures should now appear in TrenchBroom's texture browser under my_textures/brick, my_textures/stone, etc.
Step 8: Build a Map and Import into Godot
- Build your map in TrenchBroom. Save the
.mapfile inside your Godot project directory (e.g.res://maps/my_level.map). - Back in Godot, the
.mapfile will auto-import as a resource. - Create a new 3D scene. Add a FuncGodotMap node.
- In the inspector:
- Local Map File: Set to your
.mapfile (res://maps/my_level.map) - Map Settings: You can use the default (
addons/func_godot/func_godot_default_map_settings.tres) or create your own FuncGodotMapSettings resource. Make surebase_texture_dirisres://texturesandentity_fgdpoints to your FGD resource.
- Local Map File: Set to your
- Click Build Map in the toolbar (or the button on the FuncGodotMap node).
How the Paths Must Align
This is where things break if you're not careful. The texture name in the .map file must resolve to the same file in both TrenchBroom and Godot.
TrenchBroom resolves textures as:
<Game Path> / <textures_root_folder> / <subdirectory> / <texture>.png
/home/you/my_project / textures / my_textures / brick.png
Godot resolves textures as:
<base_texture_dir> / <texture_name_from_map> . <extension>
res://textures / my_textures/brick . png
The .map file stores: my_textures/brick
If Game Path + textures_root_folder doesn't point to the same physical directory as base_texture_dir, textures will show in TrenchBroom but not in Godot (or vice versa).
Quick Checklist for New Projects
- FuncGodot addon installed and enabled
- Textures in a subdirectory of
res://textures/with lowercase extensions - Created your own FGD resource (not editing the addon default)
fgd_nameset to something unique- Default FGD added to
base_fgd_files
- Created your own TrenchBroom GameConfig resource
game_nameset to something unique (not "FuncGodot")textures_root_folderset totexturesfgd_filepointing to your FGD resource
- FuncGodotLocalConfig paths set and exported:
trenchbroom_game_config_folder=~/.TrenchBroom/games/<your_game>map_editor_game_path= your project root (full filesystem path)
- Clicked "Export GameConfig" on your TrenchBroom GameConfig resource
- In TrenchBroom: game path set to your Godot project root
- No leftover
~/.TrenchBroom/games/directories from old projects with the same game name
Troubleshooting
Textures don't appear in TrenchBroom:
- Check that the Game Path in TrenchBroom preferences points to your Godot project root.
- Verify
textures_root_folderin your GameConfig resource matches your actual directory name. - On Linux: file extensions must be lowercase (
.pngnot.PNG). - Re-export GameConfig after any changes.
TrenchBroom loads wrong FGD / entities missing:
- Check
~/.TrenchBroom/games/for duplicate directories with the same"name"in their GameConfig.cfg. Delete stale ones. - The FGD filename in
GameConfig.cfg("definitions"field) must match the actual.fgdfile on disk. Both come from your FGD resource'sfgd_nameproperty — re-export to resync.
Textures show in TrenchBroom but not in Godot after map build:
base_texture_dirin your FuncGodotMapSettings must beres://textures(matching the physical directory that TrenchBroom's game path + textures root points to).- Texture names are case-sensitive on Linux. The name in the
.mapfile must match the filename exactly. - Check the Godot output panel for "Error: Texture load failed" messages.
FuncGodotLocalConfig settings don't stick:
- You must click "Export func_godot settings" after changing values. The
.tresfile itself doesn't store the data — it goes to a JSON file in Godot's user data directory. - After cloning to a new machine, re-enter and re-export all local config settings.
Map file not recognized by Godot:
- The
.mapfile must be inside your Godot project directory (underres://). - FuncGodot must be enabled in Project Settings > Plugins.