PacktLib: Unity Multiplayer Games

Unity Multiplayer Games

Credits

About the Author

About the Reviewers

www.PacktPub.com

Preface

Unity Networking – The Pong Game

Introducing multiplayer games

Introducing UDP communication

Setting up the Master Server

NetworkViews and state serialization

Writing a custom state serializer

Using RPCs

Initializing a server

Connecting to a server

Connecting to the Master Server

Registering a server with the Master Server

Browsing available servers

Setting up a dedicated server model

Loading networked levels

Creating a multiplayer Pong game

Summary

Photon Unity Networking – The Chat Client

Differences between PUN and Unity Networking

Setting up PUN with Photon Cloud

Using PhotonViews

Connecting to Photon and getting a list of rooms

Creating and joining rooms

Filtering results by user preference

Automatic matchmaking

Finding friends

Syncing a level between players

Creating a chat client

Summary

Photon Server – Star Collector

Dedicated servers

Getting the Photon Server

Creating a server application

Connecting from Unity and passing messages

Creating a game logic class

Assigning player IDs

Building a star collector game

Summary

Player.IO – Bot Wars

Player.IO versus the Photon Server

Getting and setting up a development server

Setting up the Unity client SDK

Connecting to Player.IO

Getting a list of rooms

Creating rooms

Random matchmaking

Sending/receiving messages

Working with BigDB

Creating a simple RTS prototype

Summary

PubNub – The Global Chatbox

Overview of PubNub

Getting started

How PubNub works

Parsing JSON from PubNub

Building a PubNub interface

Creating a global chatbox application

Summary

Entity Interpolation and Prediction

Entity interpolation

The client-side prediction

Rigidbody simulation

Creating a networked object

Adding naive interpolation

Improving interpolation

Preparing for server authoritative movement

Implementing server authoritative movement

Notes on hacking

Summary

Server-side Hit Detection

Client-side versus server-side hit detection

Creating a testbed

Moving hit detection to the server

Entity rewinding

Summary

Index