Tales of the Rampant Coyote
Adventures in Indie Gaming!


(  RSS Feed! | Games! | Forums! )

Wednesday, May 23, 2007
 
What Is the Best Language To Use To Start Writing Games?
This question came from Roberto, who gave me permission to share it. He asked me what language he should use to start learning to program games. You had to start with a tough one, didn't you, Roberto?

The short answer is, "Write a game in whatever language will let you get the job done."

The longer answer just nitpicks at the short one.

How I Started
I started writing games in BASIC. Not some fancy version of BASIC, either, but really ugly, minimalist implementation that wasn't ANSII compliant. I learned, at least partly, by typing in code from magazines and books like Creative Computing's BASIC COMPUTER GAMES. While its not really practiced today (why type it in when you can download it or cut & paste?), that process was an invaluable learning tool for me. Not only did I learn the language this way, but I also got a feel for how other programmers used the language to approach and solve problems. How they used the data to represent the world and player actions.

I actually continued this practice when I went to college. I took a data structures course, and we had weekly assignments that included implementing these basic data types covered in the class (stacks, queues, etc.) For implementing a stack (in PASCAL), I actually wrote the Towers of Hanoi puzzle, with the ring sizes For a binary search three, I wrote the game of "Animal," where the computer had to guess what animal you were thinking of (and, when it failed to guess properly, it would ask you to fill in the blanks with the new animal, and a qustion that would distinguish it from the others.

Times and technology have changed a lot since then. My BASIC and PASCAL skills are languishing (I've used VisualBasic professionally, but its resemblance to the BASIC I used back in the early 80's is vague at best). But the core skills and way of thinking about solving problems that I learned back then are still being used every single day. So my choice of language back in the day was largely irrelevant. The most important thing was that I did it.

How does this apply to you? You'll need to determine your requirements based on the following criteria:

#1 - AUDIENCE NEEDS
What language / engine / system will be most accessible to your intended audience and platform? If you are only writing a game for yourself, it doesn't matter... but if you are writing games for others to enjoy, you will need to make it as easy and as convenient as possible for them.

Making your audience download additional virtual machine or framework in order to run your game can be a problem. This includes using the latest & greatest version of DirectX, OpenGL, the .NET framework, JVM, and so forth. You'll want to go with whatever users are likely to already have. Flash is a great option because even though it does require a (small) additional download, most users already have it installed on their machines.

Download size is also an issue, of course, though this is not directly related to your choice of language. Smaller is usually better, but it tends to break down into thresholds that are hotly debated amongst game developers. It used to be that anything over 7 megs was the kiss of death, but times have changed.

So - best case... make it something your users are unlikely to have to (manually) download and install at ALL (in theory), like a web-based game. Next best case: An entirely self-contained executable. Next best case: An executable (or web-based game) that requires a very common external dependency - like an older version of DirectX or OpenGL (which is unfortunately not as common as I wish it would be...)

#2 - YOUR NEEDS
What language are you most familiar with? What is your own easiest / cheapest solution?

If you know how to program in VisualBasic because of your day job, why not write a game in VisualBasic (unless you feel it's trumped by your answer to question #1 above)? If you have no money to even buy a compiler or engine, you'd better start with a free / open source option, like Java, Python, or Microsoft's freebie version of VS 2005.

Go with what you know. If you don't know anything yet, then you'll need to do more research and find out what strikes your fancy. Look at what games are being made using the various languages and see if they match what you have in mind for your own game. The list of 2D and 3D game development tools is constantly evolving (there's one on DevMaster here for 3D engines, if you are interested), which might also dictate your language of choice.

What language (or engine) has the best community support if you get stuck? There are many, many books (and websites, and forum posts, and magazine articles...) about game programming in C++. If you choose a more obscure language, it might be harder finding help or answers to questions.

Then there's also your own plans / desires. Are you really wanting to create a game engine, or a game? (My advice, starting out, is a GAME). Are you pushing for a career in web development and web-based games? If you are looking at hardcore game development, that world still runs in C++ (and probably will for the forseeable future). Java - as much as I want to cheer it on - has started losing what headway it once had. And while C# is an attractive option, what with Microsoft's XNA initiative and everything, it's got the whole "Microsoft Exclusive!" thing it is riding on.

#3 - THE GAME'S NEEDS
What are the needs of your game? If you are planning a SNES-style JRPG, then why not start with something that's already got part of the work done for you, like RPG Maker? (which uses RUBY to extend its functionality)? Are you planning a 3D game project for your first game (if so, may whatever gods you worship have mercy on your soul...)?

Look at what is available and what best matches the needs of the game.

And If You Still Don't Know...
So if you still have no idea where to begin, here are some ideas. I'd recommend starting with a 2D game, and using some kind of mid- or high-level engine or graphics library to get you started. Pick a language that works best for the three criteria I mentioned above, and just get cracking.

I'm partial to Python + PyGame, mainly because I am a Python convert. It's a pretty easy language to pick up and use, it's free, and its multiplatform. The biggest problem is that compiling to a native executable (and not requiring your audience to download and install Python) is sort of problematic, and I'm not sure what options are available outside of Windows.

Torque Game Builder is another option I'd heartily recommend. It's got its quirks and issues, but the tutorials that come with it are almost worth the price of admission on their own. And many games are being made right now in it.

I haven't messed with Blitz3D or BlitzMax, but both have been used to make commercial games in the past, and they have solid community support with people who swear by them.

Good ol' C++ and SDL is a great "workhorse" option. Not the easiest to learn, but so much of the world (outside of web development) still runs in C / C++, so learning the language won't do you any harm. There are also TONS of game engines and libraries (some free, some cheap, some not-so-cheap) that are C++ based besides SDL. SDL is nice because it's free and used in a lot of 2D games.

Some great, top-selling games have been made with GameMaker and RPGMaker (Cute Knight and Aveyond, to name my favorites), so don't ignore these options. I know some game development schools / courses have students start out with GameMaker, so it is useful both as a general learning tool and an engine to create commercial-quality products.

In the end, it still boils down to just picking a likely tool and then running with it and finishing a game. Even a simple Space Invaders clone that won't be played by anyone outside of your immediate circle of friends will be an invaluable learning experience. Like the ads say, "Just Do It."

(Vaguely) related stupidity:
* Programming Tip: Comment First
* My Worst Bug Ever!
* Torque 2D Game Builder Quick Review
* A Day in the Life of a Game Programmer


Read or Post Comments on the Forums

Labels:



Did you enjoy this post? Feel free to share it: del.icio.us | Digg it | Furl | reddit | Yahoo MyWeb



Links to this post:

Create a Link



<< Home

Powered by Blogger