Hey everyone, originally when I made this video, I thought about adding logic to the StartMatchmaking Lambda function to prevent players that are already in a game from making a matchmaking request. The idea was to check if the player id in an incoming request to StartMatchmaking was associated with any active player sessions at the time of the request. The purpose of this was to prevent backfill requests from getting terminated suddenly and not knowing whether this happened or not since the OnUpdateGameSession handler function does not get called when a backfill request gets cancelled due to duplicate ids. Technically, you can call the GameLift DescribeMatchmaking function on the backfill ticket id to check whether or not the backfill request is still in progress or not but it seems from the documentation that it is not recommended to call DescribeMatchmaking too much. However, once again, the point is to prevent backfill requests from getting cancelled due to duplicate ids so that I would not have to worry about OnUpdateGameSession or DescribeMatchmaking. Ultimately, I realized that checking if a player has an active game session currently is not enough to prevent backfill requests from getting cancelled due to duplicate ids. Although it is very unlikely but still theoretically possible, while a player session is in the reserved status or a match was created for a player but the game session and player sessions have not been created yet, that same player can still log onto the same account on another running instance of the game client and get into another match. What happens as a result of this rare scenario is that you have a player in two matches, and one of those game's backfill requests will get cancelled due to duplicate ids. This ends up becoming a bigger problem outside the scope of the tutorial series but I would highly encourage you all to look into ways that different game titles prevent players from getting into multiple games at once. Some games prevent people from running multiple client instances simultaneously on one machine, but this alone is not enough to prevent the problem being addressed since people can just run one client instance on multiple devices while logged into the same account on each device. Many games keep track of when a user is logged into a game client in an external database like DynamoDb for example and then prevent users from logging into an account that is currently "logged in" already. This is synonomous to implementing a health check, an online/away/offline status check, or player/user sessions. League of Legends, for example, I believe kicks a player/user out of the game client if someone else logs into that same player/user account in a separate running instance of the game client. And even after adding these kinds of modifications to your game, you may still have to add separate GameLift or UE4 logic on top of that to prevent a player from being in multiple games, but I am not too sure about this last point. For example, going back to earlier in this comment, while a player session is in reserved status or the player session hasn't been made yet after a match has been made, a matchmaking request with the player id of that player session can be made, so the question becomes how do you deal with that? Sometimes players genuinely fail to connect to the server due to network issues, so you could make them wait until their player session is no longer in the reserved status for instance. As for the second situation, it's hard to deal with this because I have found cases where matches get made but there are no available server processes at the time to host a game session and player sessions for that match, so the best way to deal with this is to make sure your auto scaling policies are properly set so that the fleets in your queue always have enough capacity for player demand, which we will try to go over in part 12. At the end of the day, just keep in mind that this tutorial series does rely on a lot of perfect circumstances such as not having multiple client instances logged into the same player account, always having enough GameLift/AWS resources for every match made, and more. Sorry if this was too long to read, but I just want to get you all thinking and discussing, and hopefully you all can explore more on your own.
Also, at around 30:14 in the video when we are talking about the "hacky" way to test a new server executable quickly without having to upload a new server build and create a new fleet, you may find it hard to end multiple tasks through the task manager since you can't select multiple background processes at once. As I mentioned in the video, the server processes restart very quickly after they stop running and as you saw in the video, there is no way to differentiate the different unreal engine processes in task manager. All of these factors make it difficult to quickly test out a new server executable using the "hacky" way discussed in this video if you want to replace more than one of or all of the server processes running in a ec2 instance. So if you have a lot of unreal engine server processes that you need to terminate at once, then it may be better to use the command prompt for quitting multiple server processes at the same time in a windows ec2 instance instead. And another point, in addition to being able to copy and paste or drag and drop files from your local machine into the ec2 instance, you can also copy and paste or drag and drop files from the ec2 instance to your local machine.
thank you for amazing tutorials. How did you know what codes to write here and there? Is there any documentation about codes to write for cognito or some other services?
Hey could you help me know where in the lyra code can I find the individual player kills and assists are stored that's being loaded onto the leaderboard that's shown you click the tab button?
If I only want to connect my gameclients to my server without login, matchmaking, and all that stuff, what is the easiest approach? I have the server working (on gamelift local at least), and waiting for clients. I just want the client to find all the available matches at some server url right? I have a widget prepared to list all available matches. How can I get them? Is there an url or something I can search at? I tried the yetitech plugin, but I couldnt get my project to build. Its 2 years old so I understand why :p
I would suggest making an API gateway method that points to a lambda function that calls GameLift.describeGameSessions from the AWS SDK, docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/GameLift.html#describeGameSessions-property. If there are no game sessions, which will usually be the case, then you can have your client call another API gateway method that points to a lambda function that calls GameLift.createGameSession, docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/GameLift.html#createGameSession-property. Both methods should return an IP address and port for a game session that a client can connect to using the OpenLevel command.
@@Marius-vw9hp No, because you still need the associated library files and it just gets complicated, at least for most people when trying to build those library files. That's why I switched over to NodeJS, Lambda, API Gateway, and HTTP requests for this tutorial because it's much easier. I may try to make an open-source plugin in the future that wraps around the aws sdk but no plans for that in the immediate future.
@@Marius-vw9hp for that, unfortunately, you can't I believe since GameLift local is very limited in functionality so you'll have to use the AWS CLI, docs.aws.amazon.com/cli/latest/reference/gamelift/index.html, when testing with GameLift local.
I’ve watched a couple of videos and I was just wondering. How easy it would be to have playfab be where all the players data is held and then have gamelift just run Matchmaking.
Hey, I don't think that would be a hard integration considering how you store and interact with player data can be independent of gamelift and matchmaking. Also it seems that Playfab handles a lot for you already with regards to player data. Keep in mind that I have just started exploring playfab so my advice may not be the best.
Flopperam I imagine once I watch a few more videos ill be able to integrate it myself. I was just wondering which parts of gamelift holds the accounts and data in these videos?
@@alextsangaris9670 Great question, so GameLift is only responsible for server hosting, scaling, and management. You can use any other services for player accounts and data. In these tutorials, just to make things more compact and easier, we used other AWS services for this: Cognito for user accounts, and DynamoDB for custom player data/stats.
@@Flopperam So I have been watching more of the tutorial series and they're a lot of help. I was just wondering would it be a good idea to use playfab for the stores and all stats. Then keep all the aws services for matchmaking? Or would this make things run weird?
I believe Dead By Daylight does use GameLift. I'm not sure about Fortnite, but it definitely use some AWS services, whether it's GameLift or not. However, I'm not sure if they use AWS for hosting or they use their own servers for hosting. On the AWS GameLift homepage, aws.amazon.com/gamelift/, the featured customers that use GameLift include Super Mega Baseball, Quake, For Honor, Friday the 13th, and Dead By Daylight. There are some nice case study articles/videos for each of them on the homepage that I recommend checking out if you have time.
Flopperam so I looked at all the Current locations and that have fortnite servers and all of them line up to every region that has gamelift and it would be wise for epic games to use it as it would benefit them a lot
Hey everyone, originally when I made this video, I thought about adding logic to the StartMatchmaking Lambda function to prevent players that are already in a game from making a matchmaking request. The idea was to check if the player id in an incoming request to StartMatchmaking was associated with any active player sessions at the time of the request. The purpose of this was to prevent backfill requests from getting terminated suddenly and not knowing whether this happened or not since the OnUpdateGameSession handler function does not get called when a backfill request gets cancelled due to duplicate ids. Technically, you can call the GameLift DescribeMatchmaking function on the backfill ticket id to check whether or not the backfill request is still in progress or not but it seems from the documentation that it is not recommended to call DescribeMatchmaking too much. However, once again, the point is to prevent backfill requests from getting cancelled due to duplicate ids so that I would not have to worry about OnUpdateGameSession or DescribeMatchmaking. Ultimately, I realized that checking if a player has an active game session currently is not enough to prevent backfill requests from getting cancelled due to duplicate ids. Although it is very unlikely but still theoretically possible, while a player session is in the reserved status or a match was created for a player but the game session and player sessions have not been created yet, that same player can still log onto the same account on another running instance of the game client and get into another match. What happens as a result of this rare scenario is that you have a player in two matches, and one of those game's backfill requests will get cancelled due to duplicate ids. This ends up becoming a bigger problem outside the scope of the tutorial series but I would highly encourage you all to look into ways that different game titles prevent players from getting into multiple games at once. Some games prevent people from running multiple client instances simultaneously on one machine, but this alone is not enough to prevent the problem being addressed since people can just run one client instance on multiple devices while logged into the same account on each device. Many games keep track of when a user is logged into a game client in an external database like DynamoDb for example and then prevent users from logging into an account that is currently "logged in" already. This is synonomous to implementing a health check, an online/away/offline status check, or player/user sessions. League of Legends, for example, I believe kicks a player/user out of the game client if someone else logs into that same player/user account in a separate running instance of the game client. And even after adding these kinds of modifications to your game, you may still have to add separate GameLift or UE4 logic on top of that to prevent a player from being in multiple games, but I am not too sure about this last point. For example, going back to earlier in this comment, while a player session is in reserved status or the player session hasn't been made yet after a match has been made, a matchmaking request with the player id of that player session can be made, so the question becomes how do you deal with that? Sometimes players genuinely fail to connect to the server due to network issues, so you could make them wait until their player session is no longer in the reserved status for instance. As for the second situation, it's hard to deal with this because I have found cases where matches get made but there are no available server processes at the time to host a game session and player sessions for that match, so the best way to deal with this is to make sure your auto scaling policies are properly set so that the fleets in your queue always have enough capacity for player demand, which we will try to go over in part 12. At the end of the day, just keep in mind that this tutorial series does rely on a lot of perfect circumstances such as not having multiple client instances logged into the same player account, always having enough GameLift/AWS resources for every match made, and more. Sorry if this was too long to read, but I just want to get you all thinking and discussing, and hopefully you all can explore more on your own.
Keep it up
Also, at around 30:14 in the video when we are talking about the "hacky" way to test a new server executable quickly without having to upload a new server build and create a new fleet, you may find it hard to end multiple tasks through the task manager since you can't select multiple background processes at once. As I mentioned in the video, the server processes restart very quickly after they stop running and as you saw in the video, there is no way to differentiate the different unreal engine processes in task manager. All of these factors make it difficult to quickly test out a new server executable using the "hacky" way discussed in this video if you want to replace more than one of or all of the server processes running in a ec2 instance. So if you have a lot of unreal engine server processes that you need to terminate at once, then it may be better to use the command prompt for quitting multiple server processes at the same time in a windows ec2 instance instead.
And another point, in addition to being able to copy and paste or drag and drop files from your local machine into the ec2 instance, you can also copy and paste or drag and drop files from the ec2 instance to your local machine.
thank you for amazing tutorials. How did you know what codes to write here and there? Is there any documentation about codes to write for cognito or some other services?
Hey, you are most welcome. Most of the documentation, with regards to AWS, that I refer to comes from docs.aws.amazon.com/
Hey could you help me know where in the lyra code can I find the individual player kills and assists are stored that's being loaded onto the leaderboard that's shown you click the tab button?
Perhaps in the future but not atm.
@@Flopperam Hey thanks, A quick question. How can I remove the team logic from elimination gamemode in Lyra.
That I'm not sure unfortunately as I haven't looked at the lyra project enough.
If I only want to connect my gameclients to my server without login, matchmaking, and all that stuff, what is the easiest approach? I have the server working (on gamelift local at least), and waiting for clients. I just want the client to find all the available matches at some server url right? I have a widget prepared to list all available matches. How can I get them? Is there an url or something I can search at? I tried the yetitech plugin, but I couldnt get my project to build. Its 2 years old so I understand why :p
I would suggest making an API gateway method that points to a lambda function that calls GameLift.describeGameSessions from the AWS SDK, docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/GameLift.html#describeGameSessions-property. If there are no game sessions, which will usually be the case, then you can have your client call another API gateway method that points to a lambda function that calls GameLift.createGameSession, docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/GameLift.html#createGameSession-property. Both methods should return an IP address and port for a game session that a client can connect to using the OpenLevel command.
@@Flopperam I cloned this repository: github.com/aws/aws-sdk-cpp
Should I just copy-paste what I need from that folder into my games c++ folder?
@@Marius-vw9hp No, because you still need the associated library files and it just gets complicated, at least for most people when trying to build those library files. That's why I switched over to NodeJS, Lambda, API Gateway, and HTTP requests for this tutorial because it's much easier. I may try to make an open-source plugin in the future that wraps around the aws sdk but no plans for that in the immediate future.
@@Flopperam Can i use lambda, node, etc while working in gamelift local?
@@Marius-vw9hp for that, unfortunately, you can't I believe since GameLift local is very limited in functionality so you'll have to use the AWS CLI, docs.aws.amazon.com/cli/latest/reference/gamelift/index.html, when testing with GameLift local.
I’ve watched a couple of videos and I was just wondering. How easy it would be to have playfab be where all the players data is held and then have gamelift just run Matchmaking.
Hey, I don't think that would be a hard integration considering how you store and interact with player data can be independent of gamelift and matchmaking. Also it seems that Playfab handles a lot for you already with regards to player data. Keep in mind that I have just started exploring playfab so my advice may not be the best.
Flopperam I imagine once I watch a few more videos ill be able to integrate it myself. I was just wondering which parts of gamelift holds the accounts and data in these videos?
@@alextsangaris9670 Great question, so GameLift is only responsible for server hosting, scaling, and management. You can use any other services for player accounts and data. In these tutorials, just to make things more compact and easier, we used other AWS services for this: Cognito for user accounts, and DynamoDB for custom player data/stats.
@@Flopperam So I have been watching more of the tutorial series and they're a lot of help. I was just wondering would it be a good idea to use playfab for the stores and all stats. Then keep all the aws services for matchmaking? Or would this make things run weird?
@@alextsangaris9670 Hey, I think that's a great idea. I've heard of people doing similar combinations, so I see no problem with it.
Hi i see your videos r great but can u show us how to make a inventory and shelids and this things
Hey, we will add it to our very long to do list!
Awesome!!
Would games like fortnite,Dead by daylight and etc use game lift?
I believe Dead By Daylight does use GameLift. I'm not sure about Fortnite, but it definitely use some AWS services, whether it's GameLift or not. However, I'm not sure if they use AWS for hosting or they use their own servers for hosting. On the AWS GameLift homepage, aws.amazon.com/gamelift/, the featured customers that use GameLift include Super Mega Baseball, Quake, For Honor, Friday the 13th, and Dead By Daylight. There are some nice case study articles/videos for each of them on the homepage that I recommend checking out if you have time.
Flopperam well I looked at fortnite and seems the only servers are the one with gamelift
@@inactiveuser124 interesting, may I ask for your source on that information? I'm curious
Flopperam so I looked at all the Current locations and that have fortnite servers and all of them line up to every region that has gamelift and it would be wise for epic games to use it as it would benefit them a lot
@@inactiveuser124 I see, thanks for letting me know.
epik