Quilkin Unreal Engine Plugin
This is an unreal engine 5 plugin for Quilkin, a UDP proxy for gameservers. The plugin provides several features that you can use with Quilkin deployments, such as proxying game traffic, and latency measurement.
You can also find guide level documentation on how the proxy works in the Quilkin Book.
Installation
Copy this plugin to your Plugins
folder in your Engine
directory.
Configuration
Static configuration is available in the editor through UQuilkinDeveloperSettings
in "Project Settings".
Dynamic configuration is available through UQuilkinConfigSubsystem
, it is initialised from the settings provided in UQuilkinDeveloperSettings
, but can also be updated in code, and users can bind individual properties to delegates allowing them to dynamically set based on custom logic.
bool Enabled
Whether the plugin will attach a versioned routing token to UDP packets to allow load balancers forward traffic to the correct gameserver. This also requires the address the clients connect to be a Quilkin load balancer, if connected directly to a gameserver the client will be rejected.bool EnabledInPie
By defaultEnabled
is disabled in editor to prevent interfering with local clients and gameservers, you can override this behaviour by also enablingEnabledInPie
.TArray<uint8> RoutingToken
The routing token representing the gameserver a client wants to reach, the token must be 16 bytes exactly. Currently the plugin only supports usingEnabled
with a routing token to create the following layout. It is assumed that the routing token would come from an external service, such as a matchmaking system.
<packet> | token | version
X bytes | 16 bytes | 1 byte
TArray<FQuilkinEndpoint> Endpoints
A set of Quilkin load balancer endpoints that can be used for the following features.bool MeasureEndpoints
When enabled, the plugin will start a newTick
task that executes at a fixed interval (currently 30 seconds), where it will spawn a new background task that will ping each endpoint inEndpoints
, and track its measurement in a fixed size circular buffer. Pings are handled through Quilkin Control Message Protocol, this is a bespoke protocol for UDP to be able to support situations where for example using ICMP is not possible, see the Quilkin Book for more details on the protocol data unit. NoteMeasureEndpoints
is orthogonal toEnabled
andUseEndpoints
meaning that you can useMeasureEndpoints
for latency measurements without being required to also use Quilkin for game traffic.bool UseEndpoints
Whether to useEndpoints
for game traffic. When enabled, instead of using the providedFInternetAddr
, the plugin will choose the lowest latency endpoint available and send traffic through that endpoint to connect to the gameserver, and if the latency should exceedJitterThreshold
then the plugin will attempt to redirect traffic to the next available endpoint with the lowest latency.
Delegates
Quilkin exposes a number of delegates to be able to access certain information, they can be accessed through the FQuilkinDelegates
class.
-
GetQuilkinEndpointMeasurements
returnsTArray<EndpointPair>
representing each endpoint set inEndpoints
with their median latency. The array will be empty if no endpoints have been set andMeasureEndpoints
is not enabled. -
GetLowestLatencyEndpoint
returnsTOptional<EndpointPair>
is a specialisation ofGetQuilkinEndpointMeasurements
returning the lowest latency endpoint and its median latency. The delegate will returnNone
if the array is empty andMeasureEndpoints
is not enabled.