Hello and welcome back to my second dev blog!
Kevin here back with an update.
A week has passed since my last dev blog and as promised, I will share my progress on the lobby so far.
So far the lobby:
Can hold an unlimited amount of clients, which all share the same timer.
Have a timer that starts the game when it reach 0, that is read-only for
clients.Have two maps to vote for, the map with the highest amount of votes will be selected.
I completed the lobby shown in the preview already last Thursday. However there have been mistakes that I’ve made which I (for some reason) didn’t realize until after having developed this. Which is how I handle replicated variables such as the timer and map-votes. Since I started working on the lobby I have been treating User Widgets the same as Actors, which is completely wrong.
Actors are blueprints that can be dragged out on a scene and referred to. While User Widgets are viewport blueprints which only sticks to one specific player’s screen. As the lobby was, it handled the timer and the votes as long as the person executing where authorized. This didn’t work as it’s really hard to get a reference to a player’s widgets.
What I then did was handling the timer in the lobby’s level blueprint. This worked at first but after a merge it got messed up. After having failed twice I changed my direction to an Actor. With an Actor getting references were easy, however the timer wouldn’t sync even when a client’s and a server’s authorities were correct. The client would do it’s own calculations on the timer, starting at the timer’s default value whenever it joined. Yesterday I found out why.
A simple checkbox. Apparently even if you make sure only the server is allowed to modify a variable, it still isn’t guaranteed that the client won’t modify the value. You have to make sure that Always Relevant is checked in the class defaults. I guess I’ll have to take that with a grain of salt and move on.
So now that I’ve finally managed to sync the timer between client and server I can move on to the next problem, map votes. Right now only the server’s map vote counts. This is something I should be able to fix soon now that I know how unrealistic logic truly works.
So after fixing the map votes, I will focus on:
Implementing an option for maximum allowed players.
Implementing the possibility for players to choose their names.
Making the servers’ names show in the server browser.
Fixing a problem where servers doesn’t show up in the browser after leaving the lobby, but can still be joined with IP.
Fixing a memory leak which I think exist in my code.
This is all I have to offer for today’s dev blog. Next week the group will take a break for the holidays, so you won’t hear from me for some weeks. I hope you all have a fantastic Christmas.
Cheers!
/Kevin
0 comments