General
- Fixed DateTime conversion from AWS to Unreal Format
- Fixed DateTime conversion from Unreal to AWS format
After creating our Access Policy (from this guide), we’ll create a new user and assign that user to our newly created Policy.
I highly encourage you to “Download .csv” to save your credentials to a file, otherwise you will NOT be able to retrieve these credentials again!
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "gamelift:*",
"Resource": "*"
}
]
}
Before we can initialize and use GameLift, we need to create Access keys that we use to Identify ourselves with Amazon GameLift.
Follow these tutorials on how to create an Access Policy & Assign a user to our Policy.
Using our newly created Policy & User credentials we can Initialize GameLift inside Unreal Engine.
After you’ve “Created a GameLift Object” we can start accessing GameLift functionality!
You can find all GameLift functions by searching for GameLift in the Context menu
You can use utility function “GetGameLiftObject” to get the last created GameLiftObject, if you create a new object then this function will return that object. You can store a reference to the object instead if you want to use multiple GameLift Objects.
Check out the downloadale Example Project
We must first create a Server Object, this can be done via blueprint or native c++. If you want the ability to override Gamelift server events, you can create a new child class of parent type “GameLiftServerObject” (see example image below)
We’re going to construct & initialize our game server inside our GameInstance blueprint. Search for “Construct object from class” in the context window.
Implement the two events inside our GameInstance, called Init and Shutdown. Implement the Initialization as demonstrated below.
When the game instance is constructed the GameServer will start talking with GameLift and wait for events from AWS GameLift Servers.
Note: Calling the InitSDK in a non-server environment will do nothing, it’s been disabled and will only run on dedicated servers.
The AWSCore::GameLiftServer plugin comes with a GameMode that you can use to make it easier to Accept player sessions, it has a overridable blueprint event called “PreLogin” that you can use to grab PlayerIds from.
You can send your PlayerId to the server by appending it to your Options string, this will make it available to the server when connecting and using it in the example above.
You can run your Server.exe executable with the -Port=XXXX to have both GameLift and your GameServer to listen on an alternative port.