Skip to content

Binary serialization API about RID is incorrect #10662

Open
@beicause

Description

@beicause

Your Godot version:
4.4 latest

Issue description:
The document states that RID doesn't support serialization, but in fact RID can be serialized and deserialized (as int64) using var_to_bytes and bytes_to_var, even if the corresponding resource can't be serialized and may not be valid. For example var_to_bytes(rid_from_int64(13)) returns [23,0,0,0,13,0,0,0,0,0,0,0]

serialize:
https://github.com/godotengine/godot/blob/36d90c73a843afa2807a0b8dcbfbf52bdb8a759c/core/io/marshalls.cpp#L1732-L1739

deserialize:
https://github.com/godotengine/godot/blob/36d90c73a843afa2807a0b8dcbfbf52bdb8a759c/core/io/marshalls.cpp#L689-L697

URL to the documentation page:
https://docs.godotengine.org/en/latest/tutorials/io/binary_serialization_api.html#rid-unsupported

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:manualIssues and PRs related to the Manual/Tutorials section of the documentationbug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions