Up until now, there has been only one book on the market for LibGDX and it’s a bit long in the tooth at this point. Now there is a new book in town, the Libgdx Cross-Platform Game Development Cookbook and I just finished reading through it. Let me start by saying, this book wasn’t at all what I was expecting… (how’s that for a hook?).
This book was written by Alberto Cejas Sanchez and David Saltares Marquez, who is the man behind the Ashley ECS component included in LibGDX. So you can safely the authors know their stuff. Additionally, one of the editors was Joost van Ham ( also known as Xoppa ), this is the guy that wrote the 3D portions of LibGDX. So we can say right up front this is a technically competent and accurate book. Full disclosure, I got a review copy of the book, not that this has any influence. On a somewhat related note, this book is not yet available on Safari Books online.
If you’ve never read a Packt cookbook series book, the basic premise is it’s a collection of “recipes”, which can be thought of as task oriented code samples coupled with a description. With a traditional cookbook, say you wanted to cook a Quiche Lorraine ( for whatever aberrant reason! ) you’d flip open the cookbook to the quiche section and follow the recipe. These cookbooks work very similar, except instead of retched pies it’s got recipes for things like creating a 2D depth of field shader or generating and rendering bitmap fonts.
Over time, I have read a number of those Packt cookbooks, I’ve even written one and let me tell you right up front, the quality varies massively from book to book. One of the big flaws with many of these books is the author’s grasp of English, whether it’s that English is their second language, or they simply aren’t great writers. Fortunately, this is not the case with this book. The language is clear, the grammar is solid and there were very few errors that I spotted. Most importantly, language was never a barrier to my understanding what the author was trying to say. Nothing is more frustrating when trying to learn something than being tripped up by the authors inability to articulate, so this is a big point in the books favour.
Let’s take a quick look at the book’s Table of Contents:
- Chapter 1: Diving into Libgdx
- Chapter 2: Working with 2D Graphics
- Chapter 3: Advanced 2D Graphics
- Chapter 4: Detecting User Input
- Chapter 5: Audio and File I/O
- Chapter 6: Font Rendering
- Chapter 7: Asset Management
- Chapter 8: User Interfaces with Scene2D
- Chapter 9: The 2D Maps API
- Chapter 10: Rigid Body Physics with Box2D
- Chapter 11: Third Party Libraries and Extras
- Chapter 12: Performance and Optimization
- Chapter 13: Giving Back
The book weights in at 487 pages. I suppose I should clarify, the Chapter 9 title is very confusing. It covers 2D TileMaps, creating them in Tiled and loading them into LibGDX. Remember back at the very beginning where I said “this book wasn’t at all what I was expecting”?, well… here’s why…
Looking at that list of topics and you probably come to the same conclusion as me, that this book is going to guide the reader through the process of learning Libgdx in escalating difficulty, frankly much like my own tutorial series does. You would be wrong though. To understand why, you need to look into one of these chapters to see what typical recipes look like. Let’s take Chapter 9 as an example, the chapter on tilemaps, and not just because it’s one of the shortest… 😉
On a chapter on tilemaps, what do you except to see covered? Creating and loading certainly, but what else? Maybe something on layers, possibly something on mixing sprites with tilemaps maybe? Nope, what you get is:
- Introduction (an overview)
- Creating maps with Tiled and loading them into Libgdx
- Adding and querying map metadata
- Developing your own map loaders and renderers
It’s that last one that defines this book, in my opinion. I would have never expected to see that topic covered in this book, and I find it shockingly awesome that it is there. It’s this level of technical detail that really makes this book.
So often these books are written to target beginners, and that makes sense, as they are generally the biggest audience for a book. In all honesty, and this may sound more conceited then I intend it to be, but I was expecting to personally get nothing out of this book. I know LibGDX pretty well myself and as an example when I read Learning Libgdx Game Development I don’t believe I learned anything new nor was it ever a source I went back to when I was encountering difficulty. This of course isn’t a bash on that book, I’m just not the intended audience.
This book however, as an experienced LibGDX developer, represents a new and very useful tool in my toolbox. It’s technical enough, applied enough and deep enough to be genuinely useful to developers writing real world code.
This however is a double edged sword. If you are completely new with LibGDX, this may not be the book for you. You have to absorbed a LOT of information all at once and this isn’t really a book that is set up to teach you from scratch. For example, instead of teaching the user how to draw a sprite, then rotate and scale it, then deal with it in a resolution independent manner, the first drawing example does it all at once. Incredibly useful information to an experienced developer… confusing as hell to a beginner.
The breadth of content is pretty solid. If you are creating a 2D game, chances are what you need to know is covered in here. There are a few odd decisions (IMHO), such as covering Git usage ( entire books are written on this subject already ), but not covering 3D at all, even though the guy that created the 3D api’s is one of your technical editors! 🙂 I know what writing to a page budget feels like, so deciding what to include and what not to include is an excruciating process.
Summary
So then, what’s my over all conclusion on the Libgdx Cross-Platform Game Development Cookbook? Well, I don’t give a numeric rating or star score when I review things, but I can summarize it pretty easily with this title.
If you are an experienced developer working with LibGDX, buy this book, it will most certainly be of use to you. I know my own copy will be dog eared from use! ( well… if digitial copies could get dog eared that is ).
If you are a beginner looking to learn LibGDX, this book will certainly be of use to you, especially as you get more comfortable. That said, I wouldn’t recommend starting here, this is not a beginners book… fortunately, I know a good set of tutorials to get you up and running!
So yeah, TL;DR…
Buy this book.
General Programming