The Multiplayer Update (Weeks 11&12)

Dec 11 – DEC 24

As was my plan, I spent these two weeks diving into multiplayer. Although I’d had many challenges along the way, and was about to give up on at least three occasions, I managed to pull through, and fully implemented multiplayer by the end of this phase.

More Pretty Stuff

I spent the first day and a half doing more of what I did the previous weeks. Stockpiles in the UI now had item icons instead of text, I gave text in UI an outline, and I reworked the recipe UI widget to work modular like other widgets. I also reworked how eating at the Inn for civilians worked, because it was being handled by the Inn entirely (which didn’t make sense). Furthermore I modified the renaming action, to make it more user friendly.

Replication Tutorial

Then I checked out a Tutorial Series on Replication in Unreal. From what I could tell at beginning, making multiplayer work in Unreal would be just as easy as I had thought. You’d literally need to tick a checkbox, and the engine would do the rest. That meant I had to revisit pretty much every bit of code to make sure everything was replicated as it should, but that wasn’t going to be an issue. After all I had made a multiplayer game (QR)  before, so I knew how it worked!

Only I didn’t *really* know how it worked. QR just worked, and it was simple enough that I didn’t have to worry much about how it worked. It was only now (with the help of that tutorial) that I understood how multiplayer actually worked, what replication actually meant. So I jumped into it, stared to tick those boxes and made a few things work (stockpiles and health mostly). I had a lot of issues, I felt like I still didn’t really get how it worked, so I looked for another tutorial to check out. I found a “from scratch” one, and decided to follow that starting the next day.

Blueprint Networked Multiplayer Tutorial

The tutorial I did next started from the beginning, creating a main menu and two players through steam. It was very thorough and nice to follow. On the first day I had no issues until the very last test, but I just managed to fix it by the end of the day, so I had the steam overlay running by the end of it.
On the second day however I noticed that clients couldn’t connect to the server yet.

It took me over three hours to fix this bug, and it finally turned out that the issue was caused by my nemesis: Relational operators (“>” / “<“).
During the matchmaking process for the client, the game checks whether the match it just found is full or not, and here I  had a greater than node when I needed smaller than node (currentPlayers < maxPlayers). I think this is the most time I’ve spent on such a tiny error in my career so far.

Either way,  I had completed the tutorial by the next day, totalling to 3 days. After that I tested it out with a friend from a remote location, and everything worked as intended!
Then I finally returned to making the actual game multi-playable.

Making it Multiplayer

I started by moving almost all play-related playerinput functionality from the PlayerController to the PlayerPawn Blueprint, as that was Unreal’s common practice.

I got stuck on replicating player movement for a while, until I decided it didn’t really matter, and focussed on other things. At some point I realised that there wasn’t a lot I’d need to replicate, because there still wasn’t a lot for the player to do actively yet.
Over the next three days I struggled through wrapping my head around replication (I think I finally got it by the end of day 2) and making everything look the same on local and remote client – because *looking* the same is what replication is actually concerned about. I also moved back to cologne during the second week, so I lost a whole day there.
By friday evening I got to the state where they remote player could do anything the local player could do, and see all the same information. There were still some minor visual issues, but they would be easy to fix. After Christmas I could finally start implementing the opponent!


During the review meeting on december 8th I had shown this slide, saying that I was well within the timeframe I set, and that I should be able reach the target product within the deadline.

project goals first review


However, having done multiplayer prematurely (it wasn’t even planned here), meant that I “lost” two weeks for the featured listed here. I would certainly drop save games from the goals – I had decided that when I started looking into multiplayer properly – but I’d have to see whether I could finish everything else. I planned to do some work between Christmas and the new year, but I probably wouldn’t get much done. I planned to revise the time plan asap.

Game Screenshot

gameScreenshot 12.24

State of the game on December 24th. The actual game has barely changed, but it’s multiplayer now (as seen by the other player in front)! There is also a chat window (will be resized soon). I also have a game menu now which is still WIP, as it it only for the multiplayer section. I wish everyone a Merry Holidays!

Current Build: DOWNLOAD

Leave a Reply

Your email address will not be published.