godotengine / godotengine/godot-docs

Binary serialization API about RID is incorrect

Open
#10,662 2 comments 0 reactions 0 assignees View on GitHub
area:manual bug
Dominant language
reStructuredText
Stars
5.7k
Forks
3.8k
Avg merge
1d 20h
Merged PRs (30d)
25

Description

**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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.