Open Aurora2500 opened 3 years ago
This problem is much bigger, there are actually 38 different packet types which you only discover when directly looking at the source code (for instance Vector2I, Rect2I, Vector3I and so on) or when you implement the types by following the documentation but notice that everything after vector2 (ID 5) is off. It is also said that all packets have a 4 byte header, but nowhere is mentioned that packets have a size in the header, while packets inside others (like in dictionary) dont have that size component in the header.
Im currently slowly working my way through all possible types. Generating the files by the engine, looking at them in a hex editor and incorporating that into my own library. Im going to update the documentation when Im done
Your Godot version: 3.3 Stable
Issue description: In the documentation, it is stated that
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:Or when doing
store_var(42)
, I'd expect to get a file with the following binary data: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:Or when I store
42
: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