home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 2: Collection B / 17Bit_Collection_B.iso / files / 1438.dms / in.adf / ADVENTURE / adt < prev    next >
Encoding:
Text File  |  1978-02-11  |  25.4 KB  |  556 lines

  1.   ADVENTURE WRITING TUTORIAL  Copyright W.Jordan 1990  All Rights Reserved
  2.  
  3. This article is public domain and may be freely copied and distributed,
  4. provided it is unaltered and if charged for, only a nominal copying fee is
  5. charged.
  6.  
  7. INTRODUCTION
  8. This program is a tutorial in writing adventures games. It is specifically
  9. designed for people with little or no programming experience who would like
  10. to write their own adventure games. Whatever your age, this may be of
  11. assistance in creating your own games, whether they are for your own
  12. amusement, to be played by friends, or to be put on the public domain or
  13. eventually you go commercial!
  14.  
  15. It contains many helpful tips and ideas, and hopefully will generate many
  16. ideas of your own. Hopefully, it will give people inspiration to write
  17. adventure games of their own!
  18.  
  19. Many of the ideas in the article are the result of years of playing
  20. adventure games and writing them!
  21.  
  22. HOW TO USE THIS TUTORIAL
  23. You may be happy just to browse through this. If you feel inclined to put
  24. some time into creating an adventure game, you will get the most from this
  25. tutorial by reading through it on different ocassions. Each time you will
  26. grasp points that were previously obscure to you. You may also gain some
  27. ideas just from reading sections that interest you.
  28.  
  29. GENERAL
  30. This tutorial should be useful to you regardless of what programming
  31. language you use, though my background is in Basic.
  32.  
  33. This tutorial presumes that you are confident in saving and loading a
  34. program. One of the beauties of programming is that you can save a program
  35. and return to it weeks or months later and modify it. As you become
  36. confident and experienced with the computing language you can gradually add
  37. enhancements to all your programs!
  38.  
  39. An excellent way to gain ideas for your adventure games is to purchase and
  40. play games. There are also books available which contain solo games which
  41. play very much like a computer game.
  42.  
  43. You might like to look at some of the public domain adventure games.
  44.  
  45. To exploit the full power of the Amiga your game
  46. might contain IFF graphics, music, sounds(and perhaps voice), animated
  47. bobs and sprites, fancy menus and text presentation and a mouse driven
  48. interface. However, a good game need not contain all of these features.
  49. You need to learn to crawl before you can walk, and the more sophisticated
  50. features can be added later on. To write an adventure game with all the
  51. special effects can take a long time, you can still make a fun game with a
  52. lot less effort, even though it might be just for your friends.
  53.  
  54. During the tutorial some basic commands will be mentioned. For full
  55. information on how to use these commands you will need to read the manual.
  56. There is a lot more to these commands than what will be mentioned here!
  57.  
  58. I suggest to be both patient and persistent when developing a program.
  59. You will be surprised how complicated a simple program can become. You will
  60. probably be best off in the beginning not to be too ambitious.
  61.  
  62. NOTES
  63. Hand written notes may prove to be helpful in writing your stories. Drawing
  64. a map may be particularly helpful. How much preplanning you wish to do is a
  65. matter of style. You may like to plan your adventure very carefully before
  66. you boot up your Amiga. You may prefer a much more ad hoc approach.
  67.  
  68. Some people like to print out a listing of their program, so they examine it
  69. away from the computer.
  70.  
  71. THEMES
  72. The theme for an adventure game is only limited by your imagination. An
  73. obvious theme is a medieval fantasy setting which is used in many D&D type
  74. role playing games. Other themes include a science fiction setting, a
  75. detective story, a spy story or whatever. You may like to use ideas from any
  76. book,movie or TV show that you like.
  77.  
  78. You may like to try your hand at an educational type adventure story where
  79. the hero makes progress depending on his answers to specialised questions.
  80.  
  81. Generally you will just have one main character in your story though you
  82. might like to have a party which includes several non playing characters
  83. which means that the player will control several game characters.
  84.  
  85. Another idea (though more difficult) is to make the game a multi-player
  86. game. These could be within the same pary, or could be racing against each
  87. other.
  88.  
  89. TEXT ADVENTURES
  90. About a decade ago there were very few graphics in text adventure games and
  91. most games consisted just of text. Some readers may be familiar with the old
  92. Scott Adams Adventure series of games. Despite these games being purely text
  93. they could nontheless be quite enjoyable.
  94.  
  95. A text adventure is a game in which little or no graphics appear on the
  96. screen. In its purest form only text appears on the screen. Usually the
  97. user of the progran plays the role of a character in an adventure story.
  98. The text often describes what the character can see and hear and what is
  99. happening at the time. The player will have to make decisions on behalf of
  100. the character. Depending on what decisions are made, the story will branch
  101. in different directions. There may a chance element in the game.
  102.  
  103. The original Scott Adams series allowed a player(the user) to move the story
  104. character by typing in such directional commands as N,S,E,W,UP and DOWN.
  105. Story items could be manipulated by commands such as GET,DROP,USE etc. and
  106. the player could perform other actions such as LOOK,TALK,OPEN etc. which did
  107. not always require an object.
  108.  
  109. Whatever was typed in by the player led to a response by the computer.
  110. Sometimes the player progressed in the adventure, at other times not.
  111. The games contained many puzzles which the player could solve by logical
  112. deduction. As more and more obstacles were overcome the character progressed
  113. further and further into the story.
  114.  
  115. STARTING OUT
  116. I highly recommend starting with something simple. You can always add to
  117. it later on. You will be surprised how complicated even a simple progam
  118. can be.
  119.  
  120. When I first bougt my Amiga I was very keen to write a short program. Even
  121. though I knew very little about computing I wrote an adventure game on the
  122. first day I had my machine fully connected up. What is more the program
  123. was actually completed. But it did actually use only 3 commands!
  124.  
  125. I used PRINT to make text appear on the screen. STOP to make the program
  126. stop after each paragraph of text. After each paragraph of text was
  127. displayed on the screen, the program would stop. The program would continue
  128. when the user typed in a GOTO command in direct mode(this was in AmigaBasic
  129. by the way). Getting the user to use direct mode was not really adequate!
  130.  
  131. It would have been much more sensible to use the INPUT command to ask for
  132. the user(player) to type in information on the keyboard. However, the
  133. manual had a misprint in it and the INPUT command did not make any sense!
  134.  
  135. It is quite possible to make a workable text adventure game with only 3
  136. commands. PRINT,INPUT and ON GOTO. This is how.
  137.  
  138. LABELS AND LINE NUMBERS
  139. Write your adventure story as a number of independent paragraphs. They
  140. will need some kind of identification, so precede each paragraph by a line
  141. number or label. Labels have the advantage that they can help you
  142. recognize what the paragraph is about while you are editing your story.
  143. (Of course, the PLAYER will never see the labels or linenumbers). They have
  144. the disadvantage that they cannot begin with a reserved word.
  145.  
  146. PRINT
  147. Each line of text in a paragraph will need to be preceded by a ?(for
  148. PRINT) followed by a quotation mark. Do not make the paragraph so long
  149. that it will not fit onto a whole screen, otherwise the top of it will
  150. scroll off the top of the screen before you have a chance to read it!
  151.  
  152. The paragraph will probably describe the location of the character, what
  153. the character can see and/or hear and an event that is happening. A
  154. paragraph effectively represents a location in time and space.
  155.  
  156. The end of the paragraph can contain the various options available to the
  157. player. This can be followed by an INPUT statement asking for the players
  158. choice. The ON GOTO statement will decide in which way the story branches
  159. depending on the player's decision.
  160.  
  161. INPUT
  162. The INPUT statement will work if the player enters a number of the correct
  163. value, but may well crash the program if the player enters a value outside
  164. the permitted range. This can be avoided by testing for the value of the
  165. inputed number. If the number is outside the permitted range then the
  166. program will branch back to the point where the input is being asked for
  167. and not reach the ON GOTO statement.
  168.  
  169. The user should be able to type anything or click the mouse anytime and
  170. anywhere without crashing the program. This is all part of making a program
  171. user friendly.
  172.  
  173. ON GOTO
  174. You can branch to any paragraph in your story. You may even branch to a
  175. paragraph that has been used before. It is possible to write an adventure
  176. that only branches forward. Some paragraphs may be used very often, while
  177. others may be used very rarely, and may be difficult parts of the story to
  178. reach.
  179.  
  180. Choices may be more or less random e.g. North,South,East or West or there
  181. may be beter choices. Whether the player chooses the better choices may
  182. depend on any clues they have recieved and the logic of the player. It is  a
  183. good idea to make the logic in your adventure consistent.
  184.  
  185. Some games comsist of a number of logical puzzles which the player has to
  186. overcome.
  187.  
  188. CHANCE
  189. An game can vary from having no element of chance at all to having a great
  190. amount of chance. A game with little chance may require more skill but has
  191. the disadvantage that the game will play the same way each time.
  192. Another disadvantage is that once the game is completed, there will be
  193. little point in playing the game again. With a chance element, the chances
  194. that the game can be played again and again will be increased.
  195.  
  196. You can introduce chance by using the RND command. This will cause the
  197. generation of random numbers. By using RANDOMIZE TIMER you will be able to
  198. create different random numbers each time the program is run. You may use
  199. random numbers to recreate random events, or in combat etc.
  200.  
  201. You can use random numbers to recreate the outcome of a die roll e.g.
  202. r=rnd(6) will mean that r is a number between 1 and 6. r=rnd(6)+rnd(6)+rnd(6)
  203. will give you the total of 3 dice. Note that this is different from
  204. r=rnd(18).
  205.  
  206. There is no reason though, why you should be bound to 6 sided dice. You can
  207. create a random number between any two numbers.
  208.  
  209. You may like to have the random numbers visible in the game, (particuarly
  210. during playtesting) or to have them invisible, but not their effects!
  211.  
  212. WANDERING MONSTERS
  213. Random numbers can be used to determine whether a wandering monster appears,
  214. what kind of creature appears and other factors such as how many appear, what
  215. direction they come from and so forth. You may even have a table of
  216. monsters so that what monster appears depends on the location.
  217. This idea is like role-playing games in which what wandering monster
  218. appears depends on which level of a dungeon you are on.
  219.  
  220. Random numbers can be used anywhere that dice(any number of sides) are used
  221. in a boardgame. They can be also used in combat, when searching for secret
  222. doors or other objects, for saving throws, for random events etc. An example
  223. of the latter is when the character is shipwrecked and lands on an island.
  224. A random number will determine whether the island is a desert island, a
  225. rocky island, Gilligans island or whatever.
  226.  
  227. It is even possible to use random numbers to generate random mazes etc!
  228. If you are really clever you might use random numbers to generate
  229. landscapes, maps etc.
  230.  
  231. PARSER
  232. One style of adventure game does not display the possible choices. What the
  233. character does must be typed in! The program must be able to recognise
  234. simple verbs and nouns etc. that the player might type in. In effect the
  235. player is telling the character what to do and hopefully finding the correct
  236. response without even knowing what the alternatives were.
  237.  
  238. This method has advantages and disadvantages. One advantage is that it makes
  239. for a more difficult and challenging game and gives the player great
  240. freedom of choice.
  241.  
  242. One disadvantage is that it requires more effort to play the game. People do
  243. not like to type too much. There is another disadvantage. The player may
  244. have the right idea, but may not be able to find the right words for it. An
  245. example of this was a game I was playing which contained the picture of a
  246. jug. I typed in "Get Jug" but to no avail. I eventually learned that the
  247. correct response was to type"Get Pitcher", pitcher being the American word
  248. for Jug.
  249.  
  250. With this method it may be helpful to set up defaults, i.e. set responses if
  251. a particular attempted action fails. e.g.s are
  252.  
  253. Player tries to go north.
  254. -You cannot go in this direction.
  255.  
  256. Player tries to get something that cannot be moved.
  257. -You cannot get that item.
  258.  
  259. Player tries to do something that is impossible.
  260. -You cannot "ATTACK" the piano. etc.
  261.  
  262. One way to make the default text responses more interesting is to have
  263. several different responses, one of which is chosen at random.
  264. e.g. In response to a failed `get'
  265. -You cannot get the (object)
  266. -The (object) does not remove
  267. -Did you really think you could take the (object)?
  268. (Where object refers to the object name)
  269.  
  270. Note to use the object name, you can use a string variable to store it in.
  271. e.g. ?"The ";item$;" does not remove".
  272.  
  273. Some parsers in games are very advanced, being able to recognize the basic
  274. structure of a sentence, others like the ones I design are much simpler!
  275.  
  276. ACTION COMBINATION
  277. Another way of recieving user input is to present all possible actions and
  278. all possible objects at each turn.
  279.  
  280. For example, the possible player actions in a game might include some or
  281. all of the following:
  282. Directional actions
  283. N,S,E,W,NW,NE,SW,SE,UP,DOWN
  284.  
  285. Actions not requiring object
  286. LOOK,WAIT
  287.  
  288. Actions requiring object
  289. GET,DROP,USE,OPEN,CLOSE,DRINK,EAT,BUY,SELL,ATTACK
  290.  
  291. These could be displayed continually in one corner of the screen. 
  292. Objects that could be used, could be mentioned in the text, or in a
  293. seperate list.
  294.  
  295. To be really fancy you could have all the game options in boxes which can
  296. be selected by a click with the mouse!
  297.  
  298. If you are using graphics, the object could simply be in the picture and
  299. the player would have to recognize it before a command involving it could
  300. be made.
  301.  
  302. PROCEDURES
  303. You will find it useful to use procedures that can be used again and again
  304. in a program. You can even use the same or modified procedures in different
  305. games.
  306.  
  307. COMBAT
  308. For example, in a role-playing game you may like to have a combat procedure
  309. based on the combat system you wish to use.
  310.  
  311. This will involve some mathematics and probably the use of logical
  312. operators, but this will generally be straight forward. Don't forget to
  313. share the necessary variables or to make them global if need be.
  314.  
  315. Other possible procedures are for saving throws, encountering a trap,
  316. finding an object, casting a spell, using an object etc. etc.
  317.  
  318. You can put almost your entire program in procedures!
  319.  
  320. ITEMS
  321. You can make your game more complicated by containing items which are
  322. present in the game. Some items might be able to be carried by the character
  323. and possibly moved from location to location. Some actions may only be
  324. sucessful if the player is actually carrying a specific item.
  325.  
  326. You may allow the character to carry an unlimited number of items or you may
  327. set an upper limit. Another approach is give each item a different weight so
  328. you may be able to carry a small number of heavy items or a larger number of
  329. lighter items. You could have a procedure to show what the character is
  330. carrying, or your could continually display a list on the screen.
  331.  
  332. The player may be able to perform an action on an item e.g. open book or may
  333. be able to use one item on another item e.g. light candle with matches.
  334.  
  335. ATTRIBUTES
  336. You may like to create a very double-edged story with many sudden death
  337. paragraphs or you might like to create a more subtle adventure. One way to
  338. do this is to introduce player attributes. These may include character
  339. attributes such as strength,stamina etc. or may be used to record things
  340. such as how many gold pieces a player is carrying.
  341.  
  342. For example, you might not kill your character outright, but have him killed
  343. when his life level(or con etc.) reaches 0. This will draw the game out and
  344. not have everything hang on one decision or one bout of bad luck.
  345.  
  346. To stop a variable from going below zero, you can use a comparision e.g.
  347. if str<0 then str=0
  348.  
  349. You will probably want your attributes to be global variables.
  350.  
  351. ARRAYS
  352. Arrays can be very useful in an adventure game for storing related
  353. variables. Multi dimensional arrays could be used to store information on
  354. anything from details of monsters, items,people to the contents of rooms or
  355. locations.
  356. e.g.
  357. item$(100,5)
  358. This array stores up to 100 different items with 5(or 6 if you use the 0
  359. element) characteristics each, or up to 500 different pieces of information.
  360. monster$(x,1) could be the name of the monster.
  361. monster$(x,2) could be the class.
  362. monster$(x,3) could be the life level.
  363. monster$(x,4) could be the strength.
  364. monster$(x,5) could be the magical data.
  365. Information could be numbers of words. Numbers can be stored as strings and
  366. converted to proper numbers with VAL e.g.
  367. x=val(X$)
  368. You could even store several bits of information in the same string and then
  369. break them up!
  370.  
  371. VARIABLES
  372. Variables can be used to contain information about the course of a game.
  373. In its simplest form a variable can be equal to 1 or 0 (true or false).
  374. You may like a character to return to a paragraph location that they have
  375. already been to and want the circumstances to be exactly the same as what
  376. they were the first time the character was there. Or you may wish the
  377. circumstances to be different subsequent times the character reaches that
  378. paragraph.
  379.  
  380. You can use variables in conjuction with END IF blocks to
  381. determine what happens depending on whether the character has beento that
  382. paragraph before or not. For example if the name of a location is tower you
  383. could create a variable called towr(though of course you could use another
  384. name). Initially the value of tower would be set to 0, if the character
  385. entered the tower, tower could then =1.
  386.  
  387. Variables could also be used to store other things such as how many times an
  388. event has happened.
  389.  
  390. END IF BLOCKS
  391.  
  392. WAIT KEY
  393. You may like the user to respond by typing in a single key at the keyboard
  394. i.e. Wait Key. Clear the keyboard buffer before using Wait Key.
  395.  
  396. MOUSE
  397. You may like the user to make a selection from a given number of choices by
  398. using the mouse. The choices may be presented as text in different coloured
  399. boxes, for example.
  400.  
  401. STORING TEXT
  402. THere are different ways in which the text can be stored. Text can be stored
  403. in DATA statements and then read. Another way of storing text is by using
  404. sequential files. At the start of the game the sequential file can be read
  405. and text can be stored in arrays. Text from the arrays can be used as
  406. needed.
  407.  
  408. You can divide the text in your files into paragraphs which are divided by
  409. headings which can be recognied by the Amiga. It can search through the
  410. file till it finds the appropriate heading and then read through and then
  411. stop when it reaches the next heading.
  412.  
  413. One thing I have used for a heading is an uppercase word, being careful not
  414. to have any lines in the file which are fully uppercase.
  415.  
  416. SEQUENTIAL FILES
  417. Sequential(or text) files and be usually in storing lists of related items.
  418. You may have a file to store a list of monsters,objects,people etc. These
  419. files can be read from and stored in arrays. This is less messy than
  420. assigning values directly to arrays, especially with large lists.
  421.  
  422. As well as storing names, you may like to store other attributes. For
  423. example, on the monster file you might like to store the following
  424. characteristics:
  425. monster name, class, hit points, armour class, magical(y/n) etc.
  426. You will probably find it easiest to store all the information relating to
  427. one thing on the same line.
  428.  
  429. Note that the different items in the file are
  430. seperated by commas, so they can be read off the file by INPUT#1.
  431. You will probably want text to be read by LINE INPUT#.
  432. Remember to have the same number of items on each line.
  433. Also note that items having a numerical value can be stored as strings and
  434. then converted with VAL.
  435.  
  436. TURN LOOP
  437. On approach is to have a main do loop in your program, which will continue
  438. until your character has been sucessful in completing the adventure,
  439. completely unsucessful or the player has decided to quit the game.
  440. You can display details such as turn numbers, a player's score(if it exists)
  441. , a character's attributes and an inventory of what the player is carrying.
  442. The latter two things can be either be displayed continously or only
  443. displayed if the player requests it.
  444.  
  445. SAVING THE GAME
  446. You may wish to allow he player to save the game and restart the game at a
  447. later stage in the same situation. One suggestion is to open a short
  448. sequential file containing certain variables and save these variables to
  449. disk. When the player wishes to continue this saved game, you can open the
  450. file and load up the variables. If you read the variables in the same order
  451. that they were saved in it can be easier thabn you think.
  452.  
  453. Variables might include the location of the character, the character's
  454. current and maximum attributes, what the player is carrying and any other
  455. variables that may be important.
  456.  
  457. HI-SCORES
  458. You may wish the player to save a hi-score or some other game statistics.
  459. For this you can write these details to disk in a sequential file.
  460.  
  461. DEBUGGING
  462. All programs have to be debugged. Here are some tips for debugging.
  463. While developing a program you can add some code that will only be present
  464. during development. One idea is to print out the values of different
  465. variables at different points in the program. This will show whether the
  466. right values are being calculated at different points.
  467.  
  468. If you have a bug, try and narrow down the area in which the bug is being
  469. created.
  470.  
  471. Test procedures seperately, then add them together.
  472.  
  473. Test your program, and write notes about things you want to chance. You may
  474. well get ideas for things you did not originally think off!
  475.  
  476. SUPER CHARACTER
  477. To help playtest your adventure you might like to create a super character
  478. that cannot be killed. This will help you to playtest all the different
  479. branches of a game.
  480.  
  481. It would appear that some commercial games have left their "super character"
  482. options in after playtesting. For example, in one game pressing the Alt-X key
  483. will create an invincible character.
  484.  
  485. PLAYABILTY
  486. There are a number of things you can do to improve the playability of a
  487. game. It is generally good to allow the game to flow and not allow the
  488. player to get hopelessly bogged down. A frustrating game become boring.
  489.  
  490. A game needs to be balanced. You want it neither too difficult or too easy.
  491. It may be undesirable to have a character killed off too easily.
  492.  
  493. There is great scope for differences in style in an adventure game. You may
  494. have a bare minimum of text or you may have long descriptive paragraphs. 
  495.  
  496. Your adventure may be a fairly linear one in which the player must do step
  497. a, then step b, then step c etc. or may be a fairly broad adventure in which
  498. the player has some very wide choices at least at some points in the game.
  499. An example of this might be a town setting in which the character can
  500. explore any of a number of buildings. If your adventure is too linear it
  501. runs the risk of becoming frustrating at one point.
  502.  
  503. PLAYER RESPONSE
  504. You may like to allow players to take as long as they like over their moves,
  505. or you may like to use real time. If they have not responsed in a cetain
  506. way, with either the keyboard, the mouse or a joystick then they may suffer
  507. some dire consequences. You may eventually like to have an interactive
  508. sequence, such as a mouse driven swordfight.
  509.  
  510. GAME LOGIC
  511. You may like your game to be entirely brainless or you may require the
  512. player to do some clever deductive thinking. Some situations requiring some
  513. puzzle solving might include carefully hidden objects, information that can
  514. be only obtained from a non player character with careful questions,
  515. seemingly irrelevant information which is actually meaningful, information
  516. which fits together like a jigsaw- it does not make sense until all pieces
  517. are found, riddles, maps and strange symbols in the game.
  518.  
  519. However fantastic your adventure may be, it is a good idea to keep the logic
  520. of your game consistent, otherwise it just becomes guesswork.
  521.  
  522. GRAPHICS
  523. Adding graphics to a program is easy thanks to IFF-load. You can draw a
  524. painting with a program such as Deluxe paint. The drawing will not fill the
  525. entire screen and you will be able to add text at the bottom. Another option
  526. is to place text directly on your picture or to place it in a box. The text
  527. can then be removed without disturbing the graphics underneath.
  528.  
  529. You may have to make some decisions regarding your IFF pictures depending on
  530. how many pictures you want in your program. Pictures in higher resolution
  531. and more bitplanes will occupy more space on disk and consequently you will
  532. be able to have fewer of them. If you wish to have many of them you will
  533. probably have to reduce the above characteristics.
  534.  
  535. There are many options with graphics,including screen scrolling, zooming
  536. part of the screen, clipping, fading etc.
  537.  
  538. SOUNDS AND MUSIC
  539. You will be able to add sound to your games by using sound stored at IFF
  540. files. Sound samples can be found on some PD disks.
  541.  
  542. You can add some simple sounds with commands such as shoot,boom,bell or
  543. create a few simple sounds with the sound commands.
  544.  
  545. ANIMATION
  546. When you become confident with drawing and using bobs and sprites you might
  547. like to put some animation in your adventures. An animation may be purely a
  548. demonstration, or may be an interactive sequence.
  549.  
  550. There are many different things you can do with bobs and sprites.
  551.  
  552. So...
  553.     I hope you have fun with some of these ideas
  554.          and good luck in your game designing!
  555.  
  556.