reckfellENGINE

The .rscene and .rprefab format

A complete level with two prefab instances, an external style and a saved signal; file structure and UIDs.

On this page

Run the complete example

In a Reckfell 1.0.0 C# project create these files at the shown paths relative to asset://. Put FormatGallery2D.cs at the project root. Attach it to an Entity2D in a separate level, set a 640×420 base viewport, build C# and press F6. Two blue objects appear. The right one is larger; × deletes only its own instance.

Two prefab instances sharing an external style with different transforms

Assets/BadgeStyle.rdata
Configuration
[reckfell_resource type="StyleBoxFlat" format=3]

[resource]
bg_color = Color(0.18, 0.36, 0.95, 1)
corner_radius_top_left = 12
corner_radius_top_right = 12
corner_radius_bottom_left = 12
corner_radius_bottom_right = 12
Actors/Badge.rprefab
Configuration
; This comment is not retained by ResourceSaver.
[reckfell_tree format=3]

[ext_resource type="StyleBox" path="asset://Assets/BadgeStyle.rdata" id="Style"]

[entity name="Badge" type="Entity2D" groups=["format_badges"]]

[entity name="Panel" type="Panel" parent="."]
offset_right = 112.0
offset_bottom = 64.0
mouse_filter = 2
theme_override_styles/panel = ExtResource("Style")

[entity name="Mount" type="Entity2D" parent="."]

[entity name="Pivot" type="Marker2D" parent="."]
unique_name_in_owner = true
position = Vector2(56, 32)

[entity name="Remove" type="Button" parent="."]
offset_left = 76.0
offset_top = 12.0
offset_right = 102.0
offset_bottom = 52.0
text = "×"

[connection signal="pressed" from="Remove" to="." method="queue_free"]
Levels/FormatShowcase.rscene
Configuration
[reckfell_tree format=3]

[ext_resource type="PackedEntity" path="asset://Actors/Badge.rprefab" id="Badge"]

[entity name="FormatShowcase" type="Entity2D"]

[entity name="Left" parent="." instance=ExtResource("Badge")]
position = Vector2(100, 190)

[entity name="Right" parent="." instance=ExtResource("Badge")]
position = Vector2(350, 190)
scale = Vector2(1.25, 1.25)
FormatGallery2D.cs
C#
using Reckfell;

public partial class FormatGallery2D : Entity2D
{
    public Entity2D Gallery { get; private set; } = null!;

    public override void _Ready()
    {
        var packed = ResourceLoader.Load<PackedEntity>("asset://Levels/FormatShowcase.rscene");
        if (packed is null || !packed.CanInstantiate())
        {
            ReckfellApi.PrintErr("Cannot load FormatShowcase.rscene");
            return;
        }
        Gallery = packed.Instantiate<Entity2D>();
        AddChild(Gallery);
        AddChild(new Label
        {
            Position = new Vector2(28, 24),
            Text = TranslationServer.GetLocale().StartsWith("ru")
                ? "Уровень: два экземпляра одного префаба"
                : "Level: two instances of one prefab"
        });
        foreach (string name in new[] { "Left", "Right" })
        {
            var instance = Gallery.GetEntity<Entity2D>(name);
            var pivot = instance.GetEntity<Marker2D>("%Pivot");
            instance.AddChild(new Label { Position = new Vector2(0, 84), Text = name + " · %Pivot " + pivot.Position });
        }
    }
}

Read the tree

The first [reckfell_tree] tag identifies a PackedEntity tree. It is followed by ext_resource, sub_resource when needed, entity and connection entries. A .rdata file starts with [reckfell_resource type="..."]; its main resource properties follow [resource].

EntryMeaning
ext_resourceAn external asset reference with path, type and local id
sub_resourceA resource embedded in this file, not a separate neighboring asset
ExtResource("Badge")A reference to an external resource's local id
SubResource("Shape")A reference to an embedded resource's local id
entity with typeCreation of the specified Entity class
entity with instanceInstantiation of a PackedEntity
parent="."An immediate child of this file's root
connectionA saved signal → method connection using from/to Entity paths

id="Badge" is a local reference label, not a global UID. parent is an Entity-tree path, not a filesystem path. Left/Right position and scale are instance overrides; they do not rewrite Badge.rprefab. Both instances use one external StyleBox; changing that shared resource can affect both.

Ordinary child entries restore their owner to the prefab root here. In C#, AddChild alone does not assign Owner; see programmatic packing. The native fixture verifies actual owner scopes and the saved signal rather than only successful text parsing.

UIDs and local identifiers

A header uid="uid://..." identifies the file. An entity unique_id helps serialization track an Entity entry; UniqueNameInOwner and %Pivot instead locate an object within an Owner scope. These values are not interchangeable and are not network IDs.

A UID neither contains the file nor discovers every moved file by itself. It needs a UID → path registry. In runtime, ResourceLoader.GetResourceUid reads that registry; the checked editor-mode source can also read headers through resource loaders. ResourceUid.PathToUid can return the original path when no UID is known. The fresh-process check explicitly rebuilds the generated fixture asset's mapping; it does not establish automatic user:// discovery.

Address player saves in user:// through your own schema and stable gameplay IDs. ResourceSaver.SetUid does not register a runtime mapping. In this checked build, a user:// case returns Ok but leaves a temporary .uidren without replacing the original file; the example does not rely on that method.

Diagnose a failed load

SymptomCheck
Unrecognized type or parse failureHeader, extension, quoting, value types and the reported line
Saved with newer format versionDo not edit the number to bypass it; open with a build supporting the data
Missing external resourcepath, local id and required asset import
Entity lookup failsName and parent; for %Name also Owner and UniqueNameInOwner
Comments or default values disappearSaver normalization, not proof of lost gameplay behavior

Semicolon comments and optional spacing do not retain their original formatting after saving. The older load_steps field is neither an Entity count nor the engine version; the current saver omits it. Let the editor preserve unique_id/parent_id_path/owner_uid_path for arbitrary nested trees rather than inventing them manually.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.