Updated 36 minutes ago

How to code games for the PC and Xbox 360

In Depth: Get on the path to unlimited game programming riches

January 28th 2009 | Tell us what you think [ 11 comments ]

game-coding

Visual C# Express is one part of the Visual Studio suite, the hub for all Microsoft platform development

Don't believe them. Games programmers, that is.

They moan about how hard it is to make games in today's world.

They spout off almost-unimaginable figures of how much games cost to make, blissfully unaware that the figures they bandy about so easily dwarf the GDP of some smaller countries.

And then of course, they complain about how high the piracy rate is, which apparently 'costs the industry more money than Microsoft makes in a year', thus somehow justifying DRM that's more invasive than being strip-searched at Heathrow.

Listen carefully, for we shall say this only once: making games is easy. Really easy. And no, we don't mean using numpty tools clicking on buttons to 'make' simple little 2D games. We mean making full-blown 3D games with physics, networking, sound effects and more. I'm talking vertex shaders, pixel shaders, particle systems, multithreading, peer-to-peer games that work on any modern Windows PC – and can even work on Xbox 360 if you're so inclined.

All these features are possible thanks to a magic piece of software called XNA, which stands – cunningly enough – for XNA's Not Acronymed. XNA is a very thin piece of programming created by Microsoft, and it sits directly on top of DirectX. If you've ever tried to program with DirectX before, you'll know that it's an absolute nightmare… But XNA is different.

If you've never programmed at all before, then XNA will save you years of hard work, because it's designed to make it easy to drop in all the features that people want in modern games.

Yes, it does mean programming things. But on the flip side, that means you have complete creative control over your game – you can make everything from Frogger to Halo 3 if you have the talent around, because everything that DirectX can do, XNA can do, too.

You'll need this

Before you unleash your brain to code the game you've been plotting for years (and don't try to deny it – every real gamer has a dream game idea they've been nursing), you need to install some software. Don't worry, it's free: Microsoft very kindly enables just about all the XNA functionality on Windows for no charge.

If you want to take your game and run it on an Xbox 360, which enables support for playing online using Xbox Live, you need to pay a small annual fee to Microsoft. However, if you pay that fee, you also gain the right to sell your game on the Xbox Live Marketplace; Microsoft acts as your publisher and gives you a 70 per cent cut of all the money your game makes.

Anyway, back to the software: you need to download and install Visual C# 2008 Express Edition then download and install XNA Game Studio 3.0.

That's all the software you need to create your games, but if you want to run them on other computers you need to have those people download and install the XNA 3.0 redistributable – that includes only the bits required to play XNA games, not to make them.

You may also need to install the .NET Framework but a lot of people already have that installed. .NET 3.5 (the latest version) comes with Visual C# 2008, so you don't need it if you've already installed Visual C#.

Hardware requirements

So, that's the software sorted out. In terms of hardware, remember that XNA is built on top of DirectX 9.0c – in order for a PC to play games you make (even simple ones), it must fully support DX9.

It should also support – at the absolute minimum – shader model 2.0, which is any card marketed as supporting DX9. You can get away with cards that support only shader model 1.1, but it will limit you if you want to do more advanced effects.

If you've got high-end hardware capable of DX10 or later, don't get carried away – XNA is designed to be compatible with both Windows and X360, which means the most you should aim for is the Xbox's curious superset of shader model 3.0.

Once you have the right software (that will take a little time) and the right hardware (only antediluvian PCs are ruled out here), you're all set to code.

Wait… How do you code?

We get asked this question a lot: "What's the best way to start programming?" Some people like to buy books. Some people like to get a computer games programming degree. But they are – and we don't want to put too fine a point on this – stupid.

 

Your comments (11) Click to add a new comment

inodeman


August 17th 2010

11. Greetings:

I am selling the source code for my game

http://itunes.apple.com/us/app/missile-o-mine-defender/id338323991?mt=8

price is $500 (non exclusive)

contact me at jimmy@inodesoft.com if interested

Alert a moderator

seanjames


March 5th 2009

10. I don't know why I got censored- I said: "the developer just worked so hard-[on]".

Alert a moderator

seanjames


March 5th 2009

9. I'm just going to say it: this article is terrible. How could you possibly expect people to take this article seriously if you spend the entire first page insulting the people who do take it seriously?

Now, having said that, this article is completely wrong. Making games is NOT easy. Sure, making an asteroid fly around on screen is easy. But that isn't a game. If you presented this 'game' to a professional game developer, or even a skilled hobbyist developer, they would laugh in your face.

Presenting games like Halo as an attainable goal for anyone who is smart enough to install Visual Studio is just rediculous. Halo 3 took hundreds, not one, of developers several years to make. And it wasn't cheap. AAA games like Halo cost millions and millions of dollars to build. Sure, the developers who build them may not realize it, but ask any producer and they'll tell you: building games costs a LOT of money.

Everyone's salary has to be paid, the rent has to be paid, heating, water, and, most notably, electrivity bills, have to be paid. There is software to buy, middleware to license, advertisers to pay. So sure, making your asteroid game costs you nothing, but to make a real GAME that a company like Microsoft would publish, is no where near free.

There's a reason these developers get paid so much. It's because they worked HARD to get where they are. They went to college and got a CS degree, and they spent a lot of their own time to learn new things. Finally, it's because they dedicate YEARS of their life, often working almost 24/7 to finish the product. When they are woking on a game, They don't get to see their family, they risk their health because of the lifestyle, and what do they get for it? They get people like you, who have no idea what their lives are like, insulting them and beliddling their work. They get people who are too lazy to simply purchase a copy of the game these developers have been killing themselves over, day in and day out, for years, and instead they download a copy from the internet, effectively stealing the product that poor developer just worked so *******.

So, no, building games is not easy, in any sense of the word. So how can you even think of publishing this kind of article, going so far as to call the people who are working harder than you could ever think, "Stupid"?

One more thing: XNA is not magic at all. XNA is the result of years of work by some of the most talented programmers in our industry. Calling it magic is just insulting to them, and the people who have worked so hard to get gaming and software to where it is today. What you call programming and game development is nothing compared to the kind of work professional game developers and programmers, and even the XNA team do every day.

Alert a moderator

krandor


February 3rd 2009

8. LOL! I actually enjoyed reading this.

It was humorous even though, yes, it was a bit misleading.

What I took from this was:

1) Programming isn't as hard as you probably think it is.

2) Anyone can learn to program, you just have to do it. Just reading books isn't going to do the job.

3) 10f really means 10.0

4) XNA is magic.

Alert a moderator

jpetrie


February 2nd 2009

7. Without a doubt, this is one of the worst articles I have ever seen published on this subject. Not only is it superficially oriented and misleading, it is remarkably offensive to those of us who are professional developers in the industry. Opening by belittling the craft you purport to teach is a stellar way to illustrate your credentials, really. Advocating the theft of code and the proliferation of ignorance... it just goes downhill from the beginning.

As a professional, I am a strong advocate for "demystifying" the process of game development via community interaction and journalistic endeavors. But for that to actually work, said endeavors need to be grounded in something resembling reality and not consist entirely of ill-considered paragraphs of "information" drafted by somebody who seems to know just enough about the craft to be a danger to him or herself and others -- which is, alas, exactly what this piece seems to be.

I would caution any would-be game developer who stumbled across this article from a Google search or something, looking for knowledge or assistance, to keep looking.

Alert a moderator

resfern


January 29th 2009

6. I have to say that this is one of the most poorly written articles that I have ever read, the first few ill-informed lines you spew was enough to make me want to puke. If you want to advertise XNA, it's best not to **** off the biggest group of people willing to try it out. I've looked at the majority of the games written, eh... sorry, created, using XNA, and they're pure **** mockery of other games. I concur with at least one thing that you claim, making ****** games is easy, but making good ones takes time and effort, and from the way you talk, it's blatant to me that you don't know a decent ounce of programming.

Alert a moderator

nicstt


January 29th 2009

5. Introducing games programming to more people as a hobby, or potential career, was a laudable notion.

This article, however, was both misleading, patronising and insulting.

"Listen carefully, for we shall say this only once: making games is easy."

Making a Space Invaders or Ateroids type clone isn't particularly tough. Making the sort one sees on the shelves of HMV, Virgin or Game is something else.

As a long-time subscriber to Future Publishing magazines (Computer Shopper) I would hope for a more intelligent and balanced article.

I can't help but feel that an article like this could have a detrimental effect on those that do decide to give it a go; when they find that transfering their ideas to the computer screen isn't as straighforward as the article indicated. And definitely not as easy.

Whilst there is plenty of free artwork and models available, using them commercially would lend a person open to lawsuites, not to mention the fact that using disperate sources can easily create a discordant visual effect. Good for seeing how the game is going, but unlikely to be suitable for the final product. Of course, making your own models, artwork and sounds is an option (This too isn't easy unless one has a talent for it - perhaps the author thinks this is also easy?), and even then it takes time.

I also wonder why the website for XNA wasn't mentioned in the article; it is certainly a great source of useful help, advice and tips? Whilst downloading XNA is likely to bring it to the attention of the user, a direct mention would have been sensible.

Alert a moderator

nickgravelyn


January 29th 2009

4. As a Microsoft MVP in the XNA category (and tech editor for an XNA book), I can wholeheartedly say that this is one of the worst articles ever written on the subject. While XNA game studio does try to smooth out the steep learning curve of games programming, it is by no means does it "make it easy to drop in all the features that people want in modern games".

Not getting into the fact that a lot of code you'll find online is not free to just steal and use (a lot of it is licensed and you are bound by those terms if you are using their code), this is a terrible excuse for an introduction into game development. I don't think people need degrees or tons of money to make games, but they do need a level headed idea of what's involved.

Making games isn't easy; it's not excruciatingly hard, either, but it isn't just some drag-and-drop process. Do you think Halo was made by Bungie just stealing code off the internet? Of course not. They have intelligent programmers who know how it all works.

It sounds like this author is someone who wanted to learn programming, got angry when told how hard it was, and decided that pasting together asteroids clones qualifies him to teach programming and bash hard-working programmers. Honestly, I pray this is some sort of subversive joke that I didn't get, because if TechRadar honestly thinks this is a quality introduction to XNA, they need to get some things adjusted.

Alert a moderator

bk6000


January 29th 2009

3. While the concept of this article may have been well-intentioned, it's execution definitely does more harm than good. What's worse is the original publication in PC Format.

Full response:

http://benkane.wordpress.com/2009/01/29/xna-makes-games-programming-easier-not-easy/

Alert a moderator

kraln


January 28th 2009

2. Listen carefully, for we shall say this only once: The author of this mishmash of bad information, bad practices, and downright insulting piece of trash is at best misinformed and at worst needs to find himself another job.

From your "don't read books" to your "this is easy", it's clear to me that you have never spent more than five minutes furtively copy and pasting code from one google search into your IDE. Advise like what this column proscribes yields the infinite piles of schlock on the internet at large.

Programming is /hard/. That's why people go to school for it. Games programming is /harder/, because not only do you have to 'make a game', but you have to coordinate resources: sound, music, textures, models or sprites. A story. And no, you can't just solve your resource problems with google. Someone has to either really like your project, or get paid. Then, add some controls. And at the end of the day, it has to be fun!

Without the books, the best practices of people who have been doing this for years is lost. What happens when you have too many things on the screen to collide against, and your game runs too slow. Well, according to you, that's not a problem, and definitely can't be solved by reading books. How the hell are you supposed to understand abstract data structures, like a quadtree, from a clipboard?

Stick to what you're marginal at, writing, and let the real men (and women) make games.

Alert a moderator

thegilb


January 28th 2009

1. This article is a good idea, though this part made me lol :

"We get asked this question a lot: 'What's the best way to start programming?' Some people like to buy books. Some people like to get a computer games programming degree. But they are – and we don't want to put too fine a point on this – stupid.

You don't read books if you want to learn to ride a bike. You don't need a degree to play GTA4 (although it might take one to get the damn thing working). So if you think programming is different, you're wrong: the best way to learn to code is to just to dive in. Steal code from other people. Copy and paste stuff, then edit it a little to get what you want. Try things out, because if they don't work you've lost nothing."

I love it when writers actually get something like this published ;-)

To be fair right, most people would describe me as kind of brainy. I don't mean that to sound arrogant but the reason I say that is because I've been programming games since I was 13, and now work for one of the top game development studios in Europe making games for all the leading console platforms including PS3, Xbox 360 and Wii.

The reason people don't read books to ride a bike is because even a child can ride a bike. It would probably even be possible to train a monkey to ride a bike and play GTA4, possibly at the same time. However, the difference between those activities and writing computer games, is that one of them requires an advanced knowledge of software engineering, and the others do not. This is why stupid people make games that are - without putting too fine an edge on it - pants, and those that can read without the aid of pretty pictures tend towards learning the necessary knowledge to make games that are not pants; Which inevitably entails going to university, earning a good 2:1 degree (or better), reading lots of books and staying in. A lot.

I don't dispute that you can, technically speaking, cobble a game together in C# using a hodge podge of code snippets borrowed (with permission of couse) from people who know what they're doing. After all, it's fun! I myself started this very same way. However, drawing from that experience, I just think the new generation of game developers should realise that there is more to it, and it is no way shameful to recognise the fact that making games is, in fact, ludicruously difficult! You can go a long way on a small bit of knowledge, so dive in and have fun :)

Alert a moderator

Tell us what you think

You need to Log in or register to post comments

By submitting this form you agree to our Terms of Use and so are legally responsible for anything you submit. DO NOT submit anything which may violate the Terms of Use or another person's rights including copyrighted or offensive materials.