PDA

View Full Version : Write your own game



Harry Hunt
28-07-2004, 09:57 AM
Howdy again! I'm preparing for an exam right now and since there's just no way I can get myself to study for more than four hours a day I'm using the free time to do computer stuff. Anyway, I came across this old article today (I wrote it three years ago) an decided I might as well share it with you. This article talks about game development in general and not about actual programming but I guess it might still be interesting to some people. Anyway, check it out and take into consideration that this is old stuff :D


Ever since I played my first computer game, I wanted to make one, myself. At that time, I had no idea how to create graphics, how to write game code or how to implement sound but I was aiming high. Later, when I got my first PC, I fell in love with the point-and-click adventure genre and I decided to make one myself. As already mentioned, I had no idea how to do it, but I wanted to learn it all. I had seen my brother program in Pascal before, and the complexity of the source code scared me at that point. The little English I knew at that time was a problem, too, since all bigger programming languages use English commands.
So I decided to start with graphics. I got myself a program called Neo Paint, a very simple paint program, comparable to Paintshop Pro. It supported 256 colors but what was more important, one could create high-resolution images with it. If you have tried to free-hand draw stuff in Microsoft Paint (comes with Windows) before, you know how hard it is to create good looking stuff. At that point, somebody told me that graphics for video games are drawn pixel by pixel which was true at that time. So I got myself a program called Screen Thief, a screen capture tool and took screenshots of my favorite games. Later, I opened them in Neo Paint, zoomed into them and studied them pixel by pixel. It was interesting to see, that computer game graphics actually were a lot simpler than I originally thought. So I tried to imitate the style I had ?¢_olearnt?¢__ from examining screenshots and was quite successful. My first works couldn?¢_Tt compete with LucasArts of course, but they still looked nice. As I learnt more about perspective, I added a pseudo-third dimension to my images which made them look even better. Meanwhile, my father gave me a copy of ?¢_oGFA Basic for Windows?¢__, a very old programming language based on the Atari version, but ported to Windows. It took me quite some time to figure out how to use it, and I spent months playing around until I wrote my first program that actually did something useful, but I was not lacking motivation and so I became better almost every day. I tried to write two games in Basic, an adventure game and a Sokoban clone. Both games never got finished, but they were more or less playable before they got defunct. That was when I knew I had to focus on programming, and so I started learning Pascal, knowing, that Basic was too limited for what I wanted to achieve. I started playing around with Borland Pascal 5.5 for DOS, since we used it in school, too. I learnt the basics from a book and from my computer science teacher, and I soon discovered that Pascal was superior to Basic in almost any aspect. The only problem was, that one could only write DOS programs with it, and graphics were very hard to do. That was when my brother was given Delphi 2 as a birthday present. Delphi allowed him to create impressive programs in almost no time, and so I had to get myself a copy, too. At first, I was a little bit confused since I had never used an object oriented programming language before, but as I got more experienced, I started to love it.
In the meantime, I tried to improve my graphics skills and started to learn 3D Studio MAX and Photoshop. Both of these programs are extremely powerful thus are rather hard to learn. But that?¢_Ts what professional game designers use, so I just had to learn it, no matter how hard it would be. I bought a book on Photoshop and one on 3D Studio MAX to learn the basics. However, it required a whole lot of ?¢_olearning-by-doing?¢__ to become really familiar with the two programs.

Having gained some knowledge about programming and designing games, I started writing more complex games, however, one is likely to overestimate one?¢_Ts skills, and so all of my early games got defunct at a point, where I didn?¢_Tt know how to solve certain problems. The examples of failed projects are countless. I still have more than 200 megabytes of never finished games on my hard disk. However, they didn?¢_Tt leave me with nothing. With every game, I learnt more about programming, designing and above all planning.

Why am I telling you all this? I am telling you this to show you that it is possible to learn, even if you are new to computer programming and graphics, and to show you, that you need time. It?¢_Ts nothing you can learn in a week?¢_¬¶not even in two months.



I didn?¢_Tt know anyone who was actually into game design or programming when I started learning it, that is also why I learnt both. Being new to either of it, you can decide what interests you most and focus on it. If you know other people with similar interests, you might want to concentrate on something, your friends don?¢_Tt know yet.
However, your decision might be influenced by what you already know or simply by your preference.
Making graphics for games requires just as much talent as drawing with a pencil or painting with a brush. You might think that once you know how to use Photoshop or 3D Studio MAX, you will be able to make great images, but there is more to it than this. So if you enjoy drawing or painting, you have a good foundation for your future career as game designer.
As a game programmer, you need a basic knowledge of maths as well as a talent for logic and algorithmic thinking. If you lack any of the two, you will have a hard time learning how to code, since game programming can be really hard at times.


As a game artist, you have to own a handful of obligatory tools. As a 2D or texture artist, Photoshop will be your best friend. If you have been using other image editing tools so far, throw them away. No other tool is as complete and powerful as Photoshop.
If you want to make 3D graphics or rendered 2D graphics, you will need a 3D modelling and rendering software. I recommend 3D Studio MAX, but other programs like Lightwave or Maya can do the job just as good as MAX.
In addition to the software, I highly recommend that you buy a graphic tablet. A graphic tablet is a device that you connect to your computer and which allows you to draw with a pen onto your screen. If you decide to buy one, I advise you to buy a tablet with wireless, battery-less and pressure sensitive stylus. The market is dominated by Wacom products, and for good reason, so if you buy one, make it a Wacom. Using a tablet, you can draw directly into Photoshop. This is useful for texture creation, for drawing cartoons or ?¢_ofine art?¢__ and just about anything you can imagine.

As a programmer, there are a few more alternatives in what software to choose. Professional game programmers normally use Microsoft Visual C++ as programming environment. If you are new to programming, I recommend learning C++, since most DirectX tutorials on the Internet are written in C++. An alternative to Microsoft?¢_Ts compiler would be Borland C++ Builder. While the user interface of Borland?¢_Ts environment is easier to understand in my eyes, the syntax is almost identical?¢_¬¶ so it really is up to you. (EDIT: This is just me trying to be realistic. If you want to get a job as a professional programmer, you will most definitely have to learn C++. Nonetheless, I believe Delphi can kick C++es ass any time)
If you do not want to learn C++, you can go for Borland Delphi. It is based on Object Pascal, an object oriented Pascal language. It?¢_Ts a little easier to learn than C while being largely comparable in functionality.
Still too hard? Then you might want to learn Microsoft Visual Basic. It might be a little less powerful, but it still does the job from all I have heard.


Aiming high is not a bad idea, but here is something you should know: Game development companies normally employ a lot of people. Some a dozen, others even a hundred and more. Big games require a big team. Take that as a rule of thumb. So if you want to write a game alone, keep it simple. You might like RPGs a lot, but be assured that RPGs are among the top five of the most complex game genres, and thus hard to code and design. Same goes for 3D shooters.
The first PC game I finished was a Sokoban clone. While Sokoban looks simple, writing a Sokoban clone is not as easy as it might seem. Still, you would most likely not face real difficulties writing a game like this. Even if you do not like Sokoban, you should now understand the ideal dimension of your first game. Keep it small, and you will most likely finish it ?¢_" make it too big, and you will end up wasting space on your hard disk with a never finished game.


During the last few years, I have learnt one thing: Never start a game without a complete concept of what it will look and behave like when finished. Make a plan for everything and don?¢_Tt add features when already working on the game itself. Your concept should contain a list of all features, all power-ups and their function (if there are any), all weapons, all equipment ?¢_" everything. Decide on how the artificial intelligence of your enemies will work, make concept drawings of your characters, etc. Also make a ?¢_ofake?¢__ screenshot: use Photoshop and create placeholder art, then combine it to a picture that looks similar to what you want the game to look like when finished. If your game is not too complex, also create a list of all resources (images, sound, music, videos, etc.) that will be used in the game. This will allow you to lay-out your program properly.


Start with a few placeholders that equal the final images in size. Don?¢_Tt get too much into detail, though. They can look ugly, since they will not show up in the final game. The placeholders will enable your programmer or yourself (if you are the programmer) to start working on the game.
While the main game engine is being coded, start working on the final game art, according to your concept images. Once they are finished, give them to your programmer (or yourself) and have him/her implement them into the game. It?¢_Ts always a good motivation to see ?¢_oreal?¢__ game art in pre-release versions. Notice that introduction art is something to do at the very end of the development process. Start with the important parts and end with the less important ones.


Object oriented programming is ideal for writing games as they can become very complex and thus hard to understand. I make extensive use of objects when writing games and recommend to do the same. It can really make development a lot easier. Furthermore I found that it?¢_Ts a good idea to keep a game code open, so it?¢_Ts easier to add features if necessary. An object oriented and open coding will also allow you to reuse parts of your code in future projects ?¢_" always keep that in mind when writing games.
If you write compact and complicated code, make sure to use comments. It can be hard to understand your own code, if it?¢_Ts not properly commented.


This article is about programming and designing games, but what about sound and music? Well, I tend to take the sounds for my games from the internet and I assume that everybody can do that. As for music: you can either take royalty free music from the internet, which will be hard to find or ask hobby composers to work for you.
Probably the easiest way of making music is to use Tracker music. However, it still requires a lot of knowledge and talent to create tunes that actually sound well. Since I myself am not familiar with music creation, I leave this topic out this time.


I hope this little article has inspired you in some way. Many people dream of making games, but only very few actually do it. If, as a reaction on this article, only one reader decides to learn how to design and program games, I?¢_Tm perfectly happy. Good luck!