Skip to content

Sockets specification

Sockets are currently available with Windows and Mac support only. Linux coming soon.

You can use https://github.com/RLBot/RLBot/tree/master/src/main/cpp/RLBotInterface/src as a reference implementation in c++.

Data Format

Unless otherwise specified, data is sent and received on the socket in this format:

  • First two bytes are an integer (big-endian) which specifies the data type (see list below).
  • Next two bytes are an integer (big endian) which specifies the number of bytes in the payload.
  • Remaining bytes are a payload. The logic for parsing it will depend on the data type, but generally it will be binary data in flatbuffer format. Using tools provided by Google (i.e. flatc.exe) and rlbot.fbs you can auto-generate code in various languages suitable for writing / parsing the payload data.

Data Types

Types expected to flow from RLBot to the client are in bold. Some are bi-directional.

  1. Game tick packet (arrives at a high rate according to /Tick-Rate except "desired tick rate" is not relevant here)
  2. Field info (sent once when a match starts, or when you first connect)
  3. Match settings (sent once when a match starts, or when you first connect)
  4. Player input
  5. Actor mapping data (deprecated, related to Remote RLBot)
  6. Computer id (deprecated, related to Remote RLBot)
  7. Desired game state
  8. Render group
  9. Quick chat
  10. Ball prediction (sent every time the ball diverges from the previous prediction, or when the previous prediction no longer gives a full 6 seconds into the future).
  11. Ready Message (clients must send this after connecting to the socket)
  12. Message Packet: List of messages, having one of the following types:
    • PlayerStatEvent - Event when a player performs an action or earns an accolade recognized in statistics, e.g. BicycleHit, HatTrick, MostBoostPickups.
    • PlayerSpectate - Spectator camera is now focusing on a new player.
    • PlayerInputChange - Human or bot has touched their controller, e.g. turned on boost, changed steering, etc.

RLBot v5

  1. None
    • Aka the disconnect request.
  2. GameTickPacket
    • Received by sessions at a high rate according to tick rate (except "desired tick rate" is always 120hz in v5)
  3. FieldInfo
    • Received by a session after it sends ConnectionSettings.
  4. StartCommand
    • Starts a new match after reading the given config file.
  5. MatchSettings
    • Received by a session after it sends ConnectionSettings.
    • Can be sent by sessions to start a new match.
  6. PlayerInput
    • Sent by sessions to control their cars.
  7. DesiredGameState
    • Sent by sessions to change the game state.
    • Ignored if state setting was disabled in the match settings.
  8. RenderGroup
    • Sent by sessions to render lines & text in the game.
    • Ignored if render setting was disabled in the match settings.
  9. RemoveRenderGroup
    • Sent by sessions to remove a render group.
    • Ignored if render setting was disabled in the match settings.
  10. MatchComm
    • A copy is received by sessions when another session sends the message.
    • Messages may not be received if the message was filtered due to team_only being requested in the message.
    • Only received if enabled in ConnectionSettings.
  11. BallPrediction
    • Received by sessions right before every GameTickPacket if enabled in ConnectionSettings.
  12. ConnectionSettings
    • Sessions send this immediately after connecting.
    • Tells the server what kind of data it wants to receive.
  13. StopCommand
    • Ends the current match, and optionally tells RLBotServer.exe to shut itself down.
  14. SetLoadout
    • Sent by sessions to change the loadout of their cars.
    • Will always work if a loadout was not specified in match settings and when sent before InitComplete.
    • Ignored if state setting was disabled in the match settings, and a loadout was set in match settings.
  15. InitComplete
    • Indicates that the session has finished all initialization and is ready to start receiving game messages without delay.
    • The match will not start until all sessions have sent this message.
    • SpawnId will be used to set the name of the session in RLBot's performance monitor and when filtering messages. Hiveminds should simply send the first spawn id they received from the framework.

Connecting

Prerequisites (handled automatically by RLBotGUI / the RLBot framework):

  • Rocket League must be running under the -rlbot flag.
  • RLBot.exe must be running. After it successfully connects to Rocket League, it will start listening on TCP port 23234.

  • As a client, connect to TCP port 23234. Note: please expect to receive the port as a parameter in the future rather than hard coding

  • Send a 'ready' message, as defined here. Be sure to use the data format explained above (two bytes for data type, two bytes for size...)

Some attributes in the ready message are not used yet. Once you're connected, you will start receiving data on the socket, with one of the data types specified above.

Sending Data

Send data to the same TCP socket, using the same format (two bytes for type, two bytes for size). You can send match settings (starts a new match), player input, desired game state, render group, and quick chat.

Consult google.github.io/flatbuffers to learn how to construct the byte array for your payload in the language of your choice.

Client Libraries

Python

Who's Using Sockets