Skip to main content

Generic Initialization Data

This packet is sent by the server to the client while joining a game. It contains the initialization data related to Lua scripts that can store data. The only known use of this packet is to send the terrain data to the client.

  • ID: 0x0B (11)
  • Size: Variable
  • LZ4 Compressed: Yes
  • State: Joining
  • Bound To: Server -> Client

Structure

Field NameField TypeNotes
Game Tickbe u32The tick when the server sent this packet.
DataBlobData[Until EOS]The data the scripted classes are initialized with. This array is read until the end of the packet.

BlobData Payloads

In this subsection, UIDs of known BlobData and their payloads are listed. This is not guaranteed to be an exhaustive list.

World Info

This BlobData contains information about the world the player is currently joining.

  • UID: 3ff36c8b-93f7-4428-ae4d-429a6f0cf77d
  • Key: The ID of the world, stored as le u32
  • World ID: The ID of the world
  • Flags: 13 (0b1101)

Payload

This structure contains all parameters passed to sm.world.createWorld() when the world was created.

Field NameField TypeNotes
Seedbe u32The seed of the world.
FilenameStringThe filename of the world.
ClassnameStringThe classname of the world.
Terrain ParamsStringA stringified JSON object containing the terrain parameters of the world.

Gameplay Options

This BlobData contains the gameplay options of the world.

  • UID: 44ac020c-aec7-4f8b-b230-34d2e3bd23eb
  • Key: 0, stored as le u32
  • World ID: No World
  • Flags: 15 (0b1111)

Payload

This structure stores the difficulty, multiplayer setting and the physics quality.

Field NameField TypeNotes
OptionsStringA stringified JSON object containing the gameplay options of the world.

Example

{"Difficulty":1,"Multiplayer":2,"PhysicsQuality":8}\n

  • Difficulty: The difficulty of the game as returned by sm.game.getDifficulty().
    • 0 is Easy
    • 1 is Normal (default)
  • Multiplayer: The multiplayer setting of the game.
    • 0 is Private
    • 1 is Friends Only
    • 2 is Friends of Friends (default)
    • 3 is Public
  • PhysicsQuality: The quality of the physics simulation.
    • 0 is Simple 1
    • 8 is Advanced (default)

Player Data

This BlobData contains information about a player.

  • UID: 51868883-d2d2-4953-9135-1ab0bdc2a47e
  • Key: The ID of the player, stored as le u32
  • World ID: No World
  • Flags: 13 (0b1101)

Payload

Field NameField TypeNotes
Character IDbe u32The ID of the character of the player.
Steam ID 64be u64The Steam ID of the player.
Inventory Container IDbe u32The ID of the inventory container of the player.
Carry Container IDbe u32The ID of the carry container of the player.
Carry Colorbe u32The color of the part the player is currently carrying. Stored as 0xAABBGGRR. 0xFFFFFFFF if the player is not carrying anything.
Unknownu8
Name Sizeu8The size of the name of the player.
Namechar[Name Size]The name of the player, encoded in UTF-8.
Character CustomizationCharacter CustomizationThe customization options of the character of the player.