Reckfell architecture principles
Parent versus base class, Entity composition, shared resources, prefabs and editor code.
Two different relationships
Entity hierarchy and C# inheritance solve different problems.
| Relationship | Determines | Does not do |
|---|---|---|
| Tree parent and child | Object structure, compatible transforms, entering and leaving the tree | Does not make the child inherit the parent’s C# class |
| Type inheritance | Available properties, methods and class behavior | Does not add an object to the tree |
| Owner | Which objects enter a saved tree | Does not replace Parent or define a C# base class |
A Player inside World does not imply class Player : World. CharacterBody3D inherits capabilities from physics and spatial base classes independently of its parent’s name. See Entities, levels and prefabs.
Compose an object from appropriate Entities
Start with a root responsible for the main behavior. A controlled character can use CharacterBody3D. Its MeshInstance3D and CollisionShape3D children supply visuals and collision shape; Camera3D can belong to the level separately or be part of the character hierarchy.
Adding a child Entity is not equivalent to adding an ECS component. Reckfell uses objects in a typed hierarchy with their own lifecycle. Do not import assumptions about flat entity IDs and batched ECS processing without checking the actual architecture.
The 3D example separates visuals from the physics body: visual animation should not accidentally change collision geometry. Choose _Process or _PhysicsProcess for the behavior’s update needs; key concepts explains lifecycle order.
Reuse trees and account for shared data
A .rscene level and .rprefab prefab have different roles but both use PackedEntity. The file describes a tree; Instantiate creates an instance and AddChild adds it to the hierarchy. Instantiation shows the complete sequence.
Changing a source and overriding a property locally on an instance are different edits. Account for saved overrides when checking a new prefab version: a source change cannot be assumed to replace every value on every instance.
Resources can be shared. If two objects use one Material, changing that resource can affect both. For an independent variation, create a copy and assign it to the intended object; check nested resources separately. Copying an outer container does not always make all its contents independent.
Game scripts and editor code
Game examples use C#. The editor supplies its own tools and supports extensions, but its C++ source is not an ordinary game project containing project.reckfell.
The C# [Tool] attribute allows a script to execute in the editor. Such code can change edited data, so separate editor actions from gameplay behavior. See running code in the editor for details and working examples.
Make an architecture decision
Choose one gameplay object and verify its creation, reuse, deletion and a level restart. Establish correctness first, then measure its workload in the target project. Performance helps identify a specific slow-frame cause; hierarchy size or genre name does not replace measurement.