Unreliable Update
This packet is unreliably sent every tick.
- ID: 0x18 (24)
- Size: Variable
- LZ4 Compressed: Yes
- State: Playing
- Bound To: Server -> Client
Structure
Offset | Field Name | Field Type | Notes |
---|---|---|---|
0x00 | Server Tick | be u32 | The server tick number. The same value as returned by sm.game.getServerTick() . |
0x04 | Current Tick | be u32 | The current tick number. The same value as returned by sm.game.getCurrentTick() . |
0x08 | Update Count | u8 | The amount of NetObj updates. |
0x09 | Updates | Update[Update Count] | The NetObj updates. |
Update
Offset | Field Name | Field Type | Notes |
---|---|---|---|
0x00 | Size | u8 | The size of the entire update structure, including this field. |
0x01 | Type | enum NetObjType : u8 | The type of the NetObj to update. |
0x02 | Update Data | ... (Size - 2 bytes) | The update data for the NetObj . This depends on the value of Type. |
NetObjType Enum
This is an exhaustive list. Updates with values not listed in this table print an error in the console.
ID | Name | Unreliably Updateable |
---|---|---|
0 | RigidBody | ✅ Yes |
1 | ChildShape | ❌ Not implemented |
2 | Joint | ❌ Not implemented |
3 | Controller | ✅ Yes |
4 | Container | ❌ Not implemented |
5 | Harvestable | ❌ Not implemented |
6 | Character | ✅ Yes |
7 | Lift | ❌ Not implemented |
8 | Tool | ❌ Not implemented |
9 | Portal | ❌ Not implemented |
10 | PathNode | ❌ Not implemented |
11 | Unit | ❌ Not implemented |
12 | VoxelTerrainCell | ❌ Not implemented |
13 | ScriptableObject | ❌ Not implemented |
14 | ShapeGroup | ❌ Not implemented |
NetObjType 0 - RigidBody
Offset | Field Name | Field Type | Notes |
---|---|---|---|
0x00 | Body ID | be u32 | The ID of the rigid body to update. |
0x04 | Rotation | Quat | The world rotation of the rigid body. |
0x14 | Position | Vec3f | The world position of the rigid body. |
0x20 | Velocity | Vec3f | The velocity of the rigid body. |
0x2C | Angular Velocity | Vec3f | The angular velocity of the rigid body. |
0x38 | Is Awake | bool : 1 bit | Whether or not the rigid body is awake. |
0x38 + 1 bit | Revision | u8 : 7 bits | The revision of the rigid body. Overflows back to 0 after reaching 127 . |
NetObjType 3 - Controller
Offset | Field Name | Field Type | Notes |
---|---|---|---|
0x00 | Interactable ID | be u32 | The ID of the interactable to update. |
0x04 | Data | Variable | The data of the update. The size and structure depend on the type of the interactable, which is not specified in this update packet. |
NetObjType 6 - Character
Parsing and building this structure requires the use of a BitStream. See BitStream for more information.
Offset | Field Name | Field Type | Notes |
---|---|---|---|
0x00 bits | Character ID | be u32 | The ID of the character to update. |
0x20 bits | Is Tumbling | bool | Whether or not the character is tumbling. |
0x21 bits | ... | Not Tumbling | Tumbling | The character data. See Not Tumbling and Tumbling for more information. |
Not Tumbling
If the Is Tumbling
field is False
, the following fields are present:
Offset | Field Name | Field Type | Notes |
---|---|---|---|
0x21 bits | Keys | bitfield Keys : u8 | Bitfield of which movement keys are pressed. |
0x29 bits | Direction | u8 | The horizontal direction is moving or last moved in. From a top-down view, a value of 0 indicates the character is moving right. Increasing value of the direction integer rotates the direction counter-clockwise, so a value of 64 indicates forwards, 128 left and 192 backwards. |
0x31 bits | Yaw | u8 | The player's horizontal look rotation. A yaw of 0 means the player is looking into the positive Y direction. Rotating counter-clockwise (to the left) increases the yaw. After reaching 255 , the yaw overflows back to 0 . |
0x39 bits | Pitch | u8 | The player's vertical look rotation. A pitch of 0 means the player is looking straight down (into the negative Z direction). Looking straight up yields a pitch of 128 . |
0x41 bits | Position | Vec3f | The world position of the character. |
Tumbling
If the Is Tumbling
field is True
, the following fields are present:
Offset | Field Name | Field Type | Notes |
---|---|---|---|
0x21 bits | Rotation | Quat | The world rotation of the character. |
0x41 bits | Position | Vec3f | The world position of the character. |
0x59 bits | Velocity | Vec3f | The velocity of the character. |
0x71 bits | Angular Velocity | Vec3f | The angular velocity of the character. |
Keys bitfield
This structure is the same as the Keys bitfield in the 30 - Player Movement packet.
Contains information about which movement keys are pressed. All bits are always low while the player's character is seated.
Bits | Field name | Notes |
---|---|---|
7 | Unknown | Not known to be anything other than low. |
6 | ||
5 | ||
4 | Aiming | High when the player is aiming with a Spud Gun, low otherwise. This value is set using Tool:setMovementSlowDown and read using Character:isAiming |
3 | Sprint | High when the player is sprinting while moving horizontally. Low in all other cases, including when the player is holding the Sprint button while standing still. |
2 | Horizontal | High when any of the Move Forward, Move Backward, Stafe Left or Strafe Right keys are pressed. |
1 | Crawl | High when the player is holding the Crawl (crouch) keybind. This is not connected to the actual crawl state of the player's character. If the character is crawling and unable to stand up, the value can be either high or low depending on whether the player is holding the Crawl key or not. |
0 | Jump | High when the player is holding the Jump button. The player's character does not have to be on the ground. |
Vec3f
Offset | Field Name | Field Type | Notes |
---|---|---|---|
0x00 | X | be float | The 32-bit, floating point, X coordinate. |
0x04 | Y | be float | The 32-bit, floating point, Y coordinate. |
0x08 | Z | be float | The 32-bit, floating point, Z coordinate. |
Quat
Offset | Field Name | Field Type | Notes |
---|---|---|---|
0x00 | X | be float | The 32-bit, floating point, X coordinate. |
0x04 | Y | be float | The 32-bit, floating point, Y coordinate. |
0x08 | Z | be float | The 32-bit, floating point, Z coordinate. |
0x0C | W | be float | The 32-bit, floating point, real, W coordinate. |