# Project adopted as official Agones Unreal SDK
We are delighted that this project has been adopted as the official Agones Unreal SDK from version 1.8.0
.
For more information, downloading and contributing to the project please see:
Please visit the official version for the lastest updates and to download.
Agones is a multilayer dedicated game server scaling and orchestration platform that can run anywhere Kubernetes can run.
This is a SDK inspired by the REST API to the Agones sidecars that allows engineers to talk to the sidecar from either C++ or Blueprints.
The Agones Unreal SDK can either be used from C++ or from Blueprints.
Easiest way to get this code is to clone the repository and drop the entire plugin folder into your own Plugins
folder. This runs the plugin as a Project plugin rather than an engine plugin.
We could however turn this into a marketplace plugin that can be retrived from the marketplace directly into the UE4 editor.
.uplugin
file)
"Plugins": [
{
"Enabled": true,
"Name": "Agones"
}
],
*.Build.cs
)
PublicDependencyModuleNames.AddRange(
new[]
{
"Agones",
});
#include "AgonesComponent.h"
UPROPERTY(EditAnywhere, BlueprintReadWrite) UAgonesComponent* AgonesSDK;
- Initialize component in GameMode
```c++
#include "AgonesComponent.h"
#include "Classes.h"
ATestGameMode::ATestGameMode()
{
AgonesSDK = CreateDefaultSubobject<UAgonesComponent>(TEXT("AgonesSDK"));
}
void APlatformGameSession::PostLogin(APlayerController* NewPlayer)
{
// Empty brances are for callbacks on success and errror.
AgonesSDK->PlayerConnect("netspeak-player", {}, {});
}
Add Component to your Blueprint GameMode
This will automatically call /health
every 10 seconds and once /gameserver
calls are succesful it will call /ready
.
Accessing other functionality of Agones can be done via adding a node in Blueprints.
Additional methods have been added for ease of use (both of which are enabled by default):
/gameserver
till a succesful response is returned and then call /ready
.bDisableAutoConnect
to true
.GameServer
data once the /gameserver
call succeeds./health
endpoint on supplied rateHealthRateSeconds
to 0
.Both of the above are automatically kicked off in the BeginPlay
of the component.
This Agones SDK wraps the REST API and supports the following actions:
Stable
Alpha
Unimplemented
Current the only missing functionality is the WatchGameServer
functionality. We welcome collaborators to help implement this, if people need it before we get around to implementing it ourselves.
Within the Unreal GameMode and GameSession exist a number of useful existing funtions that can be used to fit in with making calls out to Agones.
A few examples are:
RegisterServer
to call SetLabel
, SetPlayerCapacity
PostLogin
to call PlayerConnect
NotifyLogout
to call PlayerDisconnect
There is an existing Agones Unreal SDK within the Agones GitHub repository.
We made the decision to move away from this due to: