godot-resources
यह क्या करती है
यह स्किल दिखाती है कि आइटम और स्टैट्स जैसी गेम जानकारी कोड की बजाय Godot रिसोर्स फ़ाइलों में कैसे रखें। यह उन लोगों के लिए है जो स्क्रिप्ट दोबारा लिखे बिना गेम डेटा बदलना चाहते हैं।
कब इस्तेमाल करें
- ✓जब आप आइटम, स्टैट्स या दुश्मन सेटिंग्स को Godot में डेटा फ़ाइलों के रूप में रखना चाहें।
- ✓जब आपको Godot प्रोजेक्ट में .tres या .res रिसोर्स फ़ाइलें बनानी हों।
- ✓जब आप ज़रूरत पड़ने पर गेम डेटा लोड करना चाहें, या चलते समय साझा रिसोर्स सुरक्षित रूप से बदलना चाहें।
Skill का लिंक
https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/godot/godot-resources/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरे Godot गेम को ऐसे सेट कीजिए कि मैं कोड लिखे बिना एक फ़ाइल बदलकर नए हथियार जोड़ सकूँ।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
यह बताती है कि बदले जा सकने वाले फ़ील्ड वाले कस्टम रिसोर्स टाइप कैसे बनाएँ, उन्हें फ़ाइलों में कैसे सहेजें, सीन में उनका संदर्भ कैसे दें, और ज़रूरत पड़ने पर कैसे लोड करें।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Godot Resources (4.x)
Model game data as reusable, Inspector-editable Resource objects instead of hard-coded
values, and load/save them as .tres/.res. Targets Godot 4.7.
When to use
- Use when representing items, stats, enemy configs, dialogue lines, or level metadata as
data; authoring
.tresfiles in the Inspector; or loading/saving custom resources.
When not to use: nodes/scene structure → godot-nodes-scenes; saving the player's
runtime progress (engine-agnostic save format/slots) → save-systems; the C# variant of
this pattern → godot-csharp.
Core workflow
- Subclass
Resourcewithclass_nameand@exportfields. It now appears in the "New Resource" dialog and as an@exporttype, editable in the Inspector. - Create instances as
.tresfiles in the FileSystem dock (text, diff-friendly) or.res(binary, smaller/faster). Edit their fields in the Inspector — no code needed. - Reference resources from nodes via
@export var data: ItemResource, or arrays@export var loot: Array[ItemResource]. - Load at runtime with
preload(constant path) orload/ResourceLoader.load(variable path). Use threaded loading for large assets. - Duplicate before mutating a shared resource at runtime, or every node using it changes too (resources are shared references).
- Save generated/edited resources with
ResourceSaver.save.
Patterns
1. A custom data resource
# 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
Create sword.tres from this class in the FileSystem dock and fill it in the Inspector.
2. Consume resources from a node
extends Node
@export var starting_items: Array[ItemResource] = [] # drag .tres files in the Inspector
func _ready() -> void:
for item in starting_items:
print("Have: %s (x%d max)" % [item.display_name, item.max_stack])
3. Duplicate before mutating shared data
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
4. Save and load a resource at runtime
func save_config(cfg: Resource) -> void:
ResourceSaver.save(cfg, "user://config.tres") # user:// = writable app data dir
func load_config() -> Resource:
if ResourceLoader.exists("user://config.tres"):
return ResourceLoader.load("user://config.tres")
return null
Pitfalls
- Resources are shared by reference. A single
.tresassigned to many nodes is the same object — mutating it changes all of them (and re-saving the file). Callduplicate(true)for per-instance state. - A deep copy still changes the original's sub-resource →
duplicate(true)only copies sub-resources embedded in the file; one saved as its own.tres(e.g. a sharedstats.tresinsidegoblin.tres) is still the same object. Useduplicate_deep(Resource.DEEP_DUPLICATE_ALL)when those must be copied too. class_namerequired to instance from the editor. Without it the class won't appear in the "New Resource" dialog or as an@exporttype.res://is read-only in exported games. Write runtime data touser://, neverres://.ResourceSaver.savetores://only works in the editor.- Storing nodes in a Resource doesn't serialize them. Resources hold data, not live
scene nodes. Reference scenes via
PackedScene, not node instances. - Cyclic resource references (A holds B holds A) can fail to save/load cleanly — keep data graphs acyclic or use IDs/lookups.
preloadvsload.preloadneeds a constant path and loads with the script;loadaccepts a variable path at runtime. UseResourceLoader.exists()beforeloadto avoid errors on missing files.- Don't put secrets in
.tres— they ship in plain text inside the export.
References
- For threaded/background loading (
load_threaded_request), `
अक्सर पूछे जाने वाले सवाल
Godot रिसोर्स क्या है?
रिसोर्स एक डेटा ऑब्जेक्ट है जिसे फ़ाइल में सहेजा जा सकता है और सीन के बीच साझा किया जा सकता है।
बदलने से पहले रिसोर्स की डुप्लिकेट क्यों बनाएँ?
रिसोर्स साझा संदर्भ होते हैं, इसलिए एक साझा कॉपी बदलने से वह हर जगह बदल जाती है जहाँ वह इस्तेमाल होती है।
क्या यह खिलाड़ी की प्रगति सेव करने के लिए है?
असल में नहीं। खिलाड़ी की प्रगति सेव करना एक अलग सेव स्किल में कवर है।
जानकारी
लेखक का मूल विवरण
Design data-driven Godot 4.7 games with custom Resource classes: define typed data with class_name + @export, save/load .tres/.res files, instance and duplicate resources, and load on demand with ResourceLoader (incl. threaded loading). Use when modeling items/stats/configs as data in a Godot project, creating .tres resources, or working with custom Resource subclasses and ResourceLoader/ResourceSaver.
लोकप्रियता
- GitHub स्टार
- 6.6k
- रैंकिंग में स्थान
- #13827
- लाइसेंस
- Apache-2.0
- अपडेट की गई
- 28/10/2026
कमेंट
- …
इस repository की और skills
router
6.6kयह आपके एजेंट को इंजन और काम के प्रकार को पहचानकर किसी अनुरोध के लिए सही गेम डेवलपमेंट स्किल चुनने में मदद करती है।
ai-behavior-trees-utility-ai
6.6kयह आपके एजेंट को दुश्मनों और किरदारों के लिए बिहेवियर ट्री और यूटिलिटी AI सिस्टम बनाने में मदद करती है, जो प्राथमिकता और स्कोर से कार्रवाई चुनें।
audio-design
6.6kआपके एजेंट को गेम ऑडियो मिक्सिंग सिखाती है: बस, डेसिबल में वॉल्यूम, डायलॉग में म्यूज़िक धीमा करना और साउंड इफ़ेक्ट की विविधता।
camera-systems
6.6kयह आपके एजेंट को ऐसे गेम कैमरा बनाने में मदद करती है जो सहजता से पीछा करें, लेवल के भीतर रहें, और 3D में घूम या देख सकें।
मिलती-जुलती skills
diffs
394kयह आपके एजेंट को बदलावों का असली diff बनाने देती है, जिसे व्यूअर लिंक या इमेज फ़ाइल के रूप में साझा किया जा सकता है, हाथ से लिखे सारांश के बजाय।
coding-agent
394kयह आपके एजेंट को बड़े कोडिंग काम Codex, Claude Code या OpenCode को बैकग्राउंड वर्कर के रूप में सौंपने, फिर उसकी प्रगति जांचने में मदद करती है।
gh-issues
394kयह आपके एजेंट को GitHub issues खोजने, उनमें से काम करने लायक चुनने, और सुधार के साथ pull requests खोलने में मदद करती है, जिसमें समीक्षा टिप्पणियों का फ़ॉलो-अप भी शामिल है।