new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Godot 4 Patterns · all subjects

game_architecture

5 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

3-layer architecture rule

Game architecture should follow a 3-layer model: Presentation (scenes, nodes, UI, visual and audio output), Logic (pure GDScript classes, RefCounted, no Godot Node dependencies, testable in isolation), and Content (JSON, Yarn, CSV files, edited by designers, versioned and validated). Logic must NOT depend on Presentation. If a class cannot be unit-tested without instantiating a scene, the layers are mixed.

Dependency direction and signal flow

Dependencies should flow downward only: content_db (autoload, no deps) → worldstate (logic, depends on content_db) → action_resolver (logic, depends on worldstate, content_db) → main.gd (presentation, depends on all above) → ui scenes (presentation, depend only on main and signals). Never have UI calling logic which calls UI back. Use signals for upward feedback.

Content scaling phases from prototype to production

Phase 1 (prototype): hardcode rooms in GDScript, get loop working. Phase 2: extract content to JSON, write loader, designers can contribute. Phase 3: validation and hot-reload, content team scales. Phase 4: localization layer, translators contribute. Do phases sequentially, not all at once. Each phase un-blocks the next.

Keep main.gd thin and extract systems

If main.gd reaches 500+ lines, extract: input handling → InputController, scene transitions → SceneRouter, command processing → CommandRouter, achievement triggers → AchievementHooks (subscriber to signals). main.gd should only wire up scene refs, connect signals, and kick off intro.

When to refactor architectural issues

Refactor: before adding a similar feature for the 3rd time (first abstract), when tests stop passing for unrelated changes (coupling problem), when new team member needs >1 day to find where to add something (organize folders), when two devs touch same file (split file).

Give your agent this brain