ai-behavior-trees-util…
Engine-neutral behavior tree and utility AI code for NPCs in any language: Blackboard, reactive composites, decorators and…
Godot 4.7 data-driven design with custom Resources: class_name and @export fields, .tres files, shared references vs duplicate_deep(), uids and threaded loading. Use for items, stats or enemy configs as data, or when editing one enemy changes every enemy or a .tres stops
Claude Code
$ npx -y skills add gamedev-skills/awesome-gamedev-agent-skills --skill godot-resources --agent claude-code
Codex
$ npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill godot-resources -a codex -y
Cursor
$ npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill godot-resources -a cursor -y
Gemini CLI
$ npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill godot-resources -a gemini-cli -y
GitHub Copilot
$ npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill godot-resources -a github-copilot -y
OpenCode
$ npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill godot-resources -a opencode -y
Windsurf
$ npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill godot-resources -a windsurf -y
name: godot-resources description: > Godot 4.7 data-driven design with custom Resources: class_name and @export fields, .tres files, shared references vs duplicate_deep(), uids and threaded loading. Use for items, stats or enemy configs as data, or when editing one enemy changes every enemy or a .tres stops loading. Not for save slots (`save-systems`) or the C# version (`godot-csharp`).
Model game data as `Resource` objects saved as `.tres`/`.res`, share them safely, and load them without hitches. Targets **Godot 4.7** (see Version notes).
`Resource` subclasses; `ResourceLoader`/`ResourceSaver` code.
**When *not* to use:** scene structure → `godot-nodes-scenes`; the player's runtime progress, slots and migration → `save-systems`; C# → `godot-csharp`.
1. **Subclass `Resource`** with `class_name` and typed `@export` fields (Pattern 1). The `class_name` is what lets the editor offer it in "New Resource" and as an export type. 2. **Create instances as text `.tres` files.** You can write them directly (Pattern 2) instead of clicking through the FileSystem dock and Inspector; use binary `.res` only for large generated data. 3. **Reference resources from nodes** with `@export var data: ItemResource` or `@export var loot: Array[ItemResource]`, or load them by path in code. 4. **Load** with `preload` (constant path) or `load` (variable path); use `ResourceLoader.load_threaded_request` for large scenes (see the reference). 5. **Duplicate before mutating** a shared resource at runtime (Pattern 3); every node that loaded the same path holds the same object. 6. **Check before you finish.**
`scripts/check_godot_project.py <project-dir>` to catch broken `ext_resource` paths, uids and ids. Fix every `ERROR`.
`godot --headless --path . --import` once on a fresh checkout (so `class_name` types resolve), then `godot --headless --path . --script res://tests/test_items.gd`, and read the exit code. With no Godot binary (`godot`, `godot4` or `$GODOT_BIN`), ask the user to run both lines and paste the output.
# res://items/item.gd extends Resource class_name ItemResource @export var id: StringName = &"" @export var display_name: String = "Item" @export_multiline var description: String = "" @export var icon: Texture2D @export var max_stack: int = 99 @export var value: int = 0
[gd_resource type="Resource" script_class="ItemResource" format=3]
[ext_resource type="Script" path="res://items/item.gd" id="1_item"]
[resource]
script = ExtResource("1_item")
id = &"sword"
display_name = "Sword"
max_stack = 1
value = 50Leave out the `uid=` attributes; Godot adds them the next time the file is saved. Fields left out keep the script defaults.
func give_unique_copy(template: ItemResource) -> ItemResource:
# true = deep: copies nested arrays/dictionaries and *embedded* sub-resources, but
# sub-resources saved in their own .tres stay shared. Use
# template.duplicate_deep(Resource.DEEP_DUPLICATE_ALL) to copy those as well.
var copy: ItemResource = template.duplicate(true)
copy.value += 5 # mutating the copy won't touch the template .tres
return copy# res://tests/test_items.gd
extends SceneTree
func _initialize() -> void:
var failed := 0
var sword := load("res://items/sword.tres") as ItemResource
if sword == null:
failed += 1
push_error("sword.tres did not load as ItemResource")
else:
var copy: ItemResource = sword.duplicate(true)
copy.value += 1
if copy.value == sword.value:
failed += 1
push_error("duplicate(true) shares state with the template")
print("Results: %d failed" % failed)
quit(1 if failed > 0 else 0)object, so mutating it changes every user (and re-saving writes the change into the file). Duplicate for per-instance state, or set `resource_local_to_scene = true` for a copy per scene instance.
sub-resources embedded in the file; one saved as its own `.tres` (e.g. a shared `stats.tres` inside `goblin.tres`) stays the same object. Use `duplicate_deep(Resource.DEEP_DUPLICATE_ALL)` when those must be copied too.
from "New Resource" and cannot be an `@export` type.
`.godot/` is missing on a fresh checkout. Run `godot --headless --path . --import` first.
`ResourceSaver.save` to `res://` works only while running from the project folder.
`.uid` sidecar with scripts, then run the checker; a uid that still resolves keeps the link working.
`PackedScene`, not node instances.
graphs acyclic or link by id.
`load` takes a runtime
<img src="docs/assets/awesome-gamedev-agent-skills-banner.png" width="820" alt="awesome-gamedev-agent-skills — game-dev skills for AI coding agents.
Engine-neutral behavior tree and utility AI code for NPCs in any language: Blackboard, reactive composites, decorators and…
Engine-neutral game audio technique: bus layout, volume sliders in decibels, loudness, ducking music under dialogue, adaptive…
Builds and tunes game cameras, engine-neutral with Godot and Cinemachine 3 mappings: 2D follow with deadzone and look-ahead,…
Plans, generates or sources, and validates consistent game art: style guides, sprites, pixel art, tilesets, icons and textures,…
Builds engine-neutral branching dialogue with Ink, Yarn Spinner or a small JSON graph runner: lines, choices, conditions,…
Designs engine-neutral enemy and NPC AI: picks FSM, behavior tree, utility or GOAP, and builds perception, steering and A*…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.