Multiplayer

This week in Captureball the dodgeball mayhem is finally becoming a game that can be played with others, but a few issues stand in the way of the fun. After putting a lot of time into the AWS infrastructure and the Unreal Server back end the missing link has been putting our gameplay code into a network friendly format.

Yellow and Blue teams spawn at opposite ends of the map with basic UI, the values will be assigned by a call to the server’s HUD class

Currently as it stands the gameplay code allows some key functionality to be sent using Unreal’s Replication system. This is good as the basics are technically playable with a team being able to win at the end of a match. Unfortunately a lot of code is decoupled from Unreal Engine’s class reflection system using some vanilla C++ code for gameplay code. This works fine for single player, but when it comes to networking the code it makes it difficult to feed into the replication system in order to update the data on each client. This has the effect of allowing players to have certain actions like picking up and throwing balls not communicated to each other in the fashion that would be desired when playing a game. The thrown projectiles will register a hit but not visually show up as being picked up and thrown! My rest of the week will be spent improving this so we can have a multiplayer demo for others to jump in and try.

Here is a closer look at the yellow team spawn, the server will take in players from AWS Flexmatch and assign starting points based on the incoming team assignment from Flexmatch. The Unreal server back end also uses a few different classes to communicate the state of the match to the clients with the GameState and PlayerState classes holding information about the ongoing match. The GameState holds the amount of players who are alive on both teams and broadcasts an update to the server whenever that amount changes. When one of the team’s currently alive count reaches zero the opposite team when be recorded as the winner of the match and the server will then begin shutting down the match and disconnecting clients. The basic UI will be updated to hold the values of how many are alive on your own team and the enemy team. It will also tell how many balls were captured in the “Capture Mode” where the balls will be constantly generated for your team to collect in preparation for the “Elimination Mode”.

Overall it has been quite a lot to take on and I have learned a lot from this experience. My main goal now is to polish up and get a fun basic little multiplayer experience going for others to try. -Darrell Wulff

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: