Unity Mulitplayer Games Book Preview

Hey everyone! I’ve been super busy with some awesome career developments. In the meantime, I have a really cool Unity programming book I will be reviewing sometime this weekend.

Here’s a quick preview of the book to wet your appetite!

Unity Multiplayer Games by Alan Stagner, published by Packt Publishing, covers a variety of paradigms to use for creating multiplayer games in Unity. Starting from basic UDP communication, the book progressively builts up through cloud-hosted game servers, matchmaking, chat clients, event systems, stat databases, server-side physics and hit detection all in Unity C#. It is an extremely powerful and detailed book that will have you building all kinds of cool multiplayer projects right from Chapter 1!

Anyone familiar with Unity 3 or 4 and basic C# can pick up this book and learn some very awesome skills that are relevant to the games industry.  As someone who is currently just getting started in game development professionally, I can attest the topics covered in this book are very relevant. With the way the industry is moving progressively to an “always-online, always-connected” state, these skills are critical to have if you want to stand out.

My full review of the book will be coming out sometime this weekend, probably late Sunday, where I will go much more in depth on the book and its specific topics.

Here is a small snippet from Chapter 3 of Unity Multiplayer Games by Alan Stagner:

Chapter 3, Photon Server – Star Collector, introduces dedicated servers for
games. It covers creating a Photon Server application, connecting to a server, using
the request/response/event system to communicate, and creating a simple Star
Collector game.

Dedicated servers
Photon Server is built on the concept of dedicated servers. Whereas in Unity
Networking one player is the host and other players directly connect to their
machine, in Photon Server you host one or more dedicated servers that players
connect to. Additionally, this server usually performs as much game logic as
possible, unlike Photon Unity Networking /Photon Cloud, where clients are
responsible for game logic.

Dedicated servers are most often used for MMO-type games, as mentioned
previously. By processing as much logic on the server as possible, the potential for
cheating is dramatically reduced. For example, many MMOs implement simple
point-and-click movement logic, where the player simply points where they want
to move to. The client would most likely send a simple move request containing
the point the user clicked. The server handles path fi nding and actually moving the
character to that point. The client can also predict how the character will move (by
generating its own path and moving the character), but ultimately the server gets
total control over the character (and likely broadcasts an absolute position often,
which the client “corrects” as its own state, to ensure the client is always in step with
the server).
Photon Server also includes a redistributable package. This allows players to
host their own servers, similar to games like Minecraft (where the server logic is
separated into another application, which is running with the game). This can be an
improvement over games hosted within the client, as players can run their server on
a dedicated machine without playing actively.

For a sample of Chapter 3, including code on setting up Photon Server, download it here.

Leave a Reply

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