Entity simulation and AI
The entity code has two related but currently distinct runtime paths. Entity : Node3D is the source-style base with double-precision block coordinates and explicit movement state. Existing player and mob actors still derive from Godot CharacterBody3D through their current hierarchy; the shared migration is in progress. Do not assume a method on Entity automatically governs every mob.
Current ownership
Section titled “Current ownership”EntityTypedescribes registered entity identity and dimensions/scenes.Entityowns world attachment, position, delta movement, bounds, tick count, and source-style block collision movement for entities migrated to it.LivingMobowns health and shared living behavior on the current Godot body hierarchy.Mobadds attributes, look/move/jump controls, navigation, and goal selectors.- Concrete mobs register attributes and compose goals; goal types own one decision/action loop apiece.
WorldManagercoordinates spawning, ticking, and entity membership rather than holding species-specific behavior.
Goal scheduling
Section titled “Goal scheduling”A mob’s goals are registered with priorities and control flags. The selector decides which goals may run together; target selection and action goals are separate concerns. A new behavior should usually be a focused goal and be installed by the mob type, rather than adding another species branch to a world manager. Check whether the mob’s existing goals conflict over movement/look controls and confirm start, continuation, and stop conditions.
Attributes belong to an entity instance through AttributeMap; the registry-like attribute definitions specify identities/default semantics, while modifiers adjust the effective value. When tuning behavior, follow the path from declared base value through modifiers into the consumer (for example, movement control), including equipment/effect modifiers when relevant.
Persistence and migration
Section titled “Persistence and migration”Entity scene construction, registration, spawn rules, ticking, and saved fields are separate paths. A feature is not persistent merely because it works while the node remains in the scene. Trace entity serialization and type reconstruction, then check the porting plan for the remaining hierarchy migration and per-entity data gaps.
Useful starting points: src/Entity/EntityType.cs, Entity.cs, LivingMob.cs, Mob.cs, src/Entity/AI/Goal/, src/Entity/Attributes/, and src/Storage/EntityStorage.cs.