Packt Publishing recently got in touch and asked if I’d like to review their newly published book on Moai. I was rather excited about the prospect because this is the first book on Moai that I’ve heard about.
I’ve dabbled in Moai a fair bit, writing both the beginning of a mining game and a strategy game for Ludum Dare. In that time I’ve found Moai to be lightweight and fast to prototype with.
Developing Mobile Games with Moai SDK is written by Francisco Tufró. It focusses on the basics of the Moai SDK and also takes you through a couple of sample games.
“Developing Mobile Games with Moai SDK” is a book clearly aimed at experienced game developers. It doesn’t introduce any game development or programming concepts but instead focusses squarely on the Moai SDK. This is a good thing since the Moai framework is intended for professional game developers and is lacking in documentation.
I think its fair to say that the book reads more like a reference manual than anything else. The writing style feels slightly disjointed between sections and focusses on short specific topics rather than lengthy explorations. In fact, the book itself is rather short at just 136 pages (not necessarily a bad thing). I have to say the writing style also lacks personality so, if you like flavoursome reads, you’ll be disappointed.
The book covers a range of core concepts which are, on the whole, clearly explained. Many of the early stumbling blocks you’ll likely face when using Moai are covered; topics such as viewport scale vs viewport size (for resolution independence), rendering tables, and the concept of hosts as a means of achieving cross platform distribution. This book fills in the missing information, and answers those early questions that you’ll have, when utilising the core Moai offering.
I really appreciated the chapter on creating a resource manager (my prototypes up until now have just dumped the code in the main.lua file). Its nice to see the author exploring best practices, such as reusable modules, which puts you in good stead for creating other reusable components.
The book covers a short but comprehensive range of topics such as checking for touch and keyboard/mouse input (in the same code base), audio, texture atlas’s, basic animation, and physics. The section on cameras is fairly limited but useful, and handy techniques such as paralax are also covered.
Something that is sorely missed in the core Maia documentation are details on targeting various deployment platforms (such as iOS, PC, Mac, etc). This book does attempt to tackle deployment, doing a good job of detailing deployment to the iOS platform. Unfortunately other platforms don’t fair quite so well and are left with just a paragraph or two to describe them. Its still a step in the right direction but I would have liked expanded tutorials for those platforms too.
The book uses Zerobrane as its IDE of choice, largely because it offers syntax highlighting and debugging for Moai. If, however, you have your own favourite programmers text editor this isn’t a huge problem since, for the most part, there aren’t any Zerobrane-specific steps (creating a project for instance just has you navigating to the relevant directory).
(If, like me, your text editor of choice is Sublime Text 2; check out my detailed setup article).
Something else to be aware of is that the compilation of a Linux host, and its utilisation, is out of scope of this book; so you’ll need to look elsewhere if you’re hoping for answers on Linux distribution.
Conclusion
Documentation on the Moai SDK is limited, and the community around Moai is still small (but growing steadily). As a result, reference material, written in more detail than the basic class documentation, is indispensable.
This makes this book an easy recommendation. If you’re using Moai, and still have questions around the basic concepts, this book is a must buy. Ideally, this short book would be shipped with every download of Moai SDK. You can get a copy of “Developing Mobile Games with Moai SDK” here.