UnrealScript Game Programming Cookbook Review

It’s been a long time since I’ve actually made a post on this blog, and that’s been for very good reason. Frankly, I haven’t had much to talk about for a while. Real life interrupted, things happened, BlastPoints work kicked up, etc.
With BlastPoints now out the door (release is very soon), and prototyping of new projects underway (albeit things I still can’t talk publicly about too much), one of my goals is to start writing a bit more. I guess I have a bit of a varied life, between teaching, game development and possibly a software engineering job, so hopefully things will pop up more often that I can talk about from many perspectives.
The other issue I find with blogging is that often a lot of opinions I have are awfully strong and often contrary to other opinion. Some may view them as criticisms, rightly or wrongly, and often they don’t come across well.

But now onto the real purpose of this blog post. I was approached by Packt Publishing not long ago to review an UnrealScript book they had published. Quick disclaimer: I’m not being paid for this review or anything like that. This is just my honest opinion of the book.

The book is called “UnrealScript Game Programming Cookbook“. It’s important to note that this book doesn’t teach programming and syntax, but rather provides some practical applications of UnrealScript as well as explanations of the structure of things inside the engine – ie the relationship between Cameras, Controllers, and Pawns. I love this method of teaching, as you can learn the language and its constructs in a practical way that you can see results. Epic has provided some great documentation about the technical side of UnrealScript so more applied examples are always good.

The first couple of chapters don’t deal a lot in programming. They prepare the reader for some of the fundamental setup and prerequisite knowledge. Chapter 1 covers setup of a variety of IDEs. I’m glad to see is the suggestion to use Archetypes (covered in Chapter 2), as they’re a bit under-used by a lot of UnrealScript developers in favor of hard-coded data. Offloading changes to a system that doesn’t need to wait for compile and startup times is a great thing to do.

The topics that are covered throughout the book are Camera Systems, Pickups, AI & Navigation, Weapons, HUD, and a couple of miscellaneous recipes. I can’t help but feel a few of these re-tread well documented and sampled areas of UnrealScript already – for instance Camera system samples are already fairly well documented from both a practical and structural point of view on UDN.

The chapter on AI is by far the best and most valuable part of the book. While it probably doesn’t go into as much depth as it should, it’s as good of a starting point as I’ve seen for developing AI code and setting up navmeshes as appropriate. It covers the basics of pathfinding using both pathnodes and Navmeshes, which has been a headache for a lot of people I’ve known in the past. Unfortunately its also one of the areas that can go horribly wrong depending on your context, and very few of those issues are addressed in the book either.

The samples throughout the book are moderately well explained in a code sense and a structural sense. The samples look well constructed, but perhaps could have been more applicable to general development, or perhaps sequenced better to more gradually introduce people into the structure of the engine. Mutators aren’t covered at all, despite being a great introductory point for programmers starting with the engine. Gametypes could probably have been covered in more depth, as well as some more custom behaviour for Pawns and PlayerControllers. In my opinion, that sort of basic game structure are things that are more in demand and valuable for anyone looking to learn UDK.

I have two main criticisms of the book.
The first is simply the formatting and some of the way in which information is presented. There are many errors and typos throughout the book – I came across a variable declaration that looked like “var(Camera) constboolUseThirdPerson;”. While any experienced programmer will figure out exactly what this is meant to look like, it can still be confusing and just serves to confuse readers. Don’t get me wrong, this isn’t the first technical book to have typos and it won’t be the last, but most of those books have been (rightly) criticized for those issues.

Secondly, a lot of pretty important concepts are brushed over, or mentioned in passing and never referenced again (and no references are provided for further reading  Despite its intention being to provide “recipes” to be quickly followed to get a result, theory on how you go about some of these things is important as well. A couple of examples spring to mind here. The use of Sockets is mentioned on one page and a screenshot of a character with sockets is shown. However, there is no further explanation on what Sockets are for, or even a link to documentation on how to access the Socket Editor. The other one relates to sub-objects, which are used all over the engine (and several times in the book) but never explained, at least not that I could see. These are just two of a few examples where a fairly important concept is mentioned but never expanded upon at all.

I’m going to be honest here. I haven’t read any other UnrealScript books, and the times I’ve taught it I’ve written my own subject material. It’s hard to compare the quality of this book to others, because I simply haven’t read them. This book hits some good notes (the general approach, Cameras despite them being a well-trodden area, AI/Navigation) and misses the point in a few areas. The typos and formatting issues are a huge problem, even as far as incorrect characters being used for important concepts (explaining the log macro used ‘ rather than `)
One of the upsides is that the book is available in digital format, which is always a great thing for programmers and programming books. If I had to give it a rating, it would be a generous 6/10.

Leave a Reply