Development & Deployment of Multiplayer Online Games Vol. I
This book is 96% complete
Last updated on 2017-02-13
About the Book
The video above is from our Kickstarter campaign; while not 100% relevant, it is pretty close
NB: currently, PDF of Vol. I is ready (the same as used for paperback and hardcover on Amazon); however, EPUB and MOBI are NOT properly formatted yet (they should be in a matter of few weeks).
ISBNs for FINAL version: PDF: 9783903213074; ISBNs for EPUB and MOBI will be listed when respective editions are finalized.
What's the Big Idea?
The idea behind this book is to summarize the body of knowledge that already exists on multiplayer games but is not available in one single place. And quite a few of the issues discussed within this series (planned as
three nine volumes ~300 pages each), while known in the industry, have not been published at all (except for maybe in discussion forums).
Programming and deploying an MOG is a daunting task, and having a frame of reference is usually quite helpful — "hey, those guys have already tried this, and it worked for them."
Vol. I-III of the series are about MOG Architecture. In Vol. I, we will discuss general issues such as GDD - as well as Communicaton flows. In Vol. II and Vol. III - we'll proceed to discussing Client-Side and Server-Side Architecture respectively; Vol. IV-VI will describe issues related to Programming, and Vol. VII-IX will be about Deployment and post-deployment tasks.
The book has got endorsements from quite a few people known in the industry, including people from Amaya, Lloyds Bank, Lionhead Studios, BlueByte (Ubisoft Studio), Lightstreamer, Plarium, and (formerly) Zynga. For the endorsements themselves please see Kickstarter campaign.
And speaking of crowdfunding - the book has already been funded on Kickstarter and Indiegogo - with over 800 backers total (and counting). BTW, here on Leanpub there is a bundle which is exactly the same as an ongoing InDemand campaign on Indiegogo - $20 for Vol. I-III together with an early access (though on Indie there is also an option to pre-order paperback or even hardcover).
Since When Are Rabbits Programming??
I cannot speak for all of rabbitkind, but this particular hare has gone alongside my writings for quite a while now. He was born as "No MT Bugs" Hare in 2010, in an Overload article titled "Single-Threading: Back to the Future?"
Therefore, there is evidence that this particular rabbit has been programming at least since 2010. Yes, he has changed his appearance, but deep inside, he is still the very same bunny with a naïve idea of making programs less buggy. BTW, the character is created by Sergey Gordeev, a guy with many animation awards, known (among other things) for being a director of some of the Animated Mr. Bean series.
Who Is this Book For?
The book is intended for those intermediary developers who want to become senior ones, and for senior developers and up. I expect that the book will also be useful for decision-makers, from PMs all the way up to CEOs — so if you by any chance know one, please make sure to give her a link to this page ;-).
On the other hand, if you are working on your first programming project, this book will probably be too difficult for you. There will be no explanation on what event-driven programming is all about, what's the difference is between optimistic locking and pessimistic locking, why you need a source control system, and so on. Instead, there will be discussions on how the concept of futures fits into event-driven programming, when the use of optimistic locking makes sense for games, and how to use source control in presence of unmergeable files.
In the same spirit, the book is not intended to be a CD to copy-paste your sample MOG from. Instead, the book aims to help you write your own code that is tailored to your own needs, and tries to advise on the available choices at most of the junctions.
What's The Plan?
Vol. I is currently in "RC10", with all the content I'm planning, already included. No changes to the text are planned (unless something Really Stupid(tm) is found).
As I'm working with professional editors (and vast majority of them doesn't know anything but Word :-( ) - I keep and edit my manuscript as a bunch of Word .docx files (I throw myself at the mercy of the court, and assure that it is only because of dire circumstances beyond my control ). I'm using Word to export .docx to PDF, and some_VBA_scripts+Calibre to export to .MOBI and .EPUB.
Please note that current formatting is quite ugly; it will improve after being professionally formatted; it is also expected to pass all the .EPUB validity checks.
- The manuscript is already with typesetters and book designers.
- Then - it will be finalized here on Leanpub (and rewards for Kickstarter and Indiegogo backers will be sent out too)
- And finally, it will be published on Kindle (and on Amazon via CS). At this point, price of the book may go higher here on Leanpub (to match Kindle price).
All the comments are extremely welcome - and they DO help making the book better.
Chapter 1. Game-Design Document from an MOG perspective
Your Game As Your Baby
3500-Word Crash Course for First-Time Game Developers
On the GDD
Subject to Change, Seven Days a Week
Being Agile and Writing It Down
The Overly Generic Fallacy
On Project Stakeholders
On Focus Testing and Playtesting
On Marketing and Monetization: Critical Mass
On Stakeholder Availability
TL;DR on Project Stakeholders
On a Typical Non-MOG Team Structure
Time-to-Market, MVP, and Planning
Dealing with Time-to-Market
On the Importance of Holding Your Horses
TL;DR On a Crash Course for First-Time Developers
Three All-Important GDD Rules
On Separating GDD and Implementation Details
Dealing with “Difficult” Stakeholders and (Jobs Forbid) Managers
Limited-Lifespan vs. Undefined-Lifespan Games
Client-Driven vs Server-Driven Development Workflow
Dealing with Client-Driven Workflow
Option 1. “Continuous Conversion”
Option 2. “Integrate Server into Toolchain”
On Matchmaking and the Social Aspect of Your MOG
Matchmaking That Doesn’t Work (As a Rule of Thumb)
Matchmaking That Works
On Support for Smaller Groups of Players
Technical Issues Affecting Marketing and Monetization
Your GDD Requirements List
On MOG-Specific Teams
Timeline for the Back-End Team
All MOG-Specific Teams Must Be First-Class Citizens
Running Costs Breakdown
Common GDD Pitfall: Just Throw In a Multiplayer for Free
Game Entities and Interactions
Game Entities: What Are You Dealing With?
Interactions between Game Entities
What Should You Get? Entities-and-Interactions Diagram
Examples of Entities and Interactions
Social Farming and Farming-Like Games
Casino Multiplayer Games
Stock Exchanges, Sports Betting, and Auction Sites
Large Virtual-World Games (MMOTBS/MMORTS/MMORPG/MMOFPS)
Entities and Interactions Diagram As a Starting Point to Architect Your Game
Chapter 1 Summary
Chapter 2. On Cheating, P2P, and
If You’re Popular Enough, They Will Find Reasons to Cheat
The Big Fat Hairy Difference from E-commerce
Dealing with Cheaters
Attacks: The Really Big Advantage of the Home Turf
Published vs Unpublished Attacks
Published Attacks: Higher Impact, But Home-Turf Advantage Is Regained
Legal Stuff and Problems Banning
Abuses of Disconnect Handling
Stealing Your Source Code
Keyloggers/Trojans/Backdoors on Another Player’s Device
MOG Attack-Type Summary
Authoritative Client: Pretty Much Hopeless Against Cheaters (Except for Console-Only Games)
Code Signing—Doesn’t Really Work in a Hostile Environment (Except for Consoles)
Cross-Checks—Undetectable Attacks, Taking Over the World, and Latencies
Consensus (Actually, Majority Vote)—Even More Latencies
Trusted Nodes—Who Is the One We Trust?
Homomorphic Encryption—Doesn’t Even Start to Fly
Authoritative Client MOG Summary
Deterministic Lockstep: No Game-Rules Violations, But Wide-Open to Information Leaks
Authoritative Server: As Cheater-Proof as They Get
Authoritative Servers: Scalability Is Imperfect But Workable
An Example Calculation
Summary: Authoritative Server Is Not Ideal, But Is the Only Thing Workable
Think Positive! Or, Maybe There’s Still Hope…
Every Bit Counts: Multi-Layer Protection
Bottom Line for Chapter 2: Yes, It Is Going to Be an Authoritative Server
Chapter 3. Communications
Client-2-Server and Server-2-Client Communications
RTT, Input Lag, and How to Mitigate Them
Data-Flow Diagram, Take 1
Input Lag: The Worst Nightmare of an MOG Developer
Input Lag: User Expectations
Input Lag: How Much We Have Left for MOG
Accounting for Packet Losses and Jitter
Internet is Packet-Based, and Packets Can Be Lost
Client-Side and Server-Side Buffering on Receipt
Sync-Once with Subsequent Adjustments
Phase-Locked Loop (PLL)
TL;DR on Time Sync
Input Lag: Taking a Bit Back
Data Flow Diagram, Take 2: Fast-Paced Game Specifics
LAN RTT vs Internet RTT
On CDNs and Geo Server Distribution
RTT and Players
Back to Input Lag
Data-Flow Diagram, Take 3: Client-Side Prediction and Interpolation
Client-Side Extrapolation, a.k.a. Dead Reckoning
Running into the Wall, and Server Reconciliation
Client-Side Prediction: Dealing with Discrepancies
On Distributed Authority
Lag Compensation—Potential for Cheating vs. Player Happiness
Subtracting Client RTT on the Server-Side
Lag Compensation Is Inherently Open to Cheating…
…OTOH, Player Happiness Is Much More Important
There Are So Many Options! Which Ones Do I Need?
Game-World States and Reducing Traffic
Server-Side, Publishable, and Client-Side Game-World States
Limit on Bandwidth
Additional Reasons to Optimize Bandwidth
Triangles and Bandwidth
/Three Different States of MOG
Why Not Keep Them the Same?
Non-Sim Games and Summary
Publishable State: Delivery, Updates, Interest Management, and Compression
Interest Management: Traffic Optimization and Preventing Cheating
Implementing Interest Management
Grid-Based Interest Management
Interest Management as a Way to Prevent Information-Leak Cheating
On Frustum-Based Interest Management
Before Compression: Minimizing Data
What Exactly Is “Compression”?
On “Reference Bases” for Compression
“Reference Base” for Unreliable Communications. Low-Latency Compressible State Sync
Advantage of Low-Latency Compressible State Sync over TCP and Reliable UDP
Two Flavors of Delta Compression
Delta Compression—Generalization to Arbitrary Trees
Delta Compression of Arbitrary Trees—Collecting Updates “On the Fly”
Dead Reckoning As Compression
Dead Reckoning As Compression: Variations
Compressing Reliable Streams
Compressing Independent Packets
Compression Using Acknowledged Packets
Combining Different Compression Mechanisms and the Law of Diminishing Returns
On Using Doubles with Lossless Compression
On Adaptive Traffic Management
Adaptive Traffic Management—UDP
Adaptive Traffic Management—TCP
Adaptive Traffic Management in the Context of Authoritative Servers
Traffic and Real-Time Strategies
Traffic Optimization: TL;DR and Recommendations
MMOG and Scalability
On Shared-Nothing Architecture
An Obvious One: Separate NPC/AI
Splitting into Areas
Seamless Worlds: Overlap!
On Server-Side Uncertainty
Eliminating Uncertainty Completely: Time Sync
Synchronization without Rewind: CMS/LBTS. Lockstep
Synchronization via Server Rewind: “Value Date”
Transient Events, Forwarded Inputs, and (Kinda-)Broadcasted Messages
Potential for Information Leaks
(Kinda-)Broadcasted Messages (Broadcast with Interest Management)
Point-to-Point Communications and Non-Blocking RPCs
Implementing Non-Blocking RPCs
Void vs Non-Void Non-Blocking RPCs
Client-to-Server and Server-to-Client Point-to-Point Communications
“Macroscopic” Client Actions
Seamless Handling of Transient Disconnects
Option 1. Separate Caller/Callee Handling
Option 2. Two Guaranteed Delivery Streams
Going Further: Inter-DB Async Transfer with Transactional Integrity
Server-Side Entity Addressing
Server-Side: TCP Often Wins Over UDP
Using Message Queues for Server-to-Server Communications
MQs and Transactional Integrity
On Transactions in AMQP
Brokered vs Brokerless MQ
Broker as Directory Service
Brokers and Transactional Integrity
Using MQ on the Server-Side: Summary
On Protocol Changes
IDL: Encodings, Mappings, and Protocol Changes
Intra-Language vs Standalone
IDL Development Flow
IDL + Encoding + Mapping
On Sanitizing Input Data
Test Case Generation
Mapping to Existing Classes
Protocol Changes and Backward Compatibility
Growing Messages. Fences
Versions for Replies
Merits of Versioning
Which One to Choose?
Implementing IDL and Specific Encodings
Summary for Chapter 3
Vol. I Summary
Letter from the Author
The Leanpub 45-day 100% Happiness Guarantee
Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms
Free Updates. Free App. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers), EPUB (for phones and tablets), MOBI (for Kindle) and in the free Leanpub App (for Mac, Windows, iOS and Android). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.