跳过主要内容
GDT
Skill免费GameSkill 出品 · 调优版

Godot Resources

/godot-resources

Data-driven Godot 4.7 games with custom Resource classes: typed data, .tres files, duplication and threaded loading.

许可证
Apache-2.0
出品
GameSkill 出品
下载 ZIP

所属合集

Awesome Gamedev Agent Skills

77 portable SKILL.md skills across 12 engines (Godot, Unity, Unreal, Phaser, PixiJS, three.js, Bevy, pygame, LÖVE, Roblox, Defold, Ebitengine), with a router.

我们测过

在 Godot 4.7.2 上通过 33/33 项检查(2026-10-30):能触发、有可运行示例、有截图和自检清单、单一职责、中英文文档齐全。触发检查是把提示词和 skill 描述做匹配,不是真实 agent 运行。

测试报告

这个 skill 做什么

什么时候触发

res files, instance and duplicate resources, and load on demand with ResourceLoader (incl. threaded loading).tres resources, or working with custom Resource subclasses and ResourceLoader/ResourceSaver. …

GameSkill 测过的版本

GameSkill 调优版:skill 文件取自提交 19d93f97c9c1,按我们的 skill 流程加上可运行示例、测试报告、自检清单和中文指南。

下载测过的 ZIP(42 KB)路线图:引擎基础

协议:基于 gamedev-skills/awesome-gamedev-agent-skills(作者 gamedev-skills),协议 Apache-2.0。ZIP 保留协议文件(LICENSE, NOTICE),CHANGES.md 列出了 GameSkill 加的所有文件。

Godot Resources

自检清单

  • 资源按引用共享,运行时改数据前先 duplicate(true) / resources are shared by reference; duplicate(true) before mutating at runtime
  • duplicate(true) 只复制内嵌子资源,独立 .tres 仍共享,需要时用 duplicate_deep(Resource.DEEP_DUPLICATE_ALL) / duplicate(true) only copies embedded sub-resources; use duplicate_deep for separate .tres
  • 没有 class_name 就不会出现在 New Resource 对话框和 @export 类型里 / no class_name means it won't show in the New Resource dialog or as an @export type
  • 导出的游戏里 res:// 只读,运行时数据写 user:// / res:// is read-only in exported games; write runtime data to user://
  • Resource 只存数据不存节点,引用场景用 PackedScene;load 前先 ResourceLoader.exists / resources hold data not nodes; use PackedScene for scenes and check ResourceLoader.exists before load

中文指南

这个 skill 做什么

这个 skill 讲 Godot 4.7 里用自定义 Resource 做数据驱动:用 class_name 加 @export 定义带类型的数据字段,存成 .tres/.res 文件,在 Inspector 里编辑,运行时用 ResourceLoader 加载、ResourceSaver 保存,以及实例和复制资源。

什么时候用

  • 把物品、属性、敌人配置、对话行、关卡元数据做成数据资源
  • 在 FileSystem 面板里新建和编辑 .tres 文件
  • 写自定义 Resource 子类,或用 ResourceLoader/ResourceSaver 读写资源

怎么装

下载本页的 ZIP,把 godot-resources/ 整个文件夹放进 agent 的 skills 文件夹:Claude Code 用 .claude/skills/,Codex、Gemini CLI、OpenCode 用 .agents/skills/,Cursor 用 .cursor/skills/,Copilot 用 .github/skills/,Windsurf 用 .windsurf/skills/,然后重启 agent。也可以直接对 agent 说:Install the skill from https://gameskill.dev/skills/godot-resources/install.md

最小示例

gameskill/examples/ 里是几个自定义 Resource:item_resource.gd、stats_resource.gd、creature_resource.gd,main.gd 和 main.tscn 使用它们,resource_lab.gd 演示保存、加载和复制;tests/run_tests.gd 是检查,tests/screenshot.gd 渲染截图。

我们怎么测的

总分 33/33。在 Godot 4.7.2 无头模式下跑 21 项检查:新建 ItemResource 的默认值正确(item_defaults);ResourceSaver 存到 user:// 成功(save_ok),再加载回来字段一致(load_roundtrip);同一路径两次 load 拿到同一个对象(cache_reuse),带 CACHE_MODE_IGNORE 时拿到新对象(cache_ignore_fresh),带 CACHE_MODE_IGNORE 时字段值仍正确(cache_ignore_values);duplicate(true) 后改副本不影响原资源(duplicate_isolated),模板文件本身没被改(duplicate_template_untouched);把同一个 .tres 赋给两个节点再改其中一个,另一个也跟着变(shared_reference_pitfall);duplicate(true) 会复制内嵌的子资源(deep_copy_embedded);CreatureResource 保存后加载正常(creature_save);Array[ItemResource] 的长度和元素类型正确(typed_array_size、typed_array_elem);resource_local_to_scene 标志生效(local_to_scene_flag);ResourceLoader.exists 对不存在的路径返回 false(exists_missing),load 不存在的路径返回 null(load_missing_null);加载后 resource_path 指向原文件(resource_path);浅复制时数组仍是共享的(shallow_shares_array);StringName 类型的 id 保存加载后仍是 StringName(stringname_id);StatsResource 默认值正确(stats_defaults);CreatureResource 的类型字段正确(creature_type)。结果在 gameskill/test-report.json。

和站内其他 skill 的区别

GodotPrompter 的 kit 里也包含 resource-pattern 参考,但这里专门讲自定义 Resource 数据。站内的 save-systems 管存档文件,这里管静态数据资源和 .tres 的保存加载往返。重点还包括资源按引用共享这个坑:同一个 .tres 赋给多个节点时是同一个对象。

搭配

  • save-systems:保存玩家运行时进度,和静态数据资源分开
  • godot-nodes-scenes:节点和场景结构,不是资源数据
  • godot-prompter:它的 kit 里也有一份 resource-pattern 参考

安装

告诉你的 AI

Install the skill from https://gameskill.dev/skills/godot-resources/install.md

GameSkill 测过的版本

测过的版本装到 .claude/skills/
mkdir -p .claude/skills
curl -fsSL https://gameskill.dev/dl/skills/godot-resources.zip -o /tmp/gameskill-godot-resources.zip
unzip -oq /tmp/gameskill-godot-resources.zip -d .claude/skills
rm /tmp/gameskill-godot-resources.zip

包含内容

  • Worked steps: A custom data resource; Consume resources from a node; Duplicate before mutating shared data; Save and load a resource at runtime
  • A pitfalls section with the mistakes to avoid
  • Bundled 1 reference doc the agent reads when needed
  • Written for Godot 4.7

适合

  • Modeling items/stats/configs as data in a Godot project, creating .tres resources
  • Working with custom Resource subclasses and ResourceLoader/ResourceSaver

试试这条提示词

提示词
Model my items and stats as custom Resource files I can edit in the inspector.

关于这个 Skill

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.

From the godot-resources SKILL.md in gamedev-skills/awesome-gamedev-agent-skills.

What's inside

  • A custom data resource
  • Consume resources from a node
  • Duplicate before mutating shared data
  • Save and load a resource at runtime

环境要求

  • Godot 4.7

常见问题

同赛道 PRO 商业源码$8.25/mo

肉鸽构筑白标起步工程(Godot 4 + Web + 平衡表)

告别空工程从零搭架子!开箱即玩的白标肉鸽构筑商业起步模板(Godot 4 完整工程 + Web 可玩版):含开局三槽赐福、无交叉 DAG 地图、扇形出牌、Boss 半血锁血、篝火/商店删牌、32 位校验防坏档 SaveStore、中英切换、30 牌/18 遗物/15 怪平衡表与 1,000 局 HTML 压测工具。

  • 完整 Godot 4.3+ 工程(打开即 F5 运行,内置防坏档原子 SaveStore + 中英实时切换 LocService)
  • 零构建 Web HTML5 可玩起步版(扇形手牌、2 帧受击闪白、震屏与 Boss 半血锁血全跑通)

基于 gamedev-skills/awesome-gamedev-agent-skills (作者 gamedev-skills,协议 Apache-2.0)。ZIP 里保留原作者的 LICENSE 和 NOTICE,ATTRIBUTION.md 和 CHANGES.md 写明来源提交和 GameSkill 加的内容。

搭配使用

作者标注的相关 Skills,或更适合相邻任务的 Skills。

Awesome Gamedev Agent Skills 中的更多 Skills

查看全部 45 个

相似 skills