售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Unity Multiplayer Games
Table of Contents
Unity Multiplayer Games
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why Subscribe?
Free Access for Packt account holders
Preface
Unity IDE crash course
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. 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
Servers in Unity
Compiler directives
Setting up a server console without Pro
Loading networked levels
Creating a multiplayer Pong game
Preparing the Field
The Ball script
The Paddle script
Keeping score
Displaying the score to the player
Networking the game
Spawning paddles
The networked ball
Networked scorekeeping
The Connect screen
Summary
2. 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
Creating rooms
Joining rooms
Filtering results by user preference
Filtering arrays
Filtering and caching a room list
Automatic matchmaking
Finding friends
Syncing a level between players
Creating a chat client
The Connect screen
The Lobby screen
The chat room
Adding friends lists
Summary
3. Photon Server – Star Collector
Dedicated servers
Getting the Photon Server
Creating a server application
Creating a class library
Responding to operation requests
Deploying the server code
Connecting from Unity and passing messages
Creating a game logic class
Assigning player IDs
Building a star collector game
Preparing the class library
The Actor class
Sending an ID to a player
Keeping track of the game state
Spawning and picking up stars
Broadcasting events
Connecting from Unity
Creating/destroying actors
Controlling the player
Summary
4. 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
Connecting to rooms
Creating rooms
Random matchmaking
Sending/receiving messages
Server-side code
Working with BigDB
Creating a simple RTS prototype
The server-side code
The client-side code
Summary
5. 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
Publishing chat messages
Displaying chat logs
Summary
6. 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
7. Server-side Hit Detection
Client-side versus server-side hit detection
Creating a testbed
Moving hit detection to the server
Entity rewinding
Summary
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜