How To Make A Multiplayer Game With Unreal Engine and Amazon GameLift (Part 6 - Client Service)

Ғылым және технология

Watch Part 5 here: • How To Make A Multipla...
This video is the sixth part of an extensive and informative tutorial on how to integrate Amazon GameLift with Unreal Engine, going over concepts such as creating the client service in the form of lambda functions and a rest API in Amazon API Gateway. The functions in this client service involve making a matchmaking request, cancelling a matchmaking request, polling for the status of a matchmaking request, and getting player data. These functions will later be used by the client to connect to a game server process hosted on Amazon GameLift. In the process, we also made modified Lambda function policies to grant additional access permissions, and tested the lambda functions and rest API in the lambda console and Postman.
Watch Part 7 here: • How To Make A Multipla...
How to support the channel:
Get a shirt or sweatshirt with free shipping (Use code "SHIP" at checkout): teespring.com/stores/flopperam
Become a member: / @flopperam
Support us on Patreon: / flopperam
Donate to our PayPal: www.paypal.me/flopperam
Sponsor us on Github: github.com/sponsors/chris-gong
Social media links:
Discord: / discord
Twitter: / flopperam
Instagram: / flopperam
Facebook: / flopperam
*********IMPORTANT LINKS*********
Lambda code for this tutorial series: github.com/chris-gong/gamelif...
Informative articles about FleetIQ:
docs.aws.amazon.com/gamelift/...
docs.aws.amazon.com/gamelift/...
aws.amazon.com/blogs/aws/amaz...
Get Postman here: www.postman.com/downloads/
Music Creds:
Song: LAKEY INSPIRED - Chill Day (Vlog No Copyright Music)
Music provided by Vlog No Copyright Music.
Video Link: • LAKEY INSPIRED - Chill...
Song: Wonder - LAKEY INSPIRED
Music promoted by BreakingCopyright: • Video
#unrealengine #ue4 #gamelift

Пікірлер: 92

  • @majingari
    @majingari4 жыл бұрын

    Awesome, looking forward for next episode

  • @twinsassink8745
    @twinsassink87454 жыл бұрын

    Great video!!

  • @burrito9025
    @burrito90254 жыл бұрын

    I love the new intro

  • @Flopperam

    @Flopperam

    4 жыл бұрын

    Thank you Burrito!

  • @Flopperam
    @Flopperam3 жыл бұрын

    Thank you to the person in the comments of another video who pointed this out but you no longer need to use a layer in your AWS Lambda functions as the AWS SDK is now automatically included!

  • @BarakaGameDev
    @BarakaGameDev4 жыл бұрын

    Epic Intro Flopperam

  • @Flopperam

    @Flopperam

    4 жыл бұрын

    Baraka!!!!!!!!!!!!!!!

  • @BarakaGameDev

    @BarakaGameDev

    4 жыл бұрын

    @@FlopperamChrisssss! what popping my guy, whats popping!!!

  • @Flopperam

    @Flopperam

    4 жыл бұрын

    @@BarakaGameDev Sorry for the late reply, but I am doing well, how are you?

  • @Flopperam
    @Flopperam3 жыл бұрын

    Hey guys, now when you add a layer to a lambda function, it now looks a little different than how it looks in this video. By default, you will see an option called "AWS layers" selected by default. Make sure to select the option labelled "Custom layers" instead. Otherwise, you won't see your custom layer when you select a layer from the drop down menu.

  • @Flopperam
    @Flopperam3 жыл бұрын

    Also, when you test your Lambda functions, if you are still getting an error message related to access permissions despite having modified the policy attached to your lambda function's role, then add a harmless edit to your lambda function like a comment or new line character, save the function, and test it again. This glitch happens from time to time in which the modification of your lambda function's permissions doesn't get applied right away.

  • @Flopperam
    @Flopperam3 жыл бұрын

    Note that AWS has recently changed the interface for Lambda, meaning that instead of clicking the "Save" button to save your code changes, you have to click the "Deploy" button to save your code changes as the "Save" button is no longer there.

  • @HassanSohail8900
    @HassanSohail89004 жыл бұрын

    Hey flopperam, this is kinda personal, but I just wanna know from do get that kind of amazing knowledge. Do u work at amazon gamelift? That is some amazing work u are doing. Hats off to you :D

  • @Flopperam

    @Flopperam

    4 жыл бұрын

    Hey, nothing wrong with that question! Since the start of this year, we have spent a lot of time researching GameLift. We used to stream very often just to look up information about GameLift. Although the live streams are unlisted now, they can be found in this playlist: kzread.info/head/PLa1dM5bPQv0tNzdH3j9bbAyqm0y5tDH3G. Through a lot of trial and error and with the help of our viewers, we were able to learn a lot about GameLift. Also, I don't work at AWS sadly but I do communicate with the GameLift team from time to time to get better answers to more specific questions. And thank you for your support!

  • @TalisBarbalho
    @TalisBarbalho3 жыл бұрын

    Hey! Sorry that I have come with yet another question, but I've been getting `Matchmaking ticket is in PLACING status and cannot be canceled.` when I try to use the StopMatchmaking lambda. Is this an expected behavior or did I do something wrong again? Once again thanks for the time putting this video together!

  • @Flopperam

    @Flopperam

    3 жыл бұрын

    Hmmm, that's very odd. Does this happen every time you try to cancel a matchmaking ticket? It's possible that the ticket is in PotentialMatchCreated status (may be worth checking cloudwatch logs for the TrackEvents function to see if this is the case), meaning that a couple of matchmaking requests resulted in a match and GameLift is now trying to find a server process to host a game session for that match. In that case, the request can't be cancelled as far as I know.

  • @TalisBarbalho

    @TalisBarbalho

    3 жыл бұрын

    @@Flopperam alright, that would make sense. The game I'm making would allow single player to start a match, so I had to change the matchmaking rules to accommodate that. I didn't think that creating the match right away would be a possibility and now, in that case, I may have multiple matches created by now, and now I'm doomed LOL

  • @Flopperam

    @Flopperam

    3 жыл бұрын

    @@TalisBarbalho it's alright. eventually those matchmaking requests, even in potential match created status, will time out.

  • @theoneand0nly874
    @theoneand0nly8744 жыл бұрын

    Can you show how to integrate this with the ue4 fps multiplayer kit from the ue4 marketplace it has all the game modes ready.

  • @Flopperam

    @Flopperam

    4 жыл бұрын

    Do you have a link to the kit? I am not very familiar with it.

  • @theoneand0nly874

    @theoneand0nly874

    4 жыл бұрын

    Flopperam unrealengine.com/marketplace/en-US/product/fps-multiplayer-template

  • @Flopperam
    @Flopperam4 жыл бұрын

    Hey guys, although I did not do this in this tutorial series, a lot of lambda functions that we write include if statement checks on parameters in the request body. However, I just found out that you can perform request body validation through API Gateway. So if you have time, then I would highly encourage you guys check out this article, itnext.io/how-to-validate-http-requests-before-they-reach-lambda-2fff68bfe93b. Keep in mind though that the original code in this video and for all of our lambda functions will still work. But if you do request body validation through API Gateway instead of in the lambda function itself, that can reduce code in your Lambda functions. However, then you have to write a model for each api method. All in all, either approach you take, wherever you validate the request content, whether it's in the lambda function or on the API side, will work.

  • @gseric565
    @gseric5653 жыл бұрын

    Hi, I finished up to the 7 tutorials, but when I package the client, it keeps looking for matchmaking to occur after I press Join the game in each client window. So I think there might be something wrong with my Startmatchmaking, Stopmatchmaking, or Pollmatchmaking APIs or lambda functions. I came back to this tutorial, and at 1:33:57, the error that I get with the token looks like the error at 1:35:44 for the Stopmatchmaking in Postman, and the Pollmatchmaking error is always {} in both cases instead of "incoming request did not have a ticket id". Am I looking at the right place for the error, or do you think there is a bug somewhere that I should be looking for? Thanks.

  • @Flopperam

    @Flopperam

    3 жыл бұрын

    Hey, do you have at least one available server process in your fleet? Also, make sure that the queue attached to your matchmaker has a fleet destination pointing to the correct fleet. Let me know if you are still experiencing issues after addressing both of those questions.

  • @gseric565

    @gseric565

    3 жыл бұрын

    @@Flopperam Hi, I checked and I have 1 active instance and 2 active servers. I was trying to see whether my queue is attached to matchmaker, so I went to the Flexmatch tutorial and when I invoke the TrackEvents lambda function with MatchmakingSearching test, I get this result in the log: { "statusCode": 400, "body": "{\"error\":{\"message\":\"1 validation error detected: Value '{MatchmakingTickets=[]}' at 'requestItems' failed to satisfy constraint: Map value must satisfy constraint: [Member must have length less than or equal to 25, Member must have length greater than or equal to 1]\",\"code\":\"ValidationException\",\"time\":\"2020-09-19T16:06:21.360Z\",\"requestId\":\"SI3CHLHJTMOOUEVMF5SS9JGHFFVV4KQNSO5AEMVJF66Q9ASUAAJG\",\"statusCode\":400,\"retryable\":false,\"retryDelay\":39.606433463440105}}" } instead of: { "statusCode": 200, "body": "{\"success\":\"ticket data has been saved to dynamodb\"}" } I copied and pasted your code from github for the lambda function just to makes sure, but it still gives me the same error.

  • @Flopperam

    @Flopperam

    3 жыл бұрын

    Hey, so that's normal because we ignore event notifications of matchmaking searching. Are you ever getting event notifications of potential match created or matchmaking succeeded or matchmaking timedout or failed or cancelled?

  • @gseric565

    @gseric565

    3 жыл бұрын

    @@Flopperam I think so. When I try the MatchmakingSucceededEvent, I get: { "statusCode": 200, "body": "{\"success\":\"ticket data has been saved to dynamodb\"}" }

  • @Flopperam

    @Flopperam

    3 жыл бұрын

    @@gseric565 Right but are you seeing any logs in Cloudwatch for event notifications of types other than MatchmakingSearching?

  • @ahmedhassn8828
    @ahmedhassn88283 жыл бұрын

    Nice Tutorial, i've a question when i StartMatchmacking function i got a Empty response Like: { "statusCode": 200, "body": "{}" } and i don't know why!

  • @Flopperam

    @Flopperam

    3 жыл бұрын

    Hey, that is very odd, inside the StartMatchmaking Lambda function, can you add a console.log(JSON.stringify(data)); statement inside the "then" callback function for GameLift.startMatchmaking(...) to see if you're getting anything back from that function?

  • @ahmedhassn8828

    @ahmedhassn8828

    3 жыл бұрын

    @@Flopperam { 2020-08-17T10:24:00.254Z 217b48f2-0922-4d57-baa0-d4d6365e3482 INFO {"MatchmakingTicket":{"TicketId":"38d42037-5c92-4e57-b445-35332f25fcbb","ConfigurationName":"GameLiftTutorialMatchmaker","ConfigurationArn":"arn:aws:gamelift:eu-central-1:106136255346:matchmakingconfiguration/GameLiftTutorialMatchmaker","Status":"QUEUED","StartTime":"2020-08-17T10:23:59.978Z","Players":[{"PlayerId":"cb8aa093-1c5a-4b5f-bd87-1d9cd0bf2fd4","PlayerAttributes":{"skill":{"N":100}},"LatencyInMs":{"eu-central-1":60}}]}} } that i got from the console.log(JSON.stringify(data)); but nothing happen in the dynamoDB, even if i refresh the dynamoDB all page and i got the same result from lambda function empty body

  • @Flopperam

    @Flopperam

    3 жыл бұрын

    @@ahmedhassn8828hmmm, so that's ok that nothing's written to DynamoDb right away, because the TrackEvents Lambda function will only write to the MatchmakingTickets table when the matchmaking request reaches the final event stages (MatchmakingSucceeded, MatchmakingFailed, MatchmakingTimedOut, and MatchmakingCancelled). As for why the StartMatchmaking Lambda function isn't returning anything, can you double check for typos? Because it seems you are getting data back.

  • @ahmedhassn8828

    @ahmedhassn8828

    3 жыл бұрын

    ​@@Flopperam when i try to test the TrackEvent lambda with MatchmakingSuccessed, every thing work correctly even when i publish message from Sns , all of them type item in the DB but StartMatchMaking lambda the only function that not type or retrieve data from the DB, even i checked the lambda code, is there something specific can help me to reach the logic error, some console.log line or some thing like that to see where the function stuck at !? Edit: when i try to test the startmatchmaking with validaccesstokenevent, with first test , nothing happen in the DB, but when i try one more time with same accesstoken, in the DB there is the last matchmaking ticket and with MatchmakingCancelled in the type column, but the current ticket doesn't show in the DB

  • @Flopperam

    @Flopperam

    3 жыл бұрын

    @@ahmedhassn8828 right thats normal. I decided to not keep track of events of type MatchmakingSearching in the database. So the behavior you are seeing is normal, not a logic error. Right now, when you are testing StartMatchmaking with a valid access token, you get a Flexmatch event of type MatchmakingSearching, which you can check in the cloud watch logs for the TrackEvents function. When you test the StartMatchmaking function again with that same access token really quickly, then the matchmaking request gets cancelled because you can't have multiple active matchmaking requests at a time with the same player IDs. And since we do keep track of events of type MatchmakingCancelled, you will see that in the database.

  • @laufalau7149
    @laufalau71494 жыл бұрын

    In my case it does not an create entry on DynamoDB @MatchmakingTickets. Where have we specified the name for the Matchmaker again? I rechecked all of my code in this video and there seems to be nothing wrong so i guess it must be any issue from the last part. My Lambda StartMatchmaking "ValidAccessTokenEvent" Test ends up with: { "statusCode": 200, "body": "{\"ticketId\":\"39592984-92c9-4a1e-b74c-82e516b9ed3f\"}" }

  • @Flopperam

    @Flopperam

    4 жыл бұрын

    Hey, we made the matchmaker in part 4. It seems that you were able to make a matchmaking request successfully. Remember that in part 5, we made some changes to the TrackEvents lambda function so that we only keep track of "final state" flexmatch event notifications, which include events of type Matchmaking Succeeded, Failed, TimedOut, or Cancelled. Right now, in this series, the requests time out after 60 seconds, so if you didn't do anything after testing the StartMatchmaking lambda function, you should see a MatchmakingTimedOut item in your dynamodb table. Let me know if that is or is not the case.

  • @theoneand0nly874
    @theoneand0nly8744 жыл бұрын

    Hey can u show off how to migrate host if the host leaves a online match, to prevent everyone from getting kicked.

  • @Flopperam

    @Flopperam

    4 жыл бұрын

    Hey, GameLift uses dedicated servers instead of listen servers, so there is never a client that is the "host" of a match. If someone leaves, no matter who it is, the match and the players in the match continue, assuming no additional logic is causing the match to end abruptly.

  • @theoneand0nly874

    @theoneand0nly874

    4 жыл бұрын

    Flopperam how do I set it up like that with listening servers ? I remember call of duty modern warfare 2 had host migration, any way to replicate that in ue4 ? If so, is it possible for you to show it off at some point in time in the future?

  • @Flopperam

    @Flopperam

    4 жыл бұрын

    I am not very familiar with host migration, but I can take a look at it in the future in another tutorial series. I found these reddit posts that may help: www.reddit.com/r/unrealengine/comments/99vu7y/how_to_handle_host_migration_for_a_p2p_model/ www.reddit.com/r/gamedev/comments/bedz9e/is_using_listen_servers_sufficient_for_a/

  • @theoneand0nly874

    @theoneand0nly874

    4 жыл бұрын

    Flopperam have you seen this trailer kzread.info/dash/bejne/iGiEr7R_m9uWZ8o.html

  • @Flopperam

    @Flopperam

    4 жыл бұрын

    @@theoneand0nly874 Yes that's a classic!

  • @admiralgeneral4594
    @admiralgeneral45944 жыл бұрын

    Hello Guys, If I follow all of the six tuts I have a stable multiplayer game like fortnite? And does it works on android? Cheers

  • @Flopperam

    @Flopperam

    4 жыл бұрын

    Hey, we're still working on parts 7 and 8, but after the 8 parts, you should have a simple multiplayer game, not like Fortnite. This tutorial is more to learn about GameLift and multiplayer networking in Unreal Engine. We will eventually have a part for Android as well.

  • @admiralgeneral4594

    @admiralgeneral4594

    4 жыл бұрын

    @@Flopperam okay, thanks! What are the Features wich i have after these tuts? Ist it totally free?

  • @Flopperam

    @Flopperam

    4 жыл бұрын

    @@admiralgeneral4594 So it's mainly fundamental concepts including Unreal Engine, GameLift, other AWS services, matchmaking, and more. There's more but way too many to count, but a better way to describe the tutorials is that it's more of an open ended course in the sense that we dive deep into specific aspects of multiplayer development to allow people to do what they want with them. Hope that made sense. And AWS has a free tier, so their services are free to a certain extent. Unreal Engine is free though.

  • @Alcheon
    @Alcheon Жыл бұрын

    Hello there Chris, I'm having an issue where a match is never done. In clodwatch, TrackEvents never logs anything when I try to join with the clients, when I publish a message from SNS FlexMatchEventNotifications it does appears. Also, tickets are only created when I test with publish message. I'm a bit lost on what could it be, I tried a lot already, any idea where the issue could be? Thank you

  • @Alcheon

    @Alcheon

    Жыл бұрын

    Also, if I check the metrics of the matchmaking configuration, no ticket has ever been created

  • @Flopperam

    @Flopperam

    Жыл бұрын

    @@Alcheon Hey, can you double check that the SNS topic is set correctly in your matchmaking configuration. Also, make sure that the queue is set in the matchmaking configuration.

  • @Alcheon

    @Alcheon

    Жыл бұрын

    @@Flopperam Hey! Thank you, I double checked and the SNS topic is correct, also, the queue is correct and I can see the queue depth in the metrics increasing when I try to connect with the game clients. Also, fleet destination is correct, I can also see that a game session is created with the matchmaker config name is there.

  • @Alcheon

    @Alcheon

    Жыл бұрын

    Not sure if relevant, but I'm using 4.27 engine, properly adjusted the http module calls to use threadsafe.

  • @Flopperam

    @Flopperam

    Жыл бұрын

    @@Alcheon Is the lambda function, TrackEvents, subscribed to the SNS topic? Is the StartMatchmaking lambda function getting called aka are you seeing logs for it in cloudwatch?

  • @wavelogic8471
    @wavelogic84715 ай бұрын

    AWS anything is the most convoluted clutter fuck way of doing anything

Келесі