Game Message Router is a typed, Gameplay Tag based event bus for Unreal Engine. It provides fast local messaging and an explicit multiplayer transport for arbitrary reflected USTRUCT payloads in Blueprint and C++.
The local API follows the useful messaging pattern demonstrated by Lyra, but the plugin is standalone: it has no Lyra dependency and does not require custom GameMode, GameState, or PlayerController base classes.
Gameplay systems often need to communicate without owning direct references to each other. A typical project starts with casts, interfaces, event dispatchers, or subsystem calls, then accumulates several recurring problems:
- Hard coupling — senders must know which object receives an event and how to find it.
- Inconsistent payloads — every dispatcher or interface needs a separate signature.
- Fragile lifetime management — listeners can disappear, travel to another world, or be removed during a callback.
- No generic networking — a
UGameInstanceSubsystemis not replicated and cannot own RPCs. - RPC ownership restrictions — clients cannot call Server RPCs on arbitrary replicated actors.
- Unsafe client events — a generic client-to-server channel needs sender identity, allowlists, rate limits, and validation.
- Blueprint friction — a generic message node is not useful unless its payload pin becomes the selected structure type.
The plugin separates local routing from network transport.
| Responsibility | Implementation | Lifetime |
|---|---|---|
| Typed local dispatch | UGameMessageSubsystem |
Game instance |
| Multiplayer transport | UGameMessageNetworkSubsystem |
World |
| RPC ownership bridge | AGameMessageReplicator |
One per player |
| Generic network payload | FGameMessageNetworkPacket + FInstancedStruct |
One message |
| Blueprint typed output | Dedicated async K2 node | Listener lifetime |
This separation is intentional. A local broadcast never silently becomes network traffic, and a received network message enters the same local router used by normal listeners.
Sender
-> Gameplay Tag + USTRUCT payload
-> UGameMessageSubsystem
-> exact and/or parent-channel listeners
Client
-> Send Game Message To Server
-> client-owned AGameMessageReplicator
-> Server RPC
-> policy and rate-limit validation
-> server UGameMessageSubsystem
-> server listeners
Server
-> Send To Client / Send To All Clients
-> target player's AGameMessageReplicator
-> Client RPC
-> client UGameMessageSubsystem
-> client listeners
- Gameplay Tag channels.
- Exact channel or channel-and-children matching.
- Any reflected
USTRUCTpayload. - Blueprint and C++ APIs.
- Synchronous local delivery on the game thread.
- Strongly typed wildcard payload output in Blueprint.
- Reliable and unreliable network messages.
- Client to server, server to all clients, and server to one client delivery.
- Automatic owner-only replication bridges.
- Sender
PlayerControllercontext for messages received from clients. - Client channel allowlists and global channel blocklists.
- Per-client rate limiting.
- Configurable payload and startup queue limits.
- Listener priority and one-shot listeners in C++.
- Safe listener mutation during dispatch through snapshots.
- Standalone, listen server, dedicated server, and PIE support.
- Unreal Engine 5.7 or 5.8.
- Gameplay Tags enabled in the project.
- Payload values must be reflected
USTRUCTtypes.
The runtime module has no platform-specific dependency.
-
Copy the plugin directory to:
<YourProject>/Plugins/GameMessageRouter -
Enable Game Message Router in Edit > Plugins.
-
Restart the editor when requested.
-
Define message channels in Project Settings > Gameplay Tags.
-
Review networking policy in Project Settings > Plugins > Game Message Router before accepting client messages.
- Create a Blueprint Structure such as
ST_InventoryChanged. - Add a Gameplay Tag such as
Message.Inventory.Changed. - Call Broadcast Game Message (Local).
- Pass the tag and structure value.
- Add Listen For Game Messages.
- Select the channel and payload structure.
- Choose Exact Channel or Channel And Children.
- Read the typed
Payloadoutput whenOn Message Receivedfires. - Enable
Trigger Oncewhen only the first matching message is needed.
The listener also outputs Context:
Local— produced by a local broadcast.Server— received from the server by a client.Client— received from a client by the server.Context.Sender— the sending client'sPlayerController; only set on the server for client-originated messages.
| Node | Valid caller | Destination | Notes |
|---|---|---|---|
| Send Game Message To Server | Client or authority | Server | On authority, dispatches locally |
| Send Game Message To All Clients | Authority | Every connected client | Standalone dispatches locally |
| Send Game Message To Client | Authority | One PlayerController |
Requires a valid target player |
| Is Game Message Network Ready | Any | — | Useful for UI; startup sends can be queued |
Every network send explicitly selects Reliable or Unreliable delivery.
UGameInstanceSubsystem cannot replicate, so the plugin does not attempt to put RPCs on the message router itself.
On authority, UGameMessageNetworkSubsystem automatically creates one transient AGameMessageReplicator for each PlayerController. The actor is owned by that controller and only relevant to its owner. This satisfies Unreal's RPC ownership rules:
- the owning client can call Server RPCs on its bridge;
- the server can call Client RPCs for that specific player;
- broadcasting iterates the server's per-player bridges.
The payload is stored in FInstancedStruct. Unreal's native FInstancedStruct::NetSerialize transmits the structure type and its reflected data. When the RPC arrives, the transport creates an FGameMessageContext and forwards the payload into the receiver's local UGameMessageSubsystem.
No actor needs to be placed in a level, and projects do not need to inherit from plugin framework classes.
Network transport identifies the sending connection; it does not make client data trustworthy. Server listeners must still validate permissions and gameplay rules.
Before shipping a multiplayer project:
- Create a dedicated client-request root, for example
Message.ClientRequest. - Add it to
AllowedClientToServerChannelRoots. - Block server-only or sensitive roots through
BlockedNetworkChannelRoots. - Validate ownership, ranges, cooldowns, current state, and object references in the server listener.
- Tune
MaxClientMessagesPerSecondfor the project. - Disable
bAllowClientToServerMessagesif clients never need to send router messages.
Important: an empty
AllowedClientToServerChannelRootsallows every non-blocked channel. This is convenient for prototyping but should be reviewed before release.
Default settings:
| Setting | Default | Purpose |
|---|---|---|
bEnableNetworking |
true |
Enables the transport |
bAllowClientToServerMessages |
true |
Allows client-originated messages |
MaxClientMessagesPerSecond |
30 |
Per-player server-side rate limit |
MaxMessageStructSize |
65536 |
Coarse fixed-size payload guard |
bQueueClientMessagesUntilReady |
true |
Queues sends while the bridge replicates |
ClientMessageQueueCapacity |
32 |
Maximum queued startup messages |
ClientMessageQueueTimeoutSeconds |
5.0 |
Queued message lifetime |
The structure-size setting checks the fixed memory size of the USTRUCT. Unreal's RPC limits still apply to dynamic strings, arrays, maps, and nested data.
Add the module to your .Build.cs file:
PrivateDependencyModuleNames.AddRange(
new[]
{
"GameMessageRouter"
});Include the APIs you use:
#include "GameMessageSubsystem.h"
#include "GameMessageNetworkSubsystem.h"USTRUCT(BlueprintType)
struct FInventoryChangedMessage
{
GENERATED_BODY()
UPROPERTY(BlueprintReadWrite)
int32 NewCount = 0;
};FInventoryChangedMessage Message;
Message.NewCount = 3;
UGameMessageSubsystem::Get(this).BroadcastMessage(
InventoryChangedTag,
Message);Store the handle as a member and unregister it during owner teardown:
ListenerHandle = UGameMessageSubsystem::Get(this).RegisterListener<FInventoryChangedMessage>(
InventoryChangedTag,
[this](FGameplayTag ActualChannel, const FInventoryChangedMessage& Payload)
{
HandleInventoryChanged(Payload.NewCount);
},
EGameMessageMatch::ExactMatch);
// EndPlay, Deinitialize, or equivalent teardown:
ListenerHandle.Unregister();Handles are explicit tokens. Copying or destroying a handle does not automatically unregister its listener.
ListenerHandle = UGameMessageSubsystem::Get(this).RegisterListenerWithContext<FInventoryChangedMessage>(
InventoryChangedTag,
[this](
FGameplayTag ActualChannel,
const FInventoryChangedMessage& Payload,
const FGameMessageContext& Context)
{
if (Context.Origin == EGameMessageOrigin::Client)
{
ValidateClientRequest(Context.Sender, Payload);
}
});UGameMessageNetworkSubsystem* Network =
GetWorld()->GetSubsystem<UGameMessageNetworkSubsystem>();
// Client -> server.
Network->SendToServer(
InventoryChangedTag,
Message,
EGameMessageReliability::Reliable);
// Authority -> all clients.
Network->SendToAllClients(
InventoryChangedTag,
Message,
EGameMessageReliability::Unreliable);
// Authority -> one client.
Network->SendToClient(
TargetPlayerController,
InventoryChangedTag,
Message,
EGameMessageReliability::Reliable);Given these channels:
Message.Combat
Message.Combat.Damage
Message.Combat.Heal
- An Exact Channel listener on
Message.Combatonly receivesMessage.Combat. - A Channel And Children listener on
Message.Combatalso receivesMessage.Combat.DamageandMessage.Combat.Heal. ActualChannelalways contains the channel used by the sender.
- Local delivery is synchronous and game-thread only.
- Reliable messages are ordered on each player's actor channel.
- Unreliable messages may be dropped.
- Late joiners do not receive earlier messages.
- Messages are transient events, not persistent replicated state.
- The plugin does not provide replay, storage, request responses, or delivery acknowledgements.
- Do not use router messages for bulk data, save games, continuous transforms, or authoritative state.
Use replicated properties, RepNotify, or Fast Arrays for persistent state. Use Game Message Router to announce events, deliver commands, and decouple reactions to state changes.
The plugin preserves the central Lyra-style concepts—Gameplay Tag channels, typed structures, exact/partial matching, and listener handles—but adds explicit networking and standalone packaging.
Important differences:
- Local messages are never automatically replicated.
- Multiplayer delivery uses
UGameMessageNetworkSubsystem. - The Blueprint factory is named
ListenForGameMessages. - Listeners can inspect message origin and client sender context.
- Client-to-server policy is configurable.
- This is not a binary drop-in replacement for Epic's module.
- Check Is Game Message Network Ready.
- Verify
bEnableNetworkingandbAllowClientToServerMessages. - Check the allowed and blocked channel roots.
- Confirm the payload is a reflected
USTRUCT. - Look for
LogGameMessageRouterrate-limit or validation warnings.
Use Channel And Children / EGameMessageMatch::PartialMatch on the listener.
Call the client send functions on authority. For targeted delivery, pass the server's valid PlayerController for that connection.
This is expected. Router messages are not retained. Replicate the underlying state and use the message only as a notification.
- Unreal Engine 5.7.4 — UnrealEditor and UnrealGame, Win64.
- Unreal Engine 5.8.0 — UnrealEditor and UnrealGame, Win64.