GridPlacement’s catalog is the registry of available placeables — buildings, items, terrain props — that players can place, move, and demolish. This guide explains where catalogs come from, how they’re wired to the placement system, and where configuration belongs.
2. Resource Folder Loading (Recommended for content-driven games)
Use UnifiedCatalogLoader to scan Godot .tres files from a folder:
1
2
3
4
5
6
7
8
9
10
// In your composition rootvarloader=newUnifiedCatalogLoader(newCatalogLoadConfig{EnginePlaceablesFolder="res://placeables/",LoadFromEngineResources=true,MergeStrategy=ManipulationCatalogMergeStrategy.OverwriteExisting});varcatalog=loader.Load();// returns ManipulationRuntimeCatalogPlacementProvider.SetCatalog(catalog);
The folder res://placeables/ should contain ManipulationEntryData resource files (.tres). This is useful for games with content that can be added/modified without code changes.
3. JSON Config File (Recommended for modding-friendly games)
This is the correct pattern — the composition root owns catalog construction. The UI (PlaceableSelectionUI) only:
Displays items from Provider.Catalog
Emits selection events via PlacementSignalBus.PublishManipulationEntrySelected()
Anti-Patterns to Avoid
❌ Building the catalog from the view
1
2
3
4
5
6
7
8
9
10
11
// WRONG — PlaceableSelectionUI should not populate the catalogpublicpartialclassPlaceableSelectionUI:Control{ [Export]publicGridPlacementProviderProvider;privatevoidLoadItems(){// This is view code — not its job to populate dataProvider.AddCatalogEntry(item);}}
The view should read from the catalog, not write to it.
❌ Wiring catalog loading inside a node’s _Ready()
1
2
3
4
5
6
// WRONG — input handling and catalog loading are separate concernspublicoverridevoid_Ready(){varloader=newUnifiedCatalogLoader(...);Provider.SetCatalog(loader.Load());}
Catalog loading belongs in your composition root, not in a node’s _Ready().