Celebrating 10 Years with Beginning Game Programming, 4th Edition!

Goodreads Book Giveaway

Beginning Game Programming by Jon Harbour

Beginning Game Programming

by Jon Harbour

Giveaway ends August 08, 2014.

See the giveaway details
at Goodreads.


The fourth edition of Beginning Game Programming has been released to celebrate it’s 10th anniversary! First published in 2004, this book has been a mainstay for aspiring DirectX programmers and teachers around the world.

This new edition updates the source code to Visual Studio 2013 without losing the reader with advanced techniques in the latest versions of DirectX (version 12 recently announced). Instead, this book sticks to the basics like it always has, covering the mainstay of PC development with strict and reliable lessons in DirectX 9.0c.

The beginning reader who is likely new to the C++ language as well as to game programming, will find the advanced topics in the latest versions of DirectX completely indecipherable. For this reason, Beginning Game Programming keeps it simple and understandable, maintaining the high quality of previous editions while updating support for Microsoft’s latest development environment.

“You have to start somewhere”, but that somewhere doesn’t have to be hard! Teachers will appreciate the consistency of this new edition as well as improvements to the sample projects. Coming up from the 3rd edition, the chapters remain in the same order, but the source code for every project has been updated and verified with several rounds of heavy technical review.

The most notable improvement in this edition is the readability! All of the figures have been enlarged to clearly illustrate the tutorials on using Visual Studio, especially when creating and configuring C++ projects–which can be very difficult to the uninitiated.

The chapters on 3D rendering have also been greatly improved with more concise explanations and simpler examples showing how to render a stock mesh and loaded model with a simple pixel/vertex shader. Advanced, complex treatment of shaders is strictly avoided in this Beginning title, with suggestions for further reading provided instead.

So, you’re an aspiring game programmer or designer, perhaps with no prior experience with DirectX, perhaps not with C++ either. Where do you begin? RIGHT HERE!

Get your copy on Amazon! 


Beginning Game Programming, 4th Edition

Working At Peak Torque


Are you bored at work? Not feeling challenged? Feeling in a rut? That is like an engine going 10 mph in overdrive–it has no power because it’s in the wrong gear. Maybe you’re in the wrong gear as far as your life goes. Not feeling challenged? Or feeling over-worked? It may be you aren’t working at your PEAK TORQUE!

Peak torque is the sweet spot for a high-performance engine, the RPM level at which the engine produces the most power. Racers build their engines so that they remain at peak torque as much as possible on the track. For a road racing event such as Grand Am, cars are built to run on tracks like Laguna Seca with a minimal amount of shifting while remaining at peak torque. This is usually in 3rd or 4th gear for a typical 5-speed racecar, where the driver will downshift to 3rd around tight corners and back up to 4th quickly, then occasionally hit 5th on a straightway.

If a racecar is not being driven at peak torque, it has no chance of winning a race–in fact, it won’t even pass the qualifying round. Torque is not the same thing as horsepower, which most enthusiasts incorrectly focus on. Torque is more important than horsepower in a racecar–horsepower is a result of torque. Think of horsepower as the ability to do a certain amount of work. Torque gets the object moving, and power keeps it moving.

If you are dragging each day in your work, it is most likely a torque problem (all other things being equal, such as your health, allergies, etc). Are you getting up in the morning and shifting too quickly into high gear before you’re up to speed? That may be due to your planned (or begrudged) tasks for the day. You know what you have to do for the day and you’re thinking of the entire race instead of just the current corner.

Take a pit stop and evaluate your energy level–your RPM–throughout the day. When you feel that you have high energy, that’s a sign of peak torque. You might be hitting peak torque regularly without trying just as a result of shifting up and down your energy levels (your transmission). Stop looking at the entire track for the day and instead focus on where you are right now and what you need to do to accomplish the current task to the best of your ability, giving no regard to turn 7 on the final stretch of the track. Try to hit the turn in front of you as fast as possible without spinning out or losing momentum, to hit the turn’s sweet spot so you can launch out onto the next straightaway and the next turn.

There are two types of jobs I want to address here with regard to peak torque efficiency. First is the type of job where you are bored silly and are not being challenged. The second type of job is where you are worked hard physically but the work is not mentally draining.

Let’s consider the first type of job, where you aren’t challenged. You are going around the track in 1st gear at about 20 mph. You feel like a lumbering tow truck rather than a high-performance, highly tuned, high-maintenance racer. You can’t wait for 5:00 each day because the job bores you to tears. In this type of situation, one good course of action would be to work toward a new career, but that isn’t what I’m talking about here–okay, a new job just isn’t in the cards right now. What can you do to increase your RPM and reach peak torque? You do have the potential to go 100 mph but your job only calls for 20 mph and it’s frustrating! In either work situation, depending on your personality type, a challenging hobby or a side job may be the answer for you!

If that makes you groan, then you may be surprised by what you’re capable of in your “extra curricular” time. If you get used to 20 mph, then going faster requires some effort that you aren’t used to. This is a deception! You can easily hit 100 mph but have gotten so used to being stuck at 20, your body and mind may not believe you can go any faster. But you can! Consider a hobby that also brings in money, such as making something with your own two hands and selling your handcrafted items on ebay. Do you like to write? Consider writing, but without concern for being published; just do it for the sake of doing it, and after you’re done, then look at options, while continuing to write.

The process of writing or doing some other rewarding activity is what benefits you, not what happens to your poem, short story, novel, or memoir afterward. Doing the work of writing will give your mind something to do during the day beyond the boring job, and you will eagerly anticipate 5:00 PM not just because you’re bored at work–so you can go home and crash on the couch to watch TV–but so you can go home and fire up the computer and get back to your story! Or painting. Or screenplay. Or song.

Video Game Programming for Kids


Introduce pre-teens and young learners to the exciting world of game programming! This concise, dynamic book is designed specifically for 8-12 years olds and uses simple language; a step-by-step approach; and no-cost QB64 easy, but powerful, software to teach short graphics programs and games.

This book is ideal for true beginners or young users who have no prior experience with programming tools. The author uses a humorous, captivating approach with brief chapters that each focus on a single programming or basic computer science concept. All programs and readings center around fun activities, such as cracking a safe, guessing the secret number, or finding the treasure.

This book shows how to make simple games with the easy to use BASIC language! Fun projects introduce early concepts in computer programming. Recommended for ages 8 and above.

Portfolio Page


Learn Python Game Programming


What better way is there to learn a programming language than with a game-oriented approach? If you ask the many readers that have made this book’s prequel, PYTHON PROGRAMMING FOR THE ABSOLUTE BEGINNER, a bestseller, they’ll tell you – there isn’t one. MORE PYTHON PROGRAMMING FOR THE ABSOLUTE BEGINNER offers readers more practice, more exercises, and slightly more advanced instruction in Python programming, all while using the game-focused examples and projects that have proven to be both effective and fun.

It picks up where its prequel leaves off, addressing data structures, file handling, exceptions, object oriented programming, GUI programming, multimedia programming, name spaces, and program planning. Following a deliberate, logical progression of topics that cover increasingly complex subject matter, this is a powerful resource that will arm readers with an in-depth knowledge of the Python language.

This book was marketed as a follow-up to the previous Python book, but in reality it covers a whole new library–PYGAME–which was not in the previous book by another author. This is an excellent resource if you’re new to Python and want to get familiar with the language while making small, simple games in the process.

Portfolio Page


Teach Yourself Windows Phone Game Programming

Windows Phone


Now, there’s a practical, hands-on guide to mastering game development for Windows Phone 7 with Visual C# 2010 and XNA Game Studio 4.0. One step at a time, this book teaches all facets of mobile game development, from design through publishing via Microsoft’s Marketplace. Top game development author Jonathan S. Harbour starts with the absolute basics, making Windows Phone game development accessible even to programmers who’ve never written a game before.

Then, one step at a time, he shows how to use Microsoft’s free XNA toolset to design and construct high-performance, highly-playable games for the newest Windows Phone 7 devices. Friendly, accessible, and conversational, this book delivers a practical grounding in Windows Phone 7 game development without ever becoming overwhelming or intimidating. Each lesson builds on everything that’s come before, helping readers learn core techniques from the ground up. Readers learn key concepts, syntax, and techniques through short, practical examples that reflect the realities of modern mobile game development.

If you are using a Windows Phone 8 device, the code will still compile for it with XNA 4.0.

Portfolio Page


Man of Steel 2 (aka Batman vs Superman)

I am a big fan of comic books but have been out of touch with the goings-on in the comic industry for the last 4 years, having bought only a few graphic novels and focusing on films. Recently, I got back into comics again, subscribing to my favorites (via local store Kenmore Komics) and getting up to speed on what has happened to my favorite characters during my hiatus from reading for so long.

The last few years have been dominated by Marvel in a big way with the extremely popular Iron Man films starring Gwyneth Paltrow and Robert Downey, Jr., not to mention the awesome Jeff Bridges (whose presence had a lot to do with the huge success of the first film, and mediocre reception of the second). Following Iron Man, we were treated to The Incredible Hulk, Thor, Captain America, and the astounding Joss Whedon film, The Avengers, which brought them all together. As much fun as this has been, I have to admit that I need a break from Marvel–maybe I’m going through Marvel overload. So, I’ve returned to reading DC and Marvel again.

Of course, I was already used to DC Comics and Marvel rebooting their series from time to time. This happened in 2008 with DC’s “52″ event and Marvel’s “Secret Invasion” event (a cross-issue storyline that affects all of the characters by a particular publisher). So, I was not surprised to find Avengers #1 and Iron Man #1 again as the latest issues. What did surprise me, though, was the huge changes made by DC Comics to their universe!

All of the DC characters have been rebooted as of late 2011 with the “New 52” event. Every character has a new origin story set a mere 5 years in the past, and all comic series now follow a synchronous issue number (1, 2, 3, 4, etc), with all of them presently at #15. I can understand the benefit of doing this to attract new readers. Let’s face it, unless you’re a long-time subscriber or serious collector, you probably aren’t going to be able to keep track of how the various comics relate to each other, with some original series (namely, Action Comics and Detective Comics) retaining their original sequence since the 1930s (up in the 800s). I’ve always thought comic publishers should adopt a series or season number and sequentially number the issues 1 to 12, like any other magazine. Rebooting seems to attract attention, though, appealing to the amateur collector any time there’s another #1.

The scope of effect for this New 52 reboot is comprehensive across the DC universe, affecting every comic. In fact, DC officially cancelled every comic issue being published at the time and launched 52 new issues (which began in September, 2011). Here are just a few:

  • Action Comics
  • Detective Comics
  • Superman
  • Justice League
  • Wonder Woman
  • The Flash
  • Batman
  • Nightwing
  • Batman & Robin
  • Catwoman
  • Green Lantern

As primarily a Batman fan, I am buying the half dozen or so Batman titles and a few Avenger titles from Marvel. And in fairness to Dark Horse, which has been ignored in this piece, I do read any new Aliens and Star Wars titles they release.

It surprises me how many fans have strong opinions about the new Batmans vs Superman movie, which will also feature Wonder Woman and Cyborg, considering many opinionated souls have never actually read the comics. I may be way off base here–I doubt it, but still–but the most highly agitated fans seem to be the watchers rather than the readers, who tend to be a bit more sophisticated. I guess we’ll just wait and see what Snyder comes up with.


Visual C# Game Programming for Teens


Learn how to create your own role-playing game (RPG) with VISUAL C# GAME PROGRAMMING FOR TEENS! A true beginner’s guide, the book covers each essential step for creating your own complete RPG using Windows Forms and GDI+, including a tiled scroller, game editors, and scripting.

While some experience with Visual C# is helpful, this book is an introductory guide for readers who are new to programming or new to programming for games and want to learn the basics of RPG game mechanics (based loosely on the D&D rules).

You will learn by studying the short examples in each chapter, building the complete RPG called Dungeon Crawler as you move from one chapter to the next, with new features and game play elements added in each new chapter.

Along the way you’ll discover how to load and draw bitmaps, create sprites, render a game world, keep track of inventory and character stats, and build tools including a level editor, character editor, item editor, and monster editor. And the finished Dungeon Crawler game includes all the source code and tools you’ll need to make your own awesome RPGs with loads of cool features and functionality.

Portfolio Page


Revisiting Why XNA Is Not Totally Abandonware

This book had a promising future until Microsoft left XNA developers out in the cold. Here was the blurb:

Discover how to create exciting and challenging games for the Xbox 360 using XNA Game Studio 4.0 and the Visual C# programming language. XNA Game Studio 4.0 for Xbox 360 Developers provides experienced game developers with a comprehensive overview of the XNA Framework, providing all the tools, source code, and information you need to develop Windows and Xbox 360 games.

You’ll find an introduction to programming in XNA, the XNA Framework, and all the new features included in XNA 4.0 to get you started. The bulk of the book focuses on the XNA Framework, in particular the features of the Xbox 360, including the controller, playing audio, and creating graphics.

The final part of the book covers the major features of Xbox Live, including creating and rendering an avatar, 3D programming, loading and rendering a mesh using a basic shader, and networking via system link and online.You’ll tie together all the skills you’ve learned in a final game project that demonstrates the networking capabilities of XNA and acts as a rudimentary, sprite-based networked game engine for your own projects.

It’s still a good reference for anyone working with XNA for the Xbox 360 or Windows Phone, and is still being used in academia. Personally, I was never much of a fan of XNA. It didn’t feel right to me from the start, and I expressed that opinion frequently over the years. If I were inclined to make an indie game for Xbox or Windows Phone today, I would refer to this book again, because it’s the only book on the market that covers networking with Xboxes and Windows PCs (any mix thereof).

Abandonware or Deadware–no, it’s not a term used to describe funeral attire; think of it as a synonym for abandonware. Microsoft has put XNA down by not releasing any new updates beyond XNA 4, which had support for Xbox 360, Windows 7, and Windows Phone devices (having dropped support for the defunct Zune product line). Microsoft has not made any announcements about any new releases are in the works, and in fact, the XNA team has been disbanded, according to rumors.

Microsoft’s XNA Developer Center is still online, the forums are still active, but there’s no support for Windows 8, including Microsoft’s new tablet. What gives, Microsoft?!

This is obviously pretty bad news for anyone involved in writing XNA books! I’ve gotten two to market in as many years: XNA Game Studio 4.0 for Xbox 360 Developers and Teach Yourself Windows Phone Game Programming.

I wrote a piece back in December of 2010 (XNA Is Not Academic) as a play on words and a wink at the upcoming MonoGame (an open source alternative for XNA developers). In this piece, I argue that XNA is not even remotely easy or even suitable for beginners, and that academics were making a mistake in using it for their entry-level courses. I argued that XNA is a complex cross-platform SDK that Microsoft (and skilled developers) have falsely marketed to the beginner and academic market.

Xbox 360 game development is too appealing to students, and too hot for academics to ignore, despite the problems (and warnings) about it. Microsoft did pretty much exactly what I was expecting as the natural marketable lifetime of the Xbox 360 came to an end. Although, granted, in 2010 I had expected the “Xbox Next” to be announced sooner.

The sad truth is, there will be no more iterations of XNA Game Studio, which is quite an upset for anyone in academia who has invested in it. That sort of decision might have been important, strategically, for Microsoft, but it does not do anything to help public opinion of a company known to ignore its customers. I guess we’ll just have to wait and see if the Xbox Live Indie Arcade will be resurrected with new tools or abandoned.



Multi-Threaded Game Engine Design


Multi-Threaded Game Engine Design shows experienced game developers how to apply threading techniques to game programming technology to improve game performance. Using Direct3D and C++, a sample game engine is created step-by-step through the book featuring numerous examples to illustrate the concepts.

Detailed screenshots and well documented source code help readers understand the techniques being presented. Multi-threading is one of the hottest game development topics today and this book will show students how to apply advanced, cutting edge techniques to their game programming skill set.

This book has been misunderstood due to an unfortunate title. It is not an advanced book on threading existing engines, it’s an introduction to threading using several thread libraries, and it builds a competent DirectX shader engine in the process.

Compiler support: The code in this book was developed using Visual C++ 2008 and DirectX SDK (2010). Later versions of both will still work, but earlier versions may not.

Portfolio Page