What's Been Happening

A note to beginners

Also a word of advice to those of you who are new to programming but want to write a game. Don't try to write a computer game as your first project. (or even your second or third) Writing first person 3D computer games requires knowledge of a fairly large number of areas which a beginner just does not possess. Not only do you need a thorough understanding of the platform on which you write the game, but you also need to have a good grasp of linear algebra and trigonometry. Not to mention being comfortable with the data structures and the methods to manipulate them.

This is not meant to discourage you. But you can't expect to absorb all of that in a couple of weeks. There are some "rules" that you need to follow if you want to get anywhere with programming, though. I give these not as hard and fast rules but as advice from someone who has been programming computers for 20 years.

  1. Pick a language and stick with it until you KNOW it. Switching from back and forth between two or more languages which you are not completely familiar will only serve to confuse you.
  2. Learn number systems and data storage methods (data structures). These carry over to ANY language and will always be useful.
  3. Form an understanding of the platform you will be writing software on. Both the operating system and the hardware. You can't exploit the platform effectively if you don't understand it and know what it's capable of.
  4. Stay as far away from "non-portable" implementations of anything as you can. Microsoft's 'C' libraries have lot's of functions which are not part of the ANSI 'C' standard. If you use only ANSI 'C' code, your project will be MUCH more portable. Especially if you decide to switch compilers or platforms later.
  5. Assume nothing. Functions give you ways to check the results for a reason. If it's possible for the failure of a function call to cause a problem, then check the result. If it's possible for your input to a function to cause a problem then check it before you call the function. Yes, your code may run a little bit slower but if it doesn't crash often (or at all) your code will be perceived as what it is. Solid. Who cares if someone else's code is faster if it crashes all the time? It will be thought of as the crap that it is.
  6. Program design and flow-charting are important. Especially if your project is complex (which most games are). Not many people can prototype code in their heads. Visualizing a program's operation through a flow-chart is an excellent way to catch design flaws and to design pseudo-code for your program.
  7. Optimization is an art. It takes time to learn how to do it effectively. Optimizing code that your program only spends 1 percent of its time doing is useless. Optimizing code that your program spends 80 percent of its time doing can yield large gains in performance. The key is to identify how much time is consumed by each part of the program. That's what profilers are for. They will tell you which functions take up how much time.
  8. Use alpha and beta testers. You can't really test your program as effectively as someone else can. You know how to run it and you will follow that same path most of the time.

These are only a few of the "rules" that I follow but they are some of the more important ones. I'll post others if I think of any that would be useful or are widely applicable.

If you're a beginner, welcome to the world of programming. And good luck to you. Please regard the above as friendly advice. I tell you about them because they have worked for me. If you don't agree with them, fine. I'm not forcing you to do them.

If you have a computer but can't afford a compiler, try DJGPP. It's a completely free 'C' compiler that works on DOS. It's a port of the gnu 'C' compiler found on Linux. It even has a game support library for it called Allegro. But if simplicity is what you need, then I can only advise you to save your money and buy the "Learning Edition" of Visual C++ which you can get for about $100.

Just remember that programming isn't for everyone. If it seems natural to you, then you will probably be relatively good at it. If it just doesn't seem to make much sense or seems boring, then programming may not be for you. But only you can decide. And you'll never know unless you try. Just remember to keep it simple at first. Even the great wall of China was built one brick at a time...

Contents Copyright © 1999, Bruce A. Lewis
All Rights Reserved.