Wednesday 16 May 2007

Creating Games in C++

Yeah.... I just finished my first book in a way long long time. The last book i read was on flash stuff but that was maybe a year back. I decided to read up on C++ stuff because I heading in the direction of console games. So I picked up this book and starting reading. I have some background in C++ from my junior college days but the special thing about this book is that it tries to teach you C++ while you are trying to build a simple game. Its an awesome idea I must say and I do like it as it shows you what you can do while you're learning the programming language. Its not like the normal boring code silly things books.


Category Score
---------------------------
Content: 9/10
Readability: 7/10
Usefulness: 7/10
Code provided: 9/10
Game Engine: 3/10
---------------------------
Average 7/10


First, I want to address the biggest problem with this book. And that is the game engine provided with the CD that comes along with the book. It does not compile out of the CD! and its awful because even with the errata provided on the publishers' site, its not fixed. There's even a forum which is a talking about the problem and though it seems some of them solved it, I still cannot solve it. At least not within an hour. That means that all game code you get in the book won't be able to compile and you may not only get very frustrated but you may feel like giving up (but don't!). The game engine is called llamaworks2D and it is missing a few steps on how to link up with openAL opensource sound library. However, I assume some of the other code which does not make use of the game engine would compile. I must admit I did not try it out because I already have C++ background. These include the chapters on vectors, inheritance, arrays, pointers and file input or output.

The good thing about this book is its content. Not only does it teach you programming in C++, it also teaches you several tips on how to optimize your game code while you code it. For example, it teaches you when to use inline functions, inherited sprites versus contained sprites, when to use you the squared magnitude of a vector versus the actual magnitude of the vector and many more. Optimzation is always a good thing. That's how complex games work. They will never run properly if its not optimized. Furthermore, the book does teach you about game design which is very important in my opinion. Game design gives games life. If you have good graphics, great sound but bad game design, people will play your game but will give up and say it sucks. Although the design stuff in the book is quite brief, he does cover the more important aspects. Another good part of the book is that it gives you several options and references to good tools you can use in games.

When it comes to readability, I only have one test which is whether it makes me sleep. I sleep very easily when I read books and that hinders my progress a lot. For this book, it made me sleep a few times but otherwise its actually very readable. The chapters are well separated and most of it is concise and to the point. However, I notice that there are a few occasions where I am reading something which I know and can get past easily without explanation. I am not very sure whether those sections pose a problem to a reader who is new to programming.

As for usefulness, I find the book very useful even though i have background in C++. I'd recommend it to all new programmers who want to learn C++ as well as build games. I'd also recommend it to game designers. In the book there is a line saying, "it's something of a truism that the more game programmers know about game design, the better they can do their jobs". I feel that the opposite of this is also true. That is, the more game designers know about programming, the better they can do their jobs. It helps because you know what it takes to get the game running but please do not twist my words and say that you need to know programming if you are a designer. Well, I also think that game designers should not always be constrained by programming problems in some cases so that they can be more creative in their designs.

The code provided is good. As said above (under content), there are many tips on optimization and stuff. So that's a good thing but this is undermined by that fact that the game engine does not compile so some code will not be able to work though it is technically correct.

I do think this book is good and it is a real pity that its game engine doesn't run, if not it would have been a highly recommended book. But yes, I did learn alot from the good content provided. I must admit that its is easy to tell that the writer has alot of experience in game programming and he shows it well. Best of luck to all those out there who are going to try it.

No comments:

Get Adsense

Want to earn money like me? Get Google Adsense now by clicking this