Game
Project Sky Conquerors
7 years ago

Player connections and the evil that is Unreal Engine


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.

5d0a900b82d79.gif

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.

5d0a900e80fdf.jpg

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

Loading...

Next up

art comission.

"Thanks guys for endless hours of fun." 👍

(My first fan art. Read the article, please.)

#sonic #mario #photoshop

I have added rewards for quests so that villagers can give you something in return for your hard work helping them. 🥳

I want to know - what's your favourite quest reward?

Demonstration of the spells and their effects :)!

Rockin the Guitar, an Axe like Guitar I made for my Uni project

Call it 'wrong turn'!🚫 The feeling of running into a house with only one exit🚪, and being doomed to die. #pixelart #pixelartist #pixelartwork #art #pixel #indiegame #IndieGameDev #indieartist

Alone Together....

Made my first ever animation.

Only true badasses may pass! #conceptart #art #gamedesign