+1 vote

According to the docs for the binary serialization API

https://docs.godotengine.org/en/stable/tutorials/misc/binary_serialization_api.html

Each packet is stored with a 4 byte header indicating the type of the data stored, and then the data itself, depending on the type.

But when I use store_var, it seems like there is an aditional 4 bytes in the header of each packet.

When I execute store_var(42), I'd expect to see:

00000010 00000000 00000000 00000000
00101010 00000000 00000000 00000000

With the first 4 bytes being a 2, indicating that it is an int, and the last 4 bytes being the number 42 encoded in binary.
Instead what I get is:

00001000 00000000 00000000 00000000
00000010 00000000 00000000 00000000
00101010 00000000 00000000 00000000

And I can't seem to figure out what the first 4 bytes are meant to be here.
Is the documentation outdated?

Godot version 3.3 stable
in Engine by (13 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.