Networking Rework Again!

Mirror Networking

Well, here I go again.
I finished moving my multiplayer TicTacToe to the new networking system using litenetlib and it worked beautifully! I had to do a complete rewrite on the relay server also. In the end, everything worked great and the world was happy!

I then excitedly decided to work on the multiplayer pong game. The whole reason for the TicTacToe game was that it is one of the easiest games to write, its turn based and perfect to use for my first multiplayer game. So when I finished that, I figured I need to work on something that had some live action, synchronized objects, player movement, etc. Thats where pong was a perfect choice.

I got all the way to the end where I was trying to sync the player paddles and the ball. I spent a few weeks trying different things but ultimately in the end, I decided to look at other Networking solutions, preferably something that already had syncing of variables under the hood. With LiteNetLib, you have to write your own syncing algorythms, and that is definitely not something I could pull off. I got pretty close a few times, but something would always cause it to get out of control.

Photon Pun2
The first thing I took a look at was PUN2, or Photon for Unity Networking, version 2. Due to the type of architecture I wanted, I needed to create a seperate server that manages the clients, not so much the game, but the clients themselves, somewhat of a matchmaker with more control. Photon Server seemed to fit the bill perfectly, at first anyways. After diving into it, I came to realize real quick the lack of documentation. Without this, its damn near an impossible task. Getting PUN2 working with the server was pretty easy, but in order to get the server to do what I wanted, was requiring too much research, forum posting and begging for information. I finally decided to go with Mirror.

The downside of Mirror is pretty close to the same as Photon, lack of documentation. Very abstract or high level examples that are tough to understand and not too much information available, at least for what I was looking for. I finally decided to sponsor it and get access to premium help, this was well worth it. In the end, after a few weeks, I got going in a good direction and should hopefully be able to get the Multiplayer TicTacToe rewritten using Mirror soon. A few good things about Mirror is that it was based on the original Unity Multiplayer UNET, its open source for those that get off on that sort of thing, tons of examples (If you can understand them, not for the basic type like me) and once you get a grasp of it, it gets easier to understand and implement.

I just wanted to give a quick update, document my progress and take a break from spewing code, lol.

Ok, back to it! See ya on the next one!

TGRKnight1

Author: TGRKnight1

I love making vidya games!

Leave a Reply

Your email address will not be published. Required fields are marked *

− 4 = two