Realtime messaging
Feature description
Section titled “Feature description”Realtime messaging is a sub-capability of Multiplayer lobby for sending custom data between players inside a room. Unity provides reliable channels and large-message fragmentation; Godot currently provides a JSON message entry point. Realtime messaging requires a room connection first and cannot be used before joining a room.
Supported engines
Section titled “Supported engines”| Engine | Status | Notes |
|---|---|---|
| Unity | Preview | Supports room messages, reliable transport, and large-message fragmentation. |
| GameMaker | Not supported | The first GameMaker release does not include realtime messaging. |
| Godot | In development | The preview runtime already supports sending and receiving JSON messages. |
Prerequisites
Section titled “Prerequisites”- The minimal Rooms flow is complete.
- A room has been joined.
- Message types must not use SDK-reserved types.
- Message content should keep a stable structure so both ends can parse it.
By engine
Section titled “By engine”using System;using UnityEngine;using IGP.UnitySDK;using IGP.UnitySDK.Models;
public sealed class IGPChatDriver : MonoBehaviour{ [SerializeField] private IGPRuntimeManager runtimeManager;
private void OnEnable() { runtimeManager.onMessageReceived.AddListener(OnMessageReceived); }
private void OnDisable() { runtimeManager.onMessageReceived.RemoveListener(OnMessageReceived); }
public async void SendChat() { await runtimeManager.SendMessageAsync(new Message { type = "chat.message", roomId = runtimeManager.CurrentRoomId, playerId = runtimeManager.PlayerId, reliable = true, content = new { text = "hello", sentAt = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(), }, }); }
private void OnMessageReceived(string messageType, object content) { Debug.Log($"Message {messageType}: {content}"); }}GameMaker currently does not support realtime messaging.
using Godot;using IGP.GodotSDK.Autoload;
public partial class ChatPanel : Control{ private IGPGodotAutoload IGP => GetNode<IGPGodotAutoload>("/root/IGP");
public override void _Ready() { IGP.MessageReceived += OnMessageReceived; }
public async void SendChat() { await IGP.SendMessageJsonAsync( "chat.message", "{\"text\":\"hello\"}", reliable: true); }
private void OnMessageReceived( string messageType, string roomId, string playerId) { GD.Print($"Message {messageType} from {playerId}"); }}Self-test
Section titled “Self-test”| Engine | Checkpoint |
|---|---|
| Unity | Two clients are in the same room; after one sends a message, the other receives onMessageReceived. |
| GameMaker | Realtime messaging validation is not performed currently. |
| Godot | After sending a JSON message, the other endpoint receives the MessageReceived signal. |
Troubleshooting
Section titled “Troubleshooting”- Send succeeds but no message is received: confirm both clients are in the same room.
- Content parsing fails: validate with the simplest JSON string first.
- Unity large message send fails: prefer the reliable message entry point.
- Godot reports a reserved type error: use a business-defined message type name.