So about 2 weeks ago, I started working on making dedicated servers for my University Assignment; a last-man-standing online multiplayer game in Unreal Engine.
I decided to go with PlayFab for hosting the servers since I liked their plans and thought it would be good enough for our game.
Spoiler Alert: I did manage to get the servers up and running connect multiple clients, and shut down the servers when no players were there and keep them on standby.
But boy, was the journey not so easy. The documentation was, let's just say, not too easy to follow.
I decided to follow the official PlayFab documentation but kinda ended up nowhere. They seemed very tedious and more inclined to use their example project.
So I started to look for YouTube tutorials and found out that there was just one guy doing tutorials on Unreal and PlayFab on YouTube, and although I got the basics set up following them, even his tutorials had some problems(some outdated stuff and some issues were not addressed).
I faced a lot of issues with firstly, the servers not deploying, and then if deployed they would be in an unhealthy state. Needed to update the ports which were outdated in the videos I was following.
There were problems finding a match using their ticket system, and when found a match, the level wasn't loading.
When the level was loading (after connecting 2 players), if a third player tried to join, they would just keep on waiting and the server didn't allow them to join the match.
Turns out that I had to add some extra rules to keep the server looking for new players. I found this out in a forum where someone faced this issue as well.
And after fixing even more problems, finally, I did it. I connected multiple clients on a dedicated server.
Never thought I would be so happy to see the 3rd Person Template level from Unreal.
There were further issues, like the server was running 24/7, which was using up my free hours, and getting null values from the server in some parts, but thankfully, I was able to connect with the person making the tutorials on his discord and sort those problems out.
I also integrated Matchmaking, currency, and inventory systems (just the basic setups), since we will be using them for our game, and it was pretty straightforward. I can track all of the user data and also add stuff to their accounts live using the PlayFab dashboard without needing players to update anything.
My next steps would be to maybe integrate Steam to browse these lobbies and maybe use Steam for the login system as well (right now, it's using PlayFab accounts), or use PlayFab's Find Lobbies API and not use Steam altogether as we might have some time constrictions as well. We have a presentation at the end of this month, and we are supposed to be ready with the basic multiplayer setup (since this assignment is due in May, and we have assignments in other modules due sooner) and then finally work on gameplay mechanics.
My designers are working on the presentation and also finalizing the game and level design. I think we are looking pretty good so far, and we'll be set if I can manage to smoothly integrate the lobby system in the next 10 days.
I learned a lot during the past two weeks, working on my first-ever dedicated server, and I'm sure I'm gonna learn a whole lot more during this project.
I will be making some sort of tutorial for setting up dedicated Playfab servers on Unreal Engine since there isn't anything available of that sort that works perfectly online. The videos that I followed were a bit outdated and had problems themselves. So I think my tutorial would help future developers to make this process a lot easier.
If you made it this far, thank you for reading, and I'll see you in the next one!
Comments