[[This is a Table of Contents (and also “About” and “Scope” sections) from the upcoming book, which is currently being beta-tested. For details of this Beta Testing, please refer to the post on it. All the content published during Beta Testing, is subject to change before the book is published.]]

UPDATE: the book has grew soooo large that we decided to split it into 9 volumes (about 300 pages each) instead of three. It means that we plan to print the content which was planned as original Vol.1 as “new” Vol.I-Vol.III, the content planned for original Vol.2 – as “new” Vol. IV-Vol.VI, and the content intended for original Vol. 3 – as “new” Vol. VII-Vol.IX. If you have backed this book on Kickstarter or Indiegogo – please see relevant updates on KS and on Indie.

The book is WIP

“Development and Deployment of Multiplayer Online Games” (#DDMoG for short), consists of 3 parts: ARCH(itecture), PROG(ramming), and DEPL(oyment). Each part is planned as 3 volumes.

About

About the Author. The author of this book is a ‘No Bugs’ Hare from the warren of Bunnylore. He is known for being a columnist for Overload journal (ISSN 1354-3172) and for his significant contributions to software development blog ithare.com. As ‘No Bugs’ is a rabbit with his mother tongue being Lapine, he needed somebody to translate the book into some human language. And of course, as the book is highly technical, to translate technical details with the highest possible fidelity, he needed a translator with substantial development experience.

About the Translator. This book has been translated from Lapine language by Sergey Ignatchenko, a software architect since 1996. He is known for writing for industry journals since 1998, with his articles appearing in CUJ, Overload, C++ Report, and (IN)SECURE Magazine. His knowledge of Lapine is quite extensive, and he is routinely translating the column which ‘No Bugs’ writes for Overload. During Sergey’s software architecting career, he has been leading quite a few projects, including being a co-architect of a G20 stock exchange (the same software has been used by stock exchanges of several other countries too), and a sole original architect of a major gaming site (with hundreds of millions user transactions per day, and processing hundreds of millions of dollars per year). As a kind of paid hobby, he’s also inventing things: he’s an author and co-author of about a dozen of patents (unfortunately, owned by his respective employers 🙁 ).

About the Illustrator. Illustrations for this book are made by Sergey Gordeev from gagltd.eu. He is a professional animator with 10+ awards from various animation festivals, and is known for being a director of some of Animated Mr. Bean series.

Scope

Whenever you open a book for the very first time, you naturally have two questions: “Is this book for me?” and “What is this book about?”. First, let’s see whether this book is for you if you want to use a 3rd-party game engine.

Whether Writing Your Own Engine or Choosing an Existing One, You Do Need This Book

“One thing you should never do, is blindly believing that the engine will be a perfect fit to your specific gameIn many cases it may be very tempting to use an existing (usually 3rd-party) game engine rather than to develop your own one. And quite often it may be a Really Good Idea to do so. However, one thing you should never do when developing anything-more-complicated-than-two-player-tic-tac-toe, is blindly believing that the engine will be a perfect fit to your specific game. Even when the game engine is used by dozens of highly successful games – there is no guarantee that it will work for your specific requirements (unless, of course, you’re making a 100% clone of one of these games).

Instead of assuming “The Engine Will Do Everything Exactly As We Want”, you should try to understand all the relevant implications of the engine-you’re-about-to-choose, and see if its limitations and peculiarities will affect you badly down the road. This is where this book will be useful. It won’t compare existing engines, but it will describe (and explain) principles which are necessary to build a technically successful multi-player game. It means that you will be able to make an informed decision about the game engine (and maybe will decide to write your own parts to complement the existing engine).

So, if you’re going to choose an existing game engine – you need to understand how game engines work (so you can choose the game engine which is suitable for your needs even when you grow to millions of players). And if you’re going to write your own game engine – you certainly need to understand how game engines work. It means that

Whatever you do while developing your own Massively Multi-player Game,You DO Need This Book 🙂

That’s all what matters for now; we’ll discuss pro- and contra- arguments for DIY over reusing 3rd-party stuff in Chapter [[TODO]].

Focused on Massively Multi-Player Games, but Applies to LAN-based Games Too

“If you're about to write a LAN-based game – most of the this book still applies, but make sure to read AppendixNow let’s try to answer the question “What is this book about?” As the title suggests, this particular book is all about massively multi-player games working over the Internet. It means that single-player games are certainly not our focus; however, for LAN-based multi-player games with only a few players this book is relevant (to a certain extent). While you certainly can build a LAN-based game along the lines described in this book, and it will work, doing it in a way-optimized-for-massively-multiplayer-environments may involve quite a few overkills, which in turn may lead to unnecessary delays with releasing your game. If you’re about to write a LAN-based game – most of the this book still applies, but make sure to read Appendix “Applicability to LAN-based games” for discussion of potential simplifications which you may apply. [[Beta notice: at this point Appendix is tentative and not guaranteed]]

Whenever saying “massively multi-player” game, I mean that the game should be able to reach really massive numbers; if following the advice in this book (including that of in Part D), millions of the players should be perfectly doable; I’ve personally architected a site which has hundreds of thousands of simultaneous players and handled hundreds of millions of user transactions per day.1

1 for our purposes, “user transaction” is an interaction of a user with the server, which causes server-side changes, where these changes are visible to at least some other players

Genres: From Social Games to MMOFPS, with Stock Exchanges in Between

When it comes to the game genres, this book aims to cover all of them (as long as multiple players are involved). While these games vary in terms of requirements imposed on the engine, these requirements are still interrelated; moreover, these requirements represent a more-or-less continuous spectrum, so breaking it at any given point would be quite arbitrary. Let’s take a look at the Latency Tolerance a.k.a. Acceptable Input Lag (which is one of the most important requirements from the multiplayer game engine perspective):2

Social Games (usually Facebook/Phone). Typical Latency Tolerance: usually minutes are ok

As you can see, there is a whole spectrum of latency requirements, from minutes for social games to high double-digit milliseconds for MMOFPS, with pretty much everything in between. However, we will see that as soon we take latencies into account, further differences between genres become much less pronounced from the multiplayer engine perspective.

2 only typical values are provided, your mileage may vary, batteries not included. Also note that here we’re speaking about end-to-end latency/input lag (from controller button pressed, to player seeing results on screen); lots of different factors will eat milliseconds out of this allocation even before we have a chance to look at the data, see further discussion in Chapter [[TODO]]

Topics: All But Gameplay/AI/Monetization

“While we're not about to answer the question “WHAT do you want to do?”, we will try to answer the question of “HOW to do whatever-you-want-to-do”Game development and deployment is a huge task, so it is important to realize what exactly we want to cover. This book is very ambitious in this regard: it aims to cover all the aspects of game development and deployment, with one (though all-important) exception. In this book, we won’t try to answer questions such as “What should your game be about?”, “How should your game look?”, and “How to make money out of your game” ; these are all-important business questions which you need to answer yourself. When starting development you should know exactly how you want your game to be played, how you want it to look, how your AI (if applicable) will work, and how you’re going to monetize it.3 These questions are completely out of scope of this book.4

On the other hand, as soon as you have answers to these questions – this book has got you covered. We’ll discuss pretty much everything you will need to release your game and keep it running, from overall architecture to deployment and post-deployment issues.

In other words: while we’re not about to answer the question “WHAT do you want to do?”, we will try to answer the question of “HOW to do whatever-you-want-to-do” in as much detail as we can fit into one single book.

Too Large to Fit and Therefore Sketchy: 3D and Physics

While we’re aiming to answer all the questions related to “HOW to do whatever-you-want-to-do”, there are a few issues which are very large on their own, and just wouldn’t fit into one single book. As a result, these issues are admittedly sketchy in this book; while we will have a chapter on 3D graphics and sound (and will discuss physics engines too), please don’t expect this to be as detailed on these topics as those books which are dedicated to 3D engine design.

What is included, should be sufficient to choose your 3D engine (which can often work as a physics engine too). However, if you want to write your own 3D/physics engine, you will need to go beyond this book (I will provide necessary pointers within appropriate chapter).

3 of course, your vision will change as development goes on, but at any point you should have a clear vision of “What you want to achieve”

4 Note that while business question of monetization is not covered, a technical question of payment methods is covered to some extent

Prerequisites

“If your game project is your very first programming project – you're likely to have difficulties understanding this bookThis book is targeted towards at least somewhat experienced developers (in other words, it is NOT “how to develop your first program” book with IDE screenshots and copy-paste examples). If your game project is your very first programming project – you’re likely to have difficulties understanding this book5. For example, I am not going to explain what the “function” (“database” etc.) is; also I expect you to know what “source control” is and why it is necessary, and why encapsulation is a Good Thing(tm).

On the other hand, this book doesn’t rely on in-depth knowledge in any specific area. You don’t need to be a network guru who knows every tiny detail of RFC 793 by heart, neither you need to have hand-on experience with shaders and/or CUDA; even less I expect you to be a C++ guru who is capable of writing boost-like templates (to be honest, at the moment this last one is beyond my own capabilities too). Of course, 3D graphics experience may be helpful for 3D games, and knowledge of network basics and sockets won’t hurt in any case, but whenever discussing the issues which go beyond “things which every developer out there should know anyway”, I will try to provide pointers “where to read about this specific stuff if you happen to have no idea about it”.

5 Feel free to read the book even in this case, but don’t complain too much if it turns out to be too difficult

CD NOT included

The book is not going to have an associated CD. First, any attempt to provide CD-with-sample-code almost inevitably ends up in a very platform-specific code, and as one of the main points of the book is that your platform depends on your needs, providing heavily platform-specific code to illustrate this point will be a kind of oxymoron. Second, as mentioned above, this book is not intended as a book-where-you-can-copy-paste-your-very-first-game-from. The reason behind this approach is that in the Internet Age it is easy to find specific information such as “how to write your first Direct3D program”; such tutorials are abundant and can be found (if necessary) elsewhere.

On the other hand, 50’000-feet view with architectural concepts and practical observations such as “what are the advantages of TCP over UDP and vice versa depending on your particular game” or “why exposing multithreading to game logic level is harmful” are relatively difficult to find; this is what this book intends to cover.

BYOS (Bring Your Own Salt)

“In the practical world (especially in game development), for each and every “Do THIS_THING this way” statement there exists a counter-exampleOne last thing I would like to mention before we proceed to more practical matters. There is no one single sentence in this book (or any other book for that matter) which is to be taken as an “absolute truth”. In the practical world (especially in game development), for each and every “Do THIS_THING this way” statement there exists a counter-example, illustrating that sometimes THIS_THING can (or even should) be done in a different manner.

Every advice out there has its own applicability limits, and so does any advice within this book. When I know certain game-related scenarios when these limits are likely to be exceeded (and the advice will become inapplicable) – I will try to mention it. However, it is extremely difficult to predict all the usage scenarios in such a huge industry as game development, so you should be prepared that some of the advice in this book (or any other book) is inapplicable to your game without warning.

Therefore, take everything you read (here or elsewhere) with a good pinch of salt. And as salt is not included with the book, you’ll need to bring your own one. In more practical terms –

For each and every decision you make based on advice in this book, ask yourself:Does This Advice Really Apply to My Specific Case?

[[To be Continued…

First (actually, first, second, or ninth – depending on the poll above) chapter from the book coming soon… Stay tuned!

Comments

Something I didn’t see mentioned in your TOC is latency simulators. For doing online development with UDP, it is the easiest tool I’ve used for finding bugs. Take what you’ve made, crank the latency up to 1000ms or so and see if it still works. Then set it to reorder and/or drop packets, you’ll find even more bugs. The one I used was a regular Linux box bridging two subnets, I can’t remember the name of the program it used.

Really interested in the book BTW. New Riders “Developing Online Games” is also an excellent resource for MMO development.

Don’t forget my favorite bot fighting technique, Game Design. I played WoW back shortly after beta. My attack sequence was: tab, 122322422 90 repeat. ( 9 and 0 to replenish health and mana.) By contrast, the game I had played just before that involved too much aiming and risk to effectively bot. The game was too complex to reduce to easily reproducible behaviors regardless of area. A context sensitive game is inherently bot resistant, and more fun to play. The game I played before the fun one? Matrix Online, where I was essentially forced to bot for crafting. Because I was the only player with a decent crafting supply, I ended up making a few hundred dollars selling the crafting supplies.

If fishing is boring, it will be botted almost immediately. Context, player feedback, and in some cases, less clues. Trove fishing is botted by looking for the sound playback function call. If the line just twitched and it was an obvious message or giant function call, it would be harder to bot. Including memory addresses, fishing bots were released 2 days after fishing was released.