Well first of all apologies to everyone for the lack of posts this month, if you follow me on Twitter you’ll know I’m extremely busy with a couple of big games for clients so I’ve had very little time for blogging!
Anyway, one of the projects we’re currently in the early stages of is a multi-player game for the Facebook platform. I’ve done some multiplayer games in the past, quizes and simple heads up puzzle games, but nothing this big or complex. In the past I’ve used both SmartFox server, and an early version or ElectroServer, but since I’ve not done any multiplayer games for a while I’ve been researching which would be best to use for this project. As part of that reserach I picked up a copy of Jobe Makar’s latest book Actionscript for Multiplayer Games and Virtual Worlds and I thought I would post a quick review here. (By the way – I’m now 99% decided on Electroserver for a number of reasons, so expect a tutorial on that in the near future once we have the first demos completed!)
Actionscript for Multiplayer Games and Virtual Worlds
I first heard of ElectroServer in Jobe Makar’s first book Flash MX Game Design Demystified. From the title you’ll immediately realise that book is quite a few years old, writted back when Flash was still a Macromedia technology. In fact, that book was published in 1993 right about the time I was first getting into Flash. It was actually March 2003 when I uploaded my first Flash games to a website and saw the incredible potential for the technology – and a good portion of my knowledge at the time came from that book.
Well, fast forward 7 years and what does Jobe’s latest offering bring to the table? Well as you’ll gather from the name, the book is about multi-player game development, and specifically about building multi-player Flash games in AS3 using the ElectroServer socket server. In the second chapter Jobe does talk about different technologies, and briefly mentions alternatives to ElectroServer, but then moves swiftly on and focusses on ElectroServer for the rest of the book. Now, I should mention that there’s a good reason for that – Jobe is one of the co-founders of ElectroTank, the makers of ElectroServer and so has a vested interest in promoting the software. Having said that, I’ve spent quite a bit of time investigating and testing alternatives, particularly the big rival SmartFox, and in my opinion ElectroServer is the best choice for most applications.
The early sections of the book focus on server technologies, concepts and security issues before an installation guide for Windows, Linux/Unix and Mac. Then he dives into the ElectroServer API with the obligetory Hello World example. The rest of the book then teaches one concept at a time using real world examples. Chapter 5 looks at chating, how chats are made available to users and how to set that up using ElectroServer. Chapters 6 through 8 look at more basic concepts such as the difference between client and server code, movement and lobbies and finally in chapter 9 Jobe gives the first full game example – he takes you through the process of building a real-time tank game, and by the end of that chapter he has covered a lot of really useful concepts, from collision detection to path finding and even spatial audio (something very few authors seem to touch on).
Chapter 10 looks at tile based worlds, discusses their advantages and looks at the logic behind a tile based engine, and a good explaination of the a* pathfinding algorithm. That is then built on in chapter 11 with a look at building a co-operative 2 player game. Chapter 12 is where things start to get really interesting with a look at the isometric viewpoint and how that can be used effectively in building virtual worlds.
The rest of the book I’ve only skim read so far, and it covers a number of useful topics such as player avatars, buddies nd virtual worlds, and finally the appendix offers a guide to setting up the sample extension which can be downloaded from the website.
Here’s a breakdown of the chapters in details:
Chapter 1. Web Game Landscape
Where Multiplayer Fits In
Chapter 2. Connecting Users
Socket Server Choices<
Chapter 3. Security: You vs. Everyone Else
Chapter 4. Introducing ElectroServer
Chapter 5. Chat
Simple Chat Room
Chapter 6. Where Decisions Are Made
ElectroServer Plugin Concepts
Installing the Extension
Chapter 7. Real-time Movement
Latency and Clock Synchronization
Chapter 8. Lobby System
Dig Game 2
Chapter 9. Real-time Tank Game
Authority and Prediction
Line of Sight
Chapter 10. Tile-based Games
Tile-based vs. Art-based Levels
Other Tile-based Benefits
Chapter 11. Cooperative Game Play
Types and styles of Cooperative Game Play
The Game: Super Blob Brothers
Server vs. Client: Who’s the Boss?
Chapter 12. Isometric View
Basics and Benefits of Isometrics
A Technical Look
Chapter 13. Avatars
Meet the Avatars
Avatar Creation and Customization
Chapter 14. Virtual Worlds
Chapter 15. Buddies
Buddies in Old World
Chapter 16. User Homes
User Homes in Old World
Appendix: Setting Up the Sample Extension
Configuring the Logging
Setting up the Server-side Development Environment
I’ve not had time to go through all of the examples yet, but those I have gone through have been excellent. Jobe is a great writer and is able to get the concepts across easily making the book quite an easy read despite the technical content. It’s also well laid out and edited so you’re overwhelmed with pages crammed full of code. In fact, when I first picked the book up I was a little dissapointed as it’s quite small and I wrongly assumed it was light on content, but quite the contrary – in fact it’s amazing how much solid content Jobe manages to cram into such a small package of less than 300 pages.
Personally I can’t wait for the designs for my project to get approved by my client so I can dive into the development work, and many of the concepts taught in this book will be cornerstones of my approach to the new game. If you’re at all interested in building robust multiplayer games in Flash then you really do need this book, and you can certainly expect one or more tutorials on the subject posted here at some point in the future!
Buy Actionscript for Multiplayer Games and Virtual Worlds on Amazon