Unable to Compile Gamelift 3.2.0 UE4 4.18

0

Hey guys,

Excited to see the new backfill update and all the hard work you guys are putting in to helping us developers!

I downloaded the newest update today and tried to update the plugin in my Unreal Project (UE4 4.18) and was getting some compile errors that I'm not sure how to resolve.

I compile the dlls and libs successfully, but when going to compile my game, I was getting the following errors:

When compiling for DEVELOPMENT EDITOR:

Error	LNK2019	unresolved external symbol "__declspec(dllimport) public: __cdecl Aws::GameLift::Server::Model::GameSession::~GameSession(void)" (__imp_??1GameSession@Model@Server@GameLift@Aws@@QEAA@XZ) referenced in function "public: void __cdecl UE4Tuple_Private::TTupleImpl<struct TIntegerSequence<unsigned int> >::ApplyAfter<class <lambda_f590ae0d51793d36e8b7ecaf8a2e91d6> const &,class Aws::GameLift::Server::Model::GameSession &>(class <lambda_f590ae0d51793d36e8b7ecaf8a2e91d6> const &,class Aws::GameLift::Server::Model::GameSession &)const " (??$ApplyAfter@AEBV<lambda_f590ae0d51793d36e8b7ecaf8a2e91d6>@@AEAVGameSession@Model@Server@GameLift@Aws@@@?$TTupleImpl@U?$TIntegerSequence@I$S@@$$V@UE4Tuple_Private@@QEBAXAEBV<lambda_f590ae0d51793d36e8b7ecaf8a2e91d6>@@AEAVGameSession@Model@Server@GameLift@Aws@@@Z)
Error	LNK2019	unresolved external symbol "__declspec(dllimport) public: __cdecl Aws::GameLift::Server::Model::GameSession::GameSession(class Aws::GameLift::Server::Model::GameSession const &)" (__imp_??0GameSession@Model@Server@GameLift@Aws@@QEAA@AEBV01234@@Z) referenced in function "public: void __cdecl UE4Tuple_Private::TTupleImpl<struct TIntegerSequence<unsigned int> >::ApplyAfter<class <lambda_f590ae0d51793d36e8b7ecaf8a2e91d6> const &,class Aws::GameLift::Server::Model::GameSession &>(class <lambda_f590ae0d51793d36e8b7ecaf8a2e91d6> const &,class Aws::GameLift::Server::Model::GameSession &)const " (??$ApplyAfter@AEBV<lambda_f590ae0d51793d36e8b7ecaf8a2e91d6>@@AEAVGameSession@Model@Server@GameLift@Aws@@@?$TTupleImpl@U?$TIntegerSequence@I$S@@$$V@UE4Tuple_Private@@QEBAXAEBV<lambda_f590ae0d51793d36e8b7ecaf8a2e91d6>@@AEAVGameSession@Model@Server@GameLift@Aws@@@Z)

When compiling for DEVELOPMENT_SERVER:

Error	LNK2005	"public: __cdecl Aws::GameLift::Server::Model::GameSession::GameSession(class Aws::GameLift::Server::Model::GameSession const &)" (??0GameSession@Model@Server@GameLift@Aws@@QEAA@AEBV01234@@Z) already defined in aws-cpp-sdk-gamelift-server.lib(aws-cpp-sdk-gamelift-server.dll)

The compile DOES SUCCEED for both when I comment out these lines:

	auto onGameSession = [=](Aws::GameLift::Server::Model::GameSession gameSession) {
GameLiftSdkModuleRef->ActivateGameSession();
};
params->OnStartGameSession.BindLambda(onGameSession);

These compile errors didn't happen to me in 3.17.

I'm not sure what I could be missing. Any Ideas?

Thanks!

asked 6 years ago416 views
10 Answers
0

Hey @REDACTEDUSER

Sorry to hear you are having compilation issues with the latest SDK. We are investigating on our side, and we will give you an update as soon as we have a better idea of what could be going on and by end of day regardless.

answered 6 years ago
0

Hi @REDACTEDUSER

When upgrading to 3.2.0 make sure you copy the new Plugin from:

  • GameLift_02_08_2018\GameLift-SDK-Release-3.2.0\GameLift-Unreal-plugin-3.2.0\UE4.16-4.18\GameLiftServerSDK to

  • <your project folder>\Plugins. Then after building the binaries with -DBUILD_FOR_UNREAL=1 you'll need to copy them into <your project folder>\Plugins\GameLiftServerSDK\ThirdParty\GameLiftServerSDK<Win64 or Linux>.

  • https://docs.aws.amazon.com/gamelift/latest/developerguide/integration-engines-setup-unreal.html Another possibility is you have some intermediate binaries that aren't getting rebuilt. Try doing a clean and rebuild or delete <your project folder>\Intermediate and <your project folder>\Binaries.

Good luck and let me know if you run into further problems.

Ben

answered 6 years ago
0

Hi @REDACTEDUSER

Thanks for the response. I recompiled dlls and libs, and reimported everything into my project again, deleted all binaries and intermediate folders, and still getting the same errors.

Not sure what the problem could be?

answered 6 years ago
0

Hey @REDACTEDUSER

Yes, you have it correct -- that workflow with FlexMatch is the better implementation. To understand how FlexMatch fits, it might be better to refer to this architecture diagram. That diagram shows and discusses your Game Service, the service that sits between your game clients and GameLift services, like FlexMatch.

You should not be having your game clients communicate directly with GameLift. At a minimum, you do need something (like API Gateway, as you are finding) to handle client side authentication.

The idea with FlexMatch notifications is that your Game Service will receive the Notifications from FlexMatch and then relay them down to the game client through whatever your notifications mechanism is to communicate between clients and services.

What is your notifications mechanism to clients?

If you are still building that, you can have a Lambda hooked up to your SNS topic to handle receiving the messages from FlexMatch notifications and writing them to a DynamoDB table. Then you could have another Lambda between that table and your game clients that handles the game client polls for status.

Hopefully that starts to point you in the direction of how to hook up a serverless architecture to support client notifications.

Let me know if you have more questions.

answered 6 years ago
0

Hi @REDACTEDUSER

Thanks for the clarifications! I will start using the API Gateway route.

I realize this thread is getting long and we are getting off topic from the original post, but I have a few more questions.

  1. Is there no way to have the client send a matchmaking request to the gateway and then receive an event that the matchmaking is completed without polling?

  2. If there is no way to do it without polling, what is the point of having an SNS topic write notifications to DynamoDB when I could just poll the Gamelift service by calling DescribeMatchmaking?

  3. How would I go about client authentication if I am running my game through steam? I could hard code the api keys into my game, but I assume that this is not what I want to do?

  4. After playing around with the API Gateway a little, I have run into some problems, is there no way for Gateway to directly communicate with GameLift, or does it have to be done through Lambda?

answered 6 years ago
0

Hi @REDACTEDUSER

Thanks for your response, this has helped clear up a lot, I really appreciate it.

The one thing I am concerned about is if my clients continuously poll the API Gateway during matchmaking, then there are instances where the cost would skyrocket. An optimistic but not unrealistic example is if I have 100,000 concurrent users and on average each of them poll to check matchmaking status 10 times each time they look for a match, then the number of API calls would be very high and my cost of using Gateway, along with the extra cost of pairing it up with Lambda and DynamoDB, would be very very high.

I am just trying to figure out the best and most cost efficient way to go about this. I have started using API Gateway for now as we are still in the alpha and testing phase, but going forward, I would like to figure out a better solution (if there is one). The only alternative I can think of is if I spun up some web-servers to handle the requests, but I'm not sure how much that would help. Is there another way to handle it?

Sorry for all the questions. This is my first time making a backend for a video game so I am trying to get it right!

Thanks again for everyone's help!

answered 6 years ago
0

Hey @REDACTEDUSER

At the end of the day, I think you'll either need to poll, or you'll need a way to send messages to your game clients. The easiest is probably polling, the more complicated but more cost efficient is to build a notification system which can send messages back to your clients.

Either will incur costs, but I think you'll find API Gateway to be cost efficient. I would expect it to be a small proportion of your total backend costs.

If you chose to build a system to send messages to your clients, AWS IOT would be my recommendation. You could also integrate a higher level service such as GameSparks to use in conjunction with GameLift, which in turn would handle client authentication for you and provides functionality for pushing messages to your clients.

answered 6 years ago
0

@MisterGameLift

Unfortunately, I'm seeing the same compile errors.

But I have been doing some investigating and I think I know what could be causing the problem.

I created a blank ue4 4.18 project. Copied and pasted the new Server SDK and the code DID compile. Then I added the AwsCore, CognitoIdentity, and GameLiftClient SDKs to the blank project and the code DID NOT compile with the same errors as above. I think there might be a conflict between these extra modules?

I have been using the client sdk in UE4 as a part of my game so that clients could communicate with the gamelift service from the game client.

I have been reading that a better implementation was to use an API Gateway for the client side functions, which would also allow me to add some other functionality to my game as well, but I was doing it from the game for now.

I was reading this article:

https://aws.amazon.com/blogs/gamedev/fitting-the-pattern-serverless-custom-matchmaking-with-amazon-gamelift/

Is that workflow (updated with flexmatch) a better implementation? If yes, how does the client know when the matchmaking is done? I am having trouble wrapping my head around the flexmatch event notification system. How am I able to send the matchcreated event back to my game clients?

answered 6 years ago
0

Hey @nicholasbagamian,

I'll see if I can address your questions.

No, not without another layer. GameLift in general doesn't have a way to send notifications directly to clients, it can only respond to HTTP requests from the client. The StartMatchmaking API is asynchronous (as it could take a while if there's no one to match against), so we can't hold the connection open while we wait. You could theoretically have your gateway API hold an HTTP connection open while your backend process polls GameLift, but I really don't think that would be a good approach.

If you are looking for a way to send notifications from backend services to your game clients, I'd recommend taking a look at AWS IOT (https://aws.amazon.com/iot-core/), where you'd treat each of your game clients as a "device" in their nomenclature. If you had this (or another way to push messages to your clients), you could listen to the SNS messages, then post a specific notification to the specific client/player who was just matched.

  1. The client could just poll, but we don't recommend this for when your game launches. There are throttling limits that GameLift will enforce on your game if across all clients they are polling at too high a TPS. For large games that could have hundreds or thousands of clients in matchmaking simultaneously, you could exceed your polling limits quickly. Hence why we don't recommend you launch with this set up.

  2. You definitely don't want to hardcode AWS keys in your game clients (if I'm reading your question correctly). We don't recommend calling GameLift directly from your game client due to this restriction. Most developers have a backend service which authenticates their players, and that backend service is what calls GameLift. For developers who don't have existing backend services, we recommend building one by using API Gateway backed by Lambda functions. In the Lambda code you can perform authentication per what's appropriate for your game, then your Lambda code will call GameLift on behalf of the customer.

  3. Correct, API Gateway calls can't go directly to GameLift, they need to go to your Lambdas, which can call GameLift.

Hope that helps!

answered 6 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions