ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ GAME PROGRAMMING TUTORIAL REMS (MARTIN RAMPERSAD) ³ ³ TOPIC - Getting Started: PROGRAM BOTTOM UP 04/05/1999 ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ÚÄÄÄÄÄ¿ ³ FYI ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÀÄÄÄÄÄÙ This is a tutorial that will teach (hopefully) everyone how to program some decent games in QuickBasic. The source code included in these texts are QuickBasic source, and will usually be applicable to QBasic, PDS, and even VBDOS. Not that I know. There may be some "inline" ASM and I will not be discussing assembly programming, I'll just be sure to comment the opcodes so you don't get totally lost. Also, these are informational texts only, what you do with them is your business. I am warning you, the reader that by attempting to implement any of this code or theory in your programs you are accepting full responsibility as per the consequences. I am in no way liable. Besides, I'm providing a service, so what's the beef you've got with me? On a bad day, I may curse and the like, so if you are under 18, big deal, I'm under 18. Also, if you don't like slanderous talk about women... just covering all the bases. ÚÄÄÄÄÄÄÄÄÄ¿ ³ PREFACE ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÀÄÄÄÄÄÄÄÄÄÙ By now you have all planned your little hearts out and are ready to get down to some coding. Well, I hate to spring this on you, but it's not time to code yet. We need to program all the information that is going to be required of us for our game. What required information? What are you talking about Rems? He's off his rocker again. Not quite. Just hear me out. If we are going to program an RPG, we'll need to progam all the items, character profiles, maps, and any other DATA that will be required during the making of our game. So, to program from the bottom up is to program the things that are most depended on first. Think of how easy it will be to program a battle engine when all the graphics, and character and enemy profiles are done? Very. But, we still have to go through the tedious process of getting our data down. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ DATA, DATA ALL AROUND... ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ I use the term DATA all the time. What I mean is the information that is for the most part, constant. And it must be depended on by the various engines of your program. Data doesn't necessarily literally mean DATA statements, but could be a host of other things, files, arrays, images, sounds, you name it. If your program needs it, you have to put it down now. Also, when I speak about data, I mean things that you write down mindlessly. This shouldn't require any thought on your part. You've alredy planned out your whole setup, so you should just have to sit there and type for a few hours. A few hours?! Why I ought'ta! Be patient. The rewards are calling out to you. Some examples. Data... hmm. Character information, for one is a type of data that needs to exist for the battle engine, and shop scenario. What kind of armour does the hero have, what is his name even! Things like this all need to be put in some way that your program will be able to access it when it is ready. Want an example? Sure, why not, I have a day to kill: EXAMPLE OF THE TEDIOUS STUFF YOU'RE GONNA BE DOING ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄ¿ ³ Item Name ³ Cost ³ Size ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄ´ ³ Sword ³ 30.00 ³ 6 ³ ³ Club ³ 20.00 ³ 5 ³ ³ Knife ³ 10.00 ³ 2 ³ ³ Boxing Gloves ³ 5.00 ³ 1 ³ ³ Whip ³ 25.00 ³ 4 ³ ³ Claws ³ 7.50 ³ 2 ³ ³ Gun ³ 90.00 ³ 1 ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÁÄÄÄÄÄÄÙ Once you've typed out all, and I mean ALL -- If you're unsure, you're most likely forgetting something -- of your data, you must begin to draw graphics, and begin to create sounds. Get ALL of this out of the way NOW! What am I supposed to use as a guideline for what data I'll need? The plan fool. It's all there, you should know exactly what will be needed for the completion of this epic space shooter, adventure game etc,. I will not be able to stress how much you have to do this. Because I won't wait for you to. It's up to you. Do this for all of the stuff you think you will need. I suggest you continue reading after you're done. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ GRAPHICS AND SOUND ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ THIS ASSUMES YOU KNOW HOW TO SHOW YOUR GRAPHICS AND PLAY YOUR SOUNDS, DON'T WASTE YOUR TIME IF YOU DON'T KNOW HOW TO SHOW OR PLAY GRAPHICS. BECAUSE IF YOU SIT AT YOUR COMPUTER FOR DAYS MAKING INCREDIBLE IMAGES WORTHY OF THE LOUVRE AND YOU CAN'T SHOW THEM, YOU'LL WANT TO STICK A FORK IN YOUR EYE. NOT TO MENTION MINE. DON'T READ THIS EXPECTING TO LEARN HOW TO SHOW GRAPHICS AND PLAY SOUNDS. AS FAR AS I'M CONCERNED, IF YOU CONTINUE FROM THIS PARAGRAPH AND EXPECT TO LEARN WHAT SCREEN 13 MEANS, YOU'LL BE SORELY DISAPPOINTED! I'LL WRITE A TUTORIAL ON SHOWING GRAPHICS AND PLAYING SOUNDS ANOTHER TIME, SINCE THERE ARE ENOUGH OF THEM OUT THERE. This is one place where I abandon the notion of DOS. DOS is honestly the worst place to edit images. Windows 95, 98, NT, Macintosh, whatever, just not DOS. Get yourself an image editor, and a sound editor (and possibly a midi composer) and sit yourself down for a few more hours (days?) of point and click phun. Draw every frame of graphics you will ever need, from title screens, to enemies, to fonts. This is one time where you will get VERY pissed off. Believe me. You need to sit and work at it. Otherwise your game will have second rate graphics and shitbox sound. Sit up straight when I'm talking to you. Finish your graphics, sound and music now. I'll be right here. That's IT! You've now completely planned your game out, and made all the data that it will eventually require! You're halfway (literally) there! Keep going! Until next time... ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ NEXT GAME PROGRAMMING TUTORIAL ³ ³ TOPIC - Getting Started: LET'S GET GOING ALREADY ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ