ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ GAME PROGRAMMING TUTORIAL REMS (MARTIN RAMPERSAD) ³ ³ TOPIC - Getting Started: THE PLAN 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 ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÀÄÄÄÄÄÄÄÄÄÙ Who the hell am I? What makes me think that I'm wise enough to teach you? Well, nothing really. I just wanted to talk about game programming to increase my own knowledge and possibly help out some others in their own ventures. This document will stress that the pre-coding phase is more important than the coding phase. Mark my words. If you don't like this idea then maybe this isn't the tutorial for you. Well, now that you've settled nicely into my frame of mind, let's begin. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ SO, YOU WANNA MAKE A GAME ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ Ah, the idea. One of the most cherished possesions of a person. Something that only you could think of while you were in the can, or reading a book, or browsing the internet. So you wanna make a space shooter, or a flight sim, or an arcade fighter. The first thing you need to do is plan. PLAN PLAN PLAN PLAN PLAN PLAN PLAN PLAN PLAN PLAN PLAN PLAN PLAN PLAN PLAN Plan? Why should I plan? I want to get on with the engine. I can already see my game in action! All the shinyness and smooth play! How many times have I said that to myself just to end up kicking my own ass the next day for being an idiot. Why? If you had the idea in your head, why couldn't you just go into the progrmming phase as soon as possible? (Dive right in!) NO! That's foolish talk... that's your brain trying to kill you. (No it's not, it's your sense of uhm, logic!) No it's not. It's a fool making a rash decision. Have a fork in the face brain. [Blood, spurt. Face on keyboard. Hours later back from the hospital] After I had a chance to clear my head, I realized that planning my game out was of paramount importance. Without a plan it would fall to pieces just like my school life, or my love life, or my social life. Ahem. All you need to do is think of absolutely everything that is vital to your game. Not very hard... maybe thinking in engines would do the trick, call this your general plan if you like: SAMPLE LIST FOR A GENERAL PLAN (RPG) Basic Requirements Vital Elements ÃÄ Storyline Engine ÃÄ Scrolling Engine ÀÄ Battle Engine Okay. I've created an outline. These pieces are essential to my game. Essential. What do I need? Obviously, I need what I just wrote up there, but more importantly, what do YOU need? You should spend some time writing, or typing, out a small plan for what you will need for your game. Even taking a time out right here wouldn't hurt. Now I need to flesh it out! I can't just work from there, that's not enough information! If I started coding at this point, I would just end up in the hospital again. So, time for a more detailed analysis: SAMPLE LIST FOR A DETAILED PLAN (RPG) Basic Requirements ÃÄ Memory (How much? What type, EMS, XMS, Conventional, Upper?) ÃÄ Data (Maps, items, characters, weapons, enemies, everything!) ÃÄ Graphics (Primitives? 3D? How many colors?) ÃÄ Interface (Windows? Menus? Mouse, KB, Joystick?) ÀÄ Sound (PC Speaker? Sound Blaster? God forbid, Adlib?) Vital Elements ÃÄ Storyline Engine ³ ÃÄ Story (I'll need one to do this part!) ³ ÃÄ Storyline editor (To implement the story.) ³ ÀÄ Story Algorithm (Turn what you've done, into what's happening.) ÃÄ Scrolling Engine ³ ÃÄ Map Editor (To edit maps.) ³ ÃÄ Tile Editor (To edit tiles.) ³ ÀÄ Map Algorithm (To show only the visible parts of the map!) ÀÄ Battle Engine ÃÄ Enemy Editor (Who's making the minions? You!) ÃÄ Spells, and etc. (But you can help the hero somewhat...) ÀÄ Battle Algorithm (Now we rumble!) Shit! There's a lot more to making this game than I thought! I'm glad I didn't dive right in! Now for each of those points, you should make another set of points, until you have the whole game in point form. Then each of the points will be a subroutine. For example, the Scrolling Engine point, could be totally expanded to: SCROLLING ENGINE DETAILED PLAN (RPG) Scrolling Engine ÃÄ Map Editor ³ ÃÄ Open / Load Map ³ ÃÄ Show Map ³ ÃÄ Edit Map ³ ÀÄ Close / Save Map ÃÄ Tile Editor ³ ÃÄ Open / Load Tile ³ ÃÄ Show Tile ³ ÃÄ Edit Tile ³ ÀÄ Close / Save Tile ÀÄ Map Algorithm ÃÄ Display Map ÃÄ Overlay Sprites ÀÄ Overlay Heads Up Display Be wary, "Edit Tile" should be extremely expanded! For example: SCROLLING ENGINE MAP EDITOR EDIT TILE DETAIL VIEW (RPG) Edit Tile ÃÄ Plot a point on the tile ÃÄ Plot a line on the tile ÃÄ Plot a circle on the tile ÃÄ Plot a box on the tile ÃÄ H/V Flip Tile ÃÄ Mirror ÃÄ Rotate ÃÄ Blur ÃÄ Sharpen ÃÄ Contrast ÃÄ Brighten ÀÄ Clear Tile So now go! Go and plan your game thoroughly. I want you to type, or write 100k of plan. Your game will then be a cinch to program! And isn't that why I'm here? Once you're done planning everything, join me in the next tutorial. Final final final note: Don't get discouraged! This is meant to show you that even the simplest game has a lot of work involved in it. If you think that you should stop making your game because it will take a million years to plan, DON'T! The outcome will be much more rewarding when you've finished your project! Also, don't go at a breakneck pace. I do that often and end up burning out. So PLAN PLAN PLAN! ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ NEXT GAME PROGRAMMING TUTORIAL ³ ³ TOPIC - Getting Started: PROGRAM BOTTOM UP ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ