Archive for the ‘Reviews’ Category

3D Graphics with XNA Game Studio 4.0 – Review

Monday, February 14th, 2011

I recently got a copy of the  new 3D Graphics with XNA Game Studio 4.0, which (complexity wise at least) is a good follow up book for the previous XNA GDBE I just finished going through. This new book skips entirely over the 2D aspects of XNA game development and dives straight in to getting some pretty 3D graphics on the screen. My personal preference (as I noted in my review of XNA GDBE) is towards the 3D side of graphics and game development, so I felt a lot more at home in the code and content of this book.

Sean James doesn’t fool around with a lot of fluff and fillers in the book, which I see as both an asset and a liability. It is an asset for anyone who is highly familiar with the topics in the book but hasn’t personally implemented many of them. In this case the book can be used as a great reference for code (which is most of the content of the book after all) and not have to worry about the explanations of the code blocks. This specific use is actually mentioned in the book itself as one of the uses. There are a few comments sprinkled around the C# and the HLSL code to help you along if you need it, but not so much to get in the way of quickly skimming and finding what you are looking for.

I consider this same aspect a liability depending on the person who is actually reading the book. For someone who has not done a lot of HLSL or other shader development, the amount of HLSL code with very little explanation can seem daunting, but could of course also be a great challenge for anyone who really likes to learn and grow in their abilities and is perfectly fine with having to work for their knowledge (which is much more the kind of learner that I am.) I don’t say this as a criticism of the book or its writing style, as many of the code blocks in my own tutorials are put together in the same way (although I do try to make things as easy to understand as I can). I mostly am mentioning this to let people know that if they aren’t comfortable having to think a little bit about the code they are looking at, they might want to look for their code samples elsewhere.

One of the best things about this book that I have personally had a hard time finding anywhere else is actually the great amount of HLSL code for the various different types of effects presented in the book. Deferred lighting (called prelighting in the book), skinned animations, diffuse and specular lighting, materials and shadowing are all very advanced and difficult to learn effects in shaders and all of them are presented in this book in one easy to use format. Many of these topics are ones that I have been considering implementing in my own engine for a long time, but haven’t really found any concise examples of how others have implemented similar features in their own games, and haven’t found the time to just dive in and figure the whole thing out from scratch myself.

The one problem I had with the book is the lack of color visuals that I feel the topics in this book really require to get across the level of understanding of what visually is really happening in the code. One place where this becomes incredibly obvious is in one of the images that is explained as having been generated by adding eight colored point lights to a scene with a teapot, where the image itself simply looks like a single spot light shining down from above. Using a colored image to show the color blending of the lights and the point light effect instead of the plain gray spot type output that the image looks like it is showing would greatly enhance the effect that having images at all adds to the content of the chapters. Many of the Game Development Gems books get around this issue by just including large number of high resolution glossy color print pages in the middle of the book that can be turned to whenever any other chapter needs to reference a graphic or visual help to really get their concepts across. I really feel like this is probably the only thing missing from this book.

In the end, 3D Graphics with XNA Game Studio 4.0 is a great intermediate to advanced XNA book and an especially good reference for anyone looking to start learning or to learn more HLSL shading and advanced rendering techniques. As I mentioned before, finding this much good shader code across so many varied topics in one place has been almost impossible for me in the past, and I am incredibly happy that someone has finally put something out there to help other like me be able to find and learn these topics better without scouring the internet for days at a time.

Overall I am incredibly impressed with the content and the code in this book and can’t wait to find a good way to implement similar effects into the HMEngine in hopefully a way that is easy enough for everyone to understand. Hopefully I can just find the time to get some of it done!

Book Link:

Sample Chapter:

XNA 4.0 GDBE – Chapter 4/5 Review

Saturday, January 22nd, 2011

Continuing on with the quality from previous chapters that I have now come to expect , Kurt dives right in to getting his impressive graphics straight to the screen. He starts in straight away with many of the utility classes needed to put together a standard top down space shooter and gets the basics of the game up and running in no time.

Some small code things I would have done differently:

  1. Many of the properties in the classes could have been automatic { get; set; } which can make the code look much cleaner (personal opinion)
  2. The padding parts of the asteroid collision detection system is unneeded. I actually removed it altogether in the final code and the game worked just as well
  3. The StarField, AsteroidManager, ShotManager, and many other Manager classes are very similar. I would consider seeing if they can be combined into a more generic class or set of classes.
  4. GraphicsDevice.ScissorRectangle could be used in many places instead of a hand built rectangle with the client bounds’ width and height
  5. Collision detection for asteroids is discussed and implemented in Chapter 4. All other collisions are in Chapter 5. These should be done together with a single CollisionManager

Some things I especially enjoyed in these chapters was the inclusion of sound and special effects. Both the particle explosions and the shooting and fire sounds are highly reminiscent of a simpler time in video games when kids still lived and died by their quarters. The final game is once again incredibly impressive for a beginner’s XNA book and I would have been ecstatic back in 2002 when I first started playing with Managed DirectX if I could have shown my friends the kinds of games that have come out of this book so far.

Book Link:

XNA 4.0 GDBE – Chapter 2/3 Review

Wednesday, December 8th, 2010

Chapter 2 of Game Development by Example goes into making a small but very impressive tile flipping puzzle game with chapter 3 adding the polish and finishing touches to the completed game. The project hits on sprites and spritesheets; it puts a little design work into place that separates the game into more classes than the one bloated Game.cs class many small games like this use; finally, it gets the game all the way to a final playable point in a fun show your friends state. I am incredibly impressed with the complexity and quality of the game that comes out of chapters 2 and 3 with only a few small notes about things I would have done differently:

  1. Separate more of the functionality from the Game class into its own classes or into existing but better suited ones
    • Drawing the game board should be part of the existing GameBoard class, not the Game class
    • Each Draw of the pieces should also be in the class for that piece. This one is REALLY obvious as the method names even have the name of each piece class in them.
    • Font and text related rendering could easily be separated for easier understanding of the whole code base
    • Flood related functionality is borderline hitting enough code to be separated out. Not needed as bad as the above parts though
  2. An enumerated type and a bool would be more suitable to the choosing of game pieces from the spritesheet (instead of the list of constant strings with a “W” at the end when filled in with water)
  3. Queues in the UpdatePieceTypePieces methods add unneeded complexity to the picture. The same functionality can be accomplished with a simple List<string>.

As I mentioned above, the overall outcome of the project in chapters 2 and 3 is leagues ahead of what you would normally see coming out of the early chapters (or in some cases any chapters) of many other XNA books out there. Hopefully the high quality output continues in future chapters.

Book Link:

XNA 4.0 GDBE – Chapter 1 Review

Friday, November 5th, 2010

So far the book is turning out to be a pretty good read. I was excited to see how quickly the author jumped into coding and getting to work on putting together a simple game. I am a big believer in learning by doing so this super quick introduction is exactly what I think the beginner type of books like this need to have.

The method of presenting the code seems to be pretty similar to the way I write my tutorials, with a small code block followed by a short description of what just happened in the code. I am nowhere near as consistent in the pattern but the basic style is similar enough to make me feel really comfortable reading through it.

My only let down so far is that the book states very early on that it is specifically geared towards development of 2D games in XNA, which really isn’t anything against the actual book as most beginners to game development need to start in 2D to get a grasp on the basic concepts; my gripe is really just a personal dislike of 2D graphics development and the SpriteBatch class,  but I’ll put that aside for the remainder of the book.

Altogether it actually took less time to get the chapter 1 project from start to finish than it did to just install the XNA Framework. Pretty impressive for a fully functional game even if it is a simple computerized whack a mole. The challenges proposed at the end of the chapter are at a perfect level of complexity for anyone just coming into game development.

Chapter 2 review soon to come.

Book Link:

XNA 4.0 Game Development By Example

Sunday, October 31st, 2010

Just grabbed a copy of a new XNA 4.0 book by Kurt Jaegers over at that was recently released through Packt Publishing and am going to take a stab at going through it over the next week or so and see what I think. Other than updating the tutorials here to the 4.0 framework I haven’t taken a real hard look at anything new and shiny in the latest version so this should be a good primer for me going forward with any future tutorials.

This will also be my first electronic book on anything graphics programming related so I’ll have to see how things go from that perspective. I have been reading everything novel wise 0n my nook for about a year now and loving it for that so hopefully the good experience extends into this type of reading as well.

Check back soon for a full review of the book and the ebook process!

Book Link:

Do NOT follow this link or you will be banned from the site!