Zingtech
Wireless Home Networking Game Programming

Ethernet Networking

 


zingtech.com
Web

 

 

 

 

Guide to the New Game Programmer

Summary

The information contained here will try to assist people that are totally new or just beginning programming. I will explain how to get started, and what to do to continue programming and learning. I will offer suggestions based on my own experiences.

Start Here

If you are reading this, you probably already have some interest in programming. Maybe you don't know exactly how to start? Or are wondering what to do next? Well this guide will try to guide you through the steps to begin programming. Learning how to program is not as hard as most people think, but it does require one thing: a desire. You need to be the one that wants to program. If you are not at all interested, or if someone else is encouraging you to, I would not recommend learning. Without a personal desire to learn computer programming, you will most likely fail. Any small roadblock will get you frustrated and make you want to quit. However, with patience and desire, any roadblock can be overcome. You can do anything if you put your mind to it.

Ok, enough for the psychological introduction (probably scared most of the people away). Where to start? As with most things, there are various levels of difficulty in the path you choose to take. The path that I will describe here begins with C/C++, touches on win32 API, and finishes on game programming. You would think each step would seem to get harder, but if you have completed the previous step, there shouldn't be much change in difficulty. This is because you live and learn by the mistakes you make.

If you are interested in game programming, you need to learn at least C first. C++ is not necessary for game development, but is highly recommended. C++ gives you OOP (object oriented programming) which can be very helpful for game development, especially in Role Playing Games. MFC (Microsoft Foundation Class) builds on C++ and gives you lots of "classes" to accelerate building applications. MFC is recommended for developing tools for your game, but not for the game itself because it is too slow. However, there is lots of debate whether or not MFC should be used for game programming, so you will have to decide for yourself. I personally do not use MFC, for I see no need in it.


Target Platform

Before you start to program, you need to decide what platform you want to write your applications for. A platform is the operating system the application will run on. There are quite a few different platforms, each having specific characteristics:

Windows (win3.1, win95, win98, winNT)

The most popular platform for applications and games. Almost all commercial games are developed for this platform in today's marketplace. The reason for this is that Windows makes it extremely easy for the end-users to use and run the software. Developers, on the other hand, have to put up with a little more, because Windows is more complicated than other platforms to program. However, Windows does have some nice features. There are many Windows users, and thus, many people will be able to run your software. Windows also provides access to the hardware without having to write your own drivers (unlike DOS). It is also easy for "normal" users to install and setup your application after you distribute it. With some of the programming libraries available today, developers do not need to

Historically speaking, the transition from DOS programming to Windows gained momentum when Microsoft created the "programming library" called DirectX. DirectX is a API (Application Programming Interface) that allows fast and easy access to the hardware. By creating DirectX, Microsoft gave developers a reason to switch to Windows: games were easy to install and run by end-users, and programmers were able to write fast games that rivaled DOS's performance.

Read the Zingtech DirectX overview here.

Linux

Linux is quite new to the game development market, but that does not mean it is not feasible. Games can easily be written for Linux using one of the available game development libraries available. My favorite is Allegro, which allows a game to be run on both Linux and Windows, along with a number of other platforms. The Linux user base is currently relatively small, but it is exploding in size, so make sure you consider it for any serious game development.

DOS

Today, DOS is basically extinct. DOS used to be used for game development, but not anymore. However, DOS programming is some of the simplest to learn, and DOS gives you direct access to the hardware. Because of the direct hardware access, programmers can tweak their programs to get the most out of the computer's hardware. This means that games are very fast. However, there are some negative aspects of programming for DOS. One is that you have to write drivers for the different hardware your program uses. This shouldn't be too troublesome; just get a library like Allegro and you don't need to worry about the nuts-and-bolts of how it works. The second negative aspect is that Microsoft no longer supports DOS, and the end user base is constantly shrinking.

I personally don't recommend you do any serious development targeted at DOS. DOS is a thing of the past. I would recommend you get a win32 compiler and DirectX if you really want to get into serious game development. However, with the new game development libraries, programming for Windows is almost as easy as programming for DOS.

 

Miscellaneous

There are always other platforms to target, but these happen to be the most popular, especially for game development. Apple Macintosh and others have a very small user base, thus making anything developed for these platforms almost useless.

C

To learn C, I obtained the book New C Primer Plus: Second Edition, by Waite & Prata, published by The Waite Group. I bought it at ReadMe.Doc. This online bookstore sells computer books at a discounted price. It may not look as fancy as others like Amazon, but this is the place to go to save a buck. This book taught me everything I needed to know about C. During this book, I used DJGPP(download here) to try out all the new concepts that were being taught to me. This is a totally free compiler that creates fast and small code. Shortly after, I discovered the Allegro Game Programming Library that goes along with DJGPP. Allegro uses C and this allowed me to make my first game, a simple space shooter game. That got boring after awhile, so I thought it was time to move on.

C++

I bought Microsoft Visual C++ 5.0. The price for an academic version of MSVC++ 5 Professional Edition is $100; Learning Edition is $50. The Learning Edition does not have an optimizing compiler or profiler, so I do not recommend the Learning Edition for any serious developer, especially game developers (additional differences are listed here). The academic versions of Microsoft products usually can not be sold to high school students, but the Microsoft Academic Store makes an exception. The normal price is huge, Professional Edition is $500; Learning Edition is $100, so try to get the academic version if you qualify for it. To learn about my new compiler, I got the book Beginning Visual C++ 5, by Ivor Horton, published by Wrox. This book taught me three concepts: Visual C++ 5.0 itself, the C++ language, and MFC. The first half of the book was a fast-paced tutorial about C++ in general. It didn't use very many MSVC++ specific programming concepts. However, scattered throughout the tutorial were tips on how to use MSVC++ more efficiently. Then, in the second half of the book, was an introductory tutorial about MFC. It didn't get into the specifics because there wasn't enough time or space. Entire books have been written about MFC, but this book just summed up the essentials into 500 pages. This creates a good foundation for future MFC reading. Game developers do not need to worry about learning MFC because it is rarely used in game development.

MFC

I learned MFC with C++ in the previous section. With regards to game development, there is much debate whether or not MFC should be used. In my opinion, it would be preferable to avoid MFC, due to the fact that reliance on MFC will make an application harder to port to other operating systems. I recommend skipping MFC and moving directly to win32 or game development.

win32

I bought the book Programming Windows 95, by Charles Petzold, published by the Microsoft Press. I have read the entire book, and it has helped me extensively. Many times in game development, a program will need to interface with Windows, so it's good idea to have at least a little background knowledge to aid you. At the same time I learned DirectX, much to the thanks of Windows Game Programming for Dummies, by Andre LaMothe. This book provided numerous examples and was very easy to follow.

Game Programming

Game programming is listed last in the list for few reasons. Game programming requires that you know a lot about the language you are programming with. The reason for this is that games must be optimized for speed and if you don't know the fastest way to complete a task in your language, your game will be rather slow. However, everyone must start somewhere. So, pick a language you are fairly good at and use that language to write a game. A game can be written in entirely C, so you might not even have to learn C++ or win32. But as I have said before, C++ and win32 will most likely help you later on.

For more information about game programming, check out the other pages in my Game Development section!

<< Back to Game Development

Questions? Comments? Share your thoughts on the Discussion Forums...


Google
 
Web zingtech.com
Unless otherwise noted, all contents are copyright © 1997 through 2007 Zingtech Computer Solutions and Michael Matczynski (). All rights reserved. If you have any questions or comments regarding this site, contact the webmaster or consult the legal disclaimer.

Check out wineries at Catch Wine.com:
Alabama Wineries - Alaska Wineries - Arizona Wineries - Arkansas Wineries - California Wineries - Colorado Wineries - Connecticut Wineries - Delaware Wineries - Florida Wineries - Georgia Wineries - Hawaii Wineries - Idaho Wineries - Illinois Wineries - Indiana Wineries - Iowa Wineries - Kansas Wineries - Kentucky Wineries - Louisiana Wineries - Maine Wineries - Maryland Wineries - Massachusetts Wineries - Michigan Wineries - Minnesota Wineries - Mississippi Wineries - Missouri Wineries - Montana Wineries - Nebraska Wineries - Nevada Wineries - New Hampshire Wineries - New Jersey Wineries - New Mexico Wineries - New York Wineries - North Carolina Wineries - North Dakota Wineries - Ohio Wineries - Oklahoma Wineries - Oregon Wineries - Pennsylvania Wineries - Rhode Island Wineries - South Carolina Wineries - South Dakota Wineries - Tennessee Wineries - Texas Wineries - Utah Wineries - Vermont Wineries - Virginia Wineries - Washington Wineries - West Virginia Wineries - Wisconsin Wineries - Wyoming Wineries