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

class_hierarchy

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

RefCounted vs Node vs Resource comparison

Use RefCounted for pure data/logic that auto-frees when out of scope (Intent, WorldState). Use Node for things in the scene tree (UI, gameplay). Use Resource for saveable, shareable asset-like data (custom items, configs). Use Object only in rare cases requiring manual memory management.

RefCounted auto-cleanup example

RefCounted instances are automatically freed when their last reference is released. Example: var d := DataPack.new() will auto-free when d goes out of scope.

RefCounted vs Node for game systems

Use RefCounted for: WorldState (data + queries), Parser (pure logic), ActionResolver, SaveSystem (static methods). These get auto-freed and simplify memory management. Use Node for: Audio Manager (needs to be in tree), Tutorial System (uses _process), UI components, anything that belongs in scene tree.

Composition over inheritance for game systems

Compose independent components instead of deep inheritance chains. Bad: class_name MagicalKnight extends KnightCharacter (inherits 15 layers). Good: class_name Player extends CharacterBody2D with @onready inventory: InventoryComponent, combat: CombatComponent, dialogue: DialogueComponent. This makes features independent and testable.

Give your agent this brain