← ExekiteCONTENT HISTORY
WHAT CHANGED
Update to Exekite
Snapshot Nov 17, 2026 · 12:11 UTC · version 1.0.0
Collection source: downloaded plugin package.
First saved snapshot
No earlier snapshot is available to establish a change.
Save Exekite and check future changes in Following.
Up to 3 plugins free · no card required.
Compare saved observations
Download comparison JSONFull technical diff · 0 changed fields
Full snapshot data
{
"description": "For Exekite-hosted Godot games only. Typed Resource + .tres pattern for entity tunables — the two-file schema/values shape, @export_range/@export_group syntax, load() caching and duplicate(true) traps. Use when writing or restructuring a stats Resource or .tres file; skip for entities with one or two inline knobs.",
"included_files": [],
"name": "resource-pattern",
"skill_md_contents": "---\nname: resource-pattern\ndescription: \"For Exekite-hosted Godot games only. Typed Resource + .tres pattern for entity tunables — the two-file schema/values shape, @export_range/@export_group syntax, load() caching and duplicate(true) traps. Use when writing or restructuring a stats Resource or .tres file; skip for entities with one or two inline knobs.\"\n---\n\n# Resource pattern (.tres tunables)\n\nThe Exekite shape: per-entity tunables live in **typed `Resource` subclasses**, instantiated as `.tres` files. The script defines the schema; the `.tres` carries the values.\n\nWhy: values in a `.tres` are DATA — they diff cleanly, and many entities can share one resource. A magic number in a script is neither.\n\n## Two-file shape\n\nFor an entity with many tunables (player has 10), make a Resource subclass:\n\n`entities/player/player_stats.gd`:\n```gdscript\nclass_name PlayerStats\nextends Resource\n##\n## Player tunables. Edit values in the inspector (or any .tres instance);\n## the player controller reads them every physics tick.\n\n@export_group(\"Movement\")\n@export_range(50.0, 400.0, 5.0) var speed: float = 130.0\n@export_range(500.0, 3000.0, 50.0) var acceleration: float = 1500.0\n@export_range(200.0, 3000.0, 50.0) var friction: float = 1200.0\n\n@export_group(\"Jump\")\n@export_range(-600.0, -100.0, 10.0) var jump_velocity: float = -300.0\n@export_range(0.0, 1.0, 0.05) var jump_cutoff: float = 0.4\n@export_range(0.0, 0.3, 0.01) var coyote_time: float = 0.10\n\n@export_group(\"Death\")\n@export var fall_death_y: float = 600.0\n```\n\nThe matching `.tres` (just values; the schema is in the script):\n\n`entities/player/stats.tres`:\n```\n[gd_resource type=\"Resource\" script_class=\"PlayerStats\" load_steps=2 format=3]\n\n[ext_resource type=\"Script\" path=\"res://entities/player/player_stats.gd\" id=\"1_stats\"]\n\n[resource]\nscript = ExtResource(\"1_stats\")\nspeed = 130.0\nacceleration = 1500.0\njump_velocity = -300.0\njump_cutoff = 0.4\ncoyote_time = 0.1\nfall_death_y = 600.0\n```\n\nThe entity script slots the resource:\n\n```gdscript\nextends CharacterBody2D\n@export var stats: PlayerStats # appears in the Inspector as a slot\n\nfunc _physics_process(delta: float) -> void:\n velocity.x = move_toward(velocity.x, stats.speed * dir, stats.acceleration * delta)\n```\n\nIn the entity's `.tscn`, set the `stats` property to point at `entities/player/stats.tres`.\n\n## Single-file shape (for 1–2 knobs)\n\nDon't make a Resource for two values. Inline `@export` on the entity script:\n\n```gdscript\nextends Area2D\n@export_group(\"Bob\")\n@export_range(0.0, 8.0, 0.5) var bob_amplitude: float = 2.0\n@export_range(0.2, 2.5, 0.1) var bob_period: float = 1.2\n```\n\nEach coin instance can override these in its scene Inspector. No `.tres` needed.\n\n## When to use which\n\n| Tunable count | Pattern |\n|---|---|\n| 1–2, used by one entity | `@export` on the entity script |\n| 3+, used by one entity | Resource subclass + one `.tres` |\n| Same shape used by multiple entity classes | Resource subclass + multiple `.tres` (e.g. `goblin_stats.tres`, `boss_stats.tres`) |\n\nReuse case: if you want a \"fast\" and a \"heavy\" player, save two `PlayerStats` resources (`fast.tres`, `heavy.tres`) and let the level pick which one to load.\n\n**Platform note — manifest tunables never live in a `.tres`.** Player-facing tunables (the birth manifest's `tunables`) are applied by rewriting top-level `const`/typed-var declarations in `.gd` files. A value set in a `.tres` SHADOWS the script default, so a manifest tunable whose runtime value comes from a `.tres` ships a slider that does nothing. Keep manifest-exposed knobs as top-level declarations in a `.gd` file; use the Resource pattern for everything else.\n\n## `@export_group`, `@export_range`, `@export_subgroup`\n\nGroup related tunables in the Inspector — makes the editing UX dramatically better:\n\n```gdscript\n@export_group(\"Movement\")\n@export_range(50.0, 400.0, 5.0) var speed: float = 130.0\n\n@export_group(\"Jump\")\n@export_range(-600.0, -100.0, 10.0) var jump_velocity: float = -300.0\n```\n\n`@export_range(min, max, step, ...)` exports a range. The optional 3rd argument sets the increment; omitting it still exports a range. Integer steps default to 1; float steps use the Inspector's default-float-step setting. Supply an explicit step when increments matter. Optional flags after step: `\"or_greater\"`, `\"or_less\"`, `\"hide_slider\"`.\n\n`@export_enum(\"Easy\", \"Normal\", \"Hard\")` for picklists.\n\n`@export_color_no_alpha` for opaque colors. `@export_node_path(\"CharacterBody2D\")` for typed node paths.\n\n## Loading and saving Resources at runtime\n\n```gdscript\n# Load a .tres (cached by Godot — same path returns the same instance)\nvar preset := load(\"res://entities/player/stats.tres\") as PlayerStats\n\n# Save a Resource (e.g. for save files)\nResourceSaver.save(stats, \"user://my_player.tres\")\n\n# Make a runtime copy (so edits don't mutate the shared instance)\nvar local := stats.duplicate(true) as PlayerStats\n```\n\n`load(path)` returns a cached instance — multiple call sites get the same object. If two entities share a stats resource and one mutates it, both see the change. Use `duplicate(true)` for a deep copy when that matters.\n\n## Anti-patterns\n\n- A `Resource` for one float. That's just `@export var x: float`.\n- Hardcoded constants in the entity script that should be tunable. `const JUMP := -300` is wrong; `@export var jump := -300.0` is right. A knob exposed via the birth manifest's `tunables` must be declared at COLUMN 0 in a `.gd` file, but it does NOT have to be a `const`: the panel's own matcher (`workspace/tunables.ts` `declPattern`) accepts `const`, `var`, a typed `var`, `@export var` and `@export_range(...) var` alike. This paragraph used to say `const` was mandatory, which pushed authors away from the idiomatic `@export` spelling for the exact knobs the panel exists to expose.\n- Mutating the shared `.tres` via `stats.speed = 99` at runtime. That edits the loaded instance and persists across the session — usually a bug. Use `duplicate(true)` or copy values into a local var.\n- Resource fields without type hints. Without types, Godot can't validate the `.tres`, and the Inspector shows generic widgets.\n"
}SHA-256 of public snapshot: 8b5ab28343a78430b41e7d2ab0bb986bbba48cbe02027651dc614571ac1a8b07