Unity Multiplayer Games
... are no easy thing to create, so I'm glad that I recently got offered the opportunity to write a review on Alan R. Stagners book Unity Multiplayer Games
After working with Unity professionally for over 6 years and working in the multiplayer and networking field since the 90's, this was an offer I couldn't deny, especially as there are only very few good to learn about networking in Unity.
The book tackles the challenge in an easy to grasp and well structured way by investing the first 5 chapters to introduce different options for the multiplayer networking itself before introducing crucial core aspects that ensure a smooth multiplayer experience through interpolation and prediction of movement as well as server side hit detection to prevent easy cheating.
The books first chapter covers Unity Networking and it is one of the rare exception in this area by covering all relevant aspects including level prefixes and the required steps to setup an own Master Server and Facilitator. This allows the reader to create a production usable environment within half an hour upon which they can build in the future.
After Unity Networking, the book dedicates chapter 2 and 3 to the two distinct technologies offered by ExitGames. Starting out with Photon Cloud (PUN) and then followed by the Photon Server, the reader is lead through to the required steps to create a multiuser chat with friendslist and a simple, fun multiuser star collection game.
Following Photon, the book covers the Player.IO technology, guiding the user through the steps to get an application running through creating one with them. Warning: I consider the chapter troublesome as it advertises the service. I worked with Player.IO professionally and its a neat API but I need to warn developers and recommend not using it after working with it for over a year. The service has not only serious problems with reliability, the staff also does not inform (paying) users about existing issues and downtimes even when asked. Not being able to create any rooms at all for hours has been a long standing, common issue, which prevents your game from working at all as the service is built completely around rooms (all game logic has to be put in rooms). It often even takes weeks to solve crucial things, like paying for your plan at all (https://playerio.com/forum/viewtopic.php?f=29&t=35442) ... Should you aim for asyncronous multiplayer games, go with a service like Parse or PubNub instead. If you want realtime multiplayer games and player persistance, then using Photon Cloud and their newly added webhook support, in combination with a Parse-PubNub-like service (or your own webservice), is a great way to go.
PubNub is the 4th technology covered by the book and its probably the only truely different one. The author does a great job introducing its concept to the reader to build a small but representative chat application to get the user in touch with the service and expand upon it in their projects.
Interpolation, Prediction and Server-side Hit Detection
The chapters cover solid base knowledge for smooth multiplayer games and are not only a must read, they are also a must know. What leaves a somewhat sour taste after reading this chapter is the missing citication of the real authors of the interpolation code, which is Unity Technology, more specifically its code offered for years freely through the Networking Example package provided to unity users since Unity 1.x.
All in all the book is highly recommendable to readers interested in learning the core knowledge required to create realtime unity multiplayer games using Unity Networking, ExitGames Photon, Photon Cloud or PubNub covering the crucial aspects related to basic authorative network architectures, movement interpolation, further things to add and problems that regarding cheating.