← ExekiteCONTENT HISTORY

Update to Exekite

Snapshot Nov 17, 2026 · 12:11 UTC · version 1.0.0

Collection source: downloaded plugin package.

WHAT CHANGED

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 JSON
Full technical diff · 0 changed fields
Full snapshot data
{
  "description": "For Exekite-hosted Godot games only. queue_free hazards — a freed node lingering in an array/pool aborts _process mid-frame and can make the game unwinnable. Use when entities you free are also tracked in a collection, when a 'previously freed instance' error appears, or when pooled/despawned objects still collide or emit.",
  "included_files": [],
  "name": "entity-lifecycle",
  "skill_md_contents": "---\nname: entity-lifecycle\ndescription: \"For Exekite-hosted Godot games only. queue_free hazards — a freed node lingering in an array/pool aborts _process mid-frame and can make the game unwinnable. Use when entities you free are also tracked in a collection, when a 'previously freed instance' error appears, or when pooled/despawned objects still collide or emit.\"\n---\n\n# Entity lifecycle\n\nExposed by a real birth (Temple-A): collected entities were `queue_free()`d but\nkept in a live array. Every later frame called a method on a freed instance,\nwhich throws, which aborts the rest of `_process` — so the win condition was\nnever reached and the game was **unwinnable**. Detection today: **none before\nruntime**. Parse and scene both pass; only actually playing it shows the error.\n\n## `queue_free()` does not clear your references\n\nIt frees the node at the end of the frame. Every array, dictionary and `var`\nstill holding it now holds a dangling reference, and touching one throws\n`Invalid call. Nonexistent function 'x' in base 'previously freed'.`\n\n```gdscript\n# WRONG — the array still holds the freed node\nfunc _collect(coin: Node) -> void:\n    coin.queue_free()\n    _score += 1\n# next frame:\nfor c in _coins:          # `c` is freed; c.position throws\n    c.position.y += sin(t)\n```\n\n```gdscript\n# RIGHT — remove it from your bookkeeping in the same breath\nfunc _collect(coin: Node) -> void:\n    _coins.erase(coin)\n    coin.queue_free()\n    _score += 1\n```\n\n## `is_instance_valid()` is the guard, and it is not free\n\nWhen you cannot guarantee ownership — anything reachable from a signal, a\ntimer, or another system — check before use:\n\n```gdscript\nif is_instance_valid(_target) and not _target.is_queued_for_deletion():\n    _target.take_damage(1)\n```\n\n`is_instance_valid` is true for a node that is *queued* but not yet freed, which\nis why the second half matters inside the same frame as the `queue_free`.\n\nPrefer not needing it. A filter each frame is cheaper to reason about than a\nguard at every use site:\n\n```gdscript\n_enemies = _enemies.filter(func(e): return is_instance_valid(e))\n```\n\n## Hide, do not free, when it comes back\n\nBullets, particles, pickups that respawn — freeing and re-instancing each time\ncosts allocation and gives you this whole class of bug for nothing.\n\n```gdscript\nfunc _despawn(b: Node2D) -> void:\n    b.visible = false\n    b.set_physics_process(false)\n    b.global_position = Vector2(-9999, -9999)   # out of every area's reach\n    _pool.append(b)\n```\n\nTurn processing OFF as well as visibility. A hidden node still runs\n`_physics_process`, still collides, and still fires `body_entered` — an\ninvisible bullet that still kills the player is a very confusing bug.\n\n## Freeing during iteration\n\nNever free while iterating the same collection. Collect, then act:\n\n```gdscript\nvar dead: Array[Node] = []\nfor e in _enemies:\n    if e.hp <= 0:\n        dead.append(e)\nfor e in dead:\n    _enemies.erase(e)\n    e.queue_free()\n```\n\n## Signals outlive the emitter's usefulness\n\nBound-method connections are cleaned up automatically when either side is\nfreed — you do not need `_exit_tree()` disconnects for\n`sig.connect(self.method)`. LAMBDA connections are the trap:\n`sig.connect(func(): self.do())` is not owned by `self`, survives its free,\nand throws when the body touches the freed capture. Prefer bound methods for\nanything the emitter outlives, or disconnect the lambda in `_exit_tree()`.\n\n## The check that makes this visible\n\nAn unwinnable game is the expensive outcome, so assert the invariant rather than\nhoping:\n\n```gdscript\nfunc _process(_d: float) -> void:\n    for e in _enemies:\n        if not is_instance_valid(e):\n            push_error(\"a freed node survived in _enemies — the loop will abort here\")\n            return\n```\n\n`push_error` reaches stderr, which the boot and playtest tiers read.\n"
}

SHA-256 of public snapshot: ac623a961a2d8efd681378568931184b78b8835844854d5f90fed7483868b876