godotengine / godotengine/godot-docs

Outdated or incorrect binary serialization API

Open
#4,945 8 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:**
3.3 Stable

**Issue description:**
In the documentation, it is stated that
> All packets have a 4-byte header representing an integer, specifying the type of data.
> Following this is the actual packet contents, which varies for each type of packet.

Because of this, I'd expect 4 bytes being taken up as a header, indicating which type it is and some other flag information. And then following that I'd get the data for the type, if any.

So when doing `store_var(null)`, I'd expect there to be 4 bytes all filled with 0:
```
00000000 00000000 00000000 00000000
```

Or when doing `store_var(42)`, I'd expect to get a file with the following binary data:
```
00000010 00000000 00000000 00000000
00101010 00000000 00000000 00000000
```

But instead, there seems to be an extra 4 bytes in front of the header for each data packet.
When I store `null`, I get:
```
00000100 00000000 00000000 00000000
00000000 00000000 00000000 00000000
```
Or when I store `42`:
```
00001000 00000000 00000000 00000000
00000010 00000000 00000000 00000000
00101010 00000000 00000000 00000000
```

The documentation does not indicate what these extra bytes mean, or mention that they should exist at all.

**URL to the documentation page:**
https://docs.godotengine.org/en/stable/tutorials/misc/binary_serialization_api.html

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.