JSON Loading Guide (5.1 GDScript Track)
Scope
This guide is for the GridBuilding/GridPlacement 5.1 GDScript track.
- 5.1 is Godot-native and not intended for headless/server JSON workflows.
- If you want JSON-driven configuration, the recommended approach is:
- Parse JSON in your game-level code using Godot’s JSON APIs
- Convert the decoded data into the plugin’s expected Resources (e.g., Placeables)
- Then call into the plugin using those resources
For the 6.0 C# approach (including headless/back-end JSON pipelines), see:
docs/6.0/Core/JSON_LOADING.md
Why JSON parsing is not part of the 5.1 plugin boundary
The 5.1 plugin is designed around Godot resources and scenes:
.tres/.tscnunderres://ResourceLoaderas the canonical loaderGBInjectorSystemas the canonical composition root
Adding a plugin-owned JSON loader introduces extra surface area (IO, error policy, schema drift) that is out of scope for the 5.1 legacy track.
Recommended pattern
1) Parse JSON in game code
Use Godot’s built-in JSON parsing.
Example sketch:
| |
2) Convert JSON data into Resources
Two common strategies:
A) Reference existing
.tresresources by path- JSON contains
"placeable_path": "res://.../my_placeable.tres" - Game code loads it via
ResourceLoader.load()
- JSON contains
B) Create Resources at runtime
- JSON contains raw fields
- Game code creates a new Resource instance and populates fields
Example for strategy A:
| |
3) Hand Resources to the plugin
Once you have Placeable (or equivalent) resources, pass them into your plugin entrypoints / registries.
This keeps:
- JSON schema concerns in your game
- resource identity + caching in Godot
- plugin runtime focused on placement behavior
Notes
- This guide intentionally avoids defining a strict JSON schema. Your game’s schema should match your content pipeline.
- If you need a formal schema + headless content build pipeline, follow the 6.0 approach via AssetLoader:
docs/6.0/Core/JSON_LOADING.md