# Scene Discipline — keeping a Godot project out of the doom loop

*The beginner failure mode has a name in the community: the doom loop —
fix one thing, break another, until the project is rubble and the AI is
confidently apologising. Godot's structure gives you the tools to refuse
the loop, if the build obeys these rules. Paste them into your AI
session alongside your frozen acceptance.*

1. **One scene, one job.** A scene does one thing (Player, Enemy,
   HUD, Level1). If a change needs two scenes edited, it is TWO
   changes — made and tested one at a time, in a stated order.
2. **The exact-change fence.** Every instruction to the AI names one
   scene or one script and the exact change. "Make this exact change
   and nothing else" is a complete instruction. Refactors across the
   project are forbidden unless the frozen acceptance is re-issued.
3. **project.godot is load-bearing.** Input mappings, autoloads, and
   display settings live there. The AI never rewrites it wholesale;
   it states the one line it wants changed and why, and you approve
   that line. Half of all "my game suddenly won't open" stories are
   this file.
4. **Autoloads: few and boring.** Global state (score, lives, the
   current level) lives in ONE autoload, named in this file before
   the build. New autoloads need a written reason in the project
   notes. Scenes talk through signals and that one autoload — never
   by reaching into each other's internals.
5. **Snapshot before every session.** Zip the project folder (or git
   commit) before an AI session touches it, labelled with the date
   and what the session is for. When — not if — a session goes wrong,
   you restore the snapshot instead of asking the AI to fix its way
   out. Reverting code is free; the doom loop is what's expensive.
6. **Test by playing, per change.** After each single-scene change:
   run the game (F5), play to the changed thing, confirm the win and
   lose states still work. A change that "shouldn't affect anything
   else" is exactly the change that does.
7. **One Godot version, pinned.** The project states its Godot
   version (this pack targets 4.x). No 3.x code, no "this tutorial
   used a different version but the idea is the same." API drift
   between versions is a top-three cause of AI Godot breakage.
8. **Name things like you mean it.** Scenes, nodes, and signals get
   plain names (Player, JumpTimer, coin_collected). The next session —
   possibly a different AI with no memory of this one — navigates by
   names alone. Clever names are a tax on every future fix.

*None of this makes the AI smarter. It makes its mistakes small,
local, and reversible — which is the whole game.*
