Skip to content

Outdated or incorrect binary serialization API #4945

@Aurora2500

Description

@Aurora2500

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

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