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.
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.
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!
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.
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.
@@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.
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?
@@Flopperam I think so. When I try the MatchmakingSucceededEvent, I get: { "statusCode": 200, "body": "{\"success\":\"ticket data has been saved to dynamodb\"}" }
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.
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.
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 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.
@@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 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?
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
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: ruclips.net/p/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!
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\"}" }
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.
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!
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.
@@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
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!
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?
@@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
@@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.
@@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
@@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.
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.
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?
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/
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 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.
I love the new intro
Thank you Burrito!
Awesome, looking forward for next episode
Epic Intro Flopperam
Baraka!!!!!!!!!!!!!!!
@@FlopperamChrisssss! what popping my guy, whats popping!!!
@@BarakaGameDev Sorry for the late reply, but I am doing well, how are you?
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.
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.
Great video!!
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!
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.
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.
@@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.
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?
@@Flopperam I think so. When I try the MatchmakingSucceededEvent, I get:
{
"statusCode": 200,
"body": "{\"success\":\"ticket data has been saved to dynamodb\"}"
}
@@gseric565 Right but are you seeing any logs in Cloudwatch for event notifications of types other than MatchmakingSearching?
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.
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.
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
Also, if I check the metrics of the matchmaking configuration, no ticket has ever been created
@@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.
@@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.
Not sure if relevant, but I'm using 4.27 engine, properly adjusted the http module calls to use threadsafe.
@@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?
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
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: ruclips.net/p/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!
Can you show how to integrate this with the ue4 fps multiplayer kit from the ue4 marketplace it has all the game modes ready.
Do you have a link to the kit? I am not very familiar with it.
Flopperam unrealengine.com/marketplace/en-US/product/fps-multiplayer-template
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\"}"
}
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.
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!
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.
@@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
@@TalisBarbalho it's alright. eventually those matchmaking requests, even in potential match created status, will time out.
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!
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?
@@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
@@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.
@@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
@@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.
Hey can u show off how to migrate host if the host leaves a online match, to prevent everyone from getting kicked.
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.
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?
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/
Flopperam have you seen this trailer ruclips.net/video/V4PMRFkx07g/видео.html
@@theoneand0nly874 Yes that's a classic!
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
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.
@@Flopperam okay, thanks! What are the Features wich i have after these tuts? Ist it totally free?
@@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.
AWS anything is the most convoluted clutter fuck way of doing anything
😂 true, but i think modern autoscale deployment is always convoluted clutter fuck