home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / mnth0103.zip / Timur / vol1n3.txt < prev   
Text File  |  1993-04-13  |  8KB  |  204 lines

  1. In the Beginning...
  2.  
  3.  
  4.  
  5. This article is the first in a long series covering the 
  6. development of a role-playing game (RPG).  I've been 
  7. watching the OS/2 scene for quite a while now, and the most 
  8. sophisticated games I've seen so far are not much better 
  9. than Solitaire.  To remedy this situation, I've taken it 
  10. upon myself to conquer new territory.  The purpose of this 
  11. column is to teach OS/2 PM programming and have fun at the 
  12. same time.
  13.  
  14.  
  15.  
  16. Why OS/2, you ask?  Although a pure DOS game can produce 
  17. faster graphics, the power of the OS/2 API provides a 
  18. foundation upon which a rich and exciting game can be 
  19. created.  Of course, the animation can't be as fast and 
  20. tight as it would be under DOS, especially since OS/2 is 
  21. message-based.  However, we can use a message-based 
  22. architecture to our advantage.  For example, in a combat 
  23. scene with multiple computer=controlled players, each player 
  24. runs as a thread, and all movements and attacks are 
  25. processed by sending a message to the client window, which 
  26. handles all the graphics.  This feature centralizes the 
  27. drawing routines in one function.  The importance of this 
  28. will become apparant once we start building the code to 
  29. process the WM_PAINT message.
  30.  
  31.  
  32.  
  33. As a character in this role-playing game, you are the pilot 
  34. of a large and heavily armored humanoid tank.  The tank can 
  35. be armed with missiles, lasers, and the like, and since it 
  36. is humanoid, it's capable of punching, kicking, and 
  37. sometimes jumping.  Thus, you have a greater variety of 
  38. attacks than in most other role-playing games.  In addition, 
  39. you don't need to remain in your tank to accomplish your 
  40. goal.  There are plenty of encounters possible inside 
  41. buildings and outside on foot. 
  42.  
  43.  
  44.  
  45. The design of a tank must follow certain rules, obviously, 
  46. and there are several standard models you can configure to 
  47. your liking.  The more armor you add, the slower and heavier 
  48. the tank gets, and high-powered weapons cause it to overheat 
  49. more quickly.  When a tank is hit, the computer must 
  50. determine the extent and the severity of the damage.
  51.  
  52.  
  53.  
  54. If you browse through the rule books of some of the larger 
  55. RPG's, you'll probably be overwhelmed by the complexity of 
  56. all the rules.  Your character can't breathe before you role 
  57. a die five times to see how long each breath is.  Okay, a 
  58. minor exaggeration, but you get the point.  Fortunately, 
  59. this is where a computer excels.  The objective of this 
  60. project is to make a role-playing game that's just as much 
  61. as fun as an evening campaign with your friends, is just as 
  62. exciting as any arcade game, but still leaves out all the 
  63. drudgery of determining the outcome of each event.  The 
  64. computer is very capable of handling extremely complex 
  65. attack rules governing how often you can fire, where you 
  66. hit, and what kind of damage you've incurred.
  67.  
  68.  
  69.  
  70. There are two types of "arenas" in this game.  The first is 
  71. an animated representation of combat.  A window displays the 
  72. surrounding territory, and the player can enter his moves 
  73. and see them graphically executed.
  74.  
  75.  
  76.  
  77. The second arena is a role-playing system.  Unlike most 
  78. computer role-playing games, this one will attempt to 
  79. generate some of the universe by itself.  Of course, the 
  80. computer can't think, and it can't create dialogs, but it 
  81. can generate a map.
  82.  
  83.  
  84.  
  85. These two arenas are independent of each other.  If you want 
  86. some quick arcade action, you can choose to play that arena 
  87. alone.  Simply ask the computer to set up a combat scene of 
  88. a given skill level, and fire away.  And when playing a 
  89. campaign, you can have the computer handle the combat and 
  90. tell you who won.  Just make sure there's no way you can 
  91. lose!
  92.  
  93.  
  94.  
  95. Most role-playing objectives can be reduced to one single 
  96. task: to obtain or destroy one or several items.  In order 
  97. to reach this goal, you have to obtain (or destroy) other 
  98. items, or you have to obtain certain information.  The first 
  99. is a physical barrier, and the second is an intellectual 
  100. barrier.
  101.  
  102.  
  103.  
  104. An example of a physical barrier is a secured fortress 
  105. hiding a key.  In order to obtain the key, you must break 
  106. through all of the defenses of the fortress and enter the 
  107. throne-room.  There you can simply retrieve the key from a 
  108. safe and escape to the outside.
  109.  
  110.  
  111.  
  112. An intellectual barrier might be an old hermit living in a 
  113. cave, who knows where the key is.  You have to find the 
  114. hermit, and this might require exploring the mountains long 
  115. enough until you get lucky and find him.  Or perhaps you 
  116. need to talk to the bartender to know where the hermit is.
  117.  
  118.  
  119.  
  120. Each goal can be broken down into a series of physical and 
  121. intellectual barriers.  This game includes a world editor, 
  122. which the game master (GM) can use to create an environment 
  123. for a campaign.  The editor will allow you to create both 
  124. the physical and intellectual barriers.  By designing the 
  125. map, you've essentially created all the physical barriers.  
  126. The intellectual barriers can be programmed by adding a 
  127. simple dialog.  This dialog is not much more than a list of 
  128. responses to certain key words (you may have seen this 
  129. already in a popular commercial product).  For instance, a 
  130. player types in the word "job," and the person to whom he is 
  131. talking tells him what he does for a living.
  132.  
  133.  
  134.  
  135. If this is not sophisticated enough for you, then you can 
  136. play this game on a network, making one of the players the 
  137. GM.  The computer will then prompt the GM for instructions.  
  138. He can either accept what the computer proposes, or he can 
  139. select his own moves or responses.  This allows for more 
  140. meaningful dialogs, but it also forces the GM to type a lot.
  141.  
  142.  
  143.  
  144. Since this is a programming column, I have to discuss 
  145. programming techniques as well.  I will assume that you are 
  146. already familiar with OS/2 PM programming, so I won't bother 
  147. mentioning anything that you can find in the reference 
  148. guides, on-line help, or other documentation that's commonly 
  149. available.  I will limit my discussions to explaining only 
  150. the more interesting topics.  Here's a list of what you'll 
  151. find on these pages:
  152.  
  153.  
  154.  
  155. Animation.  Granted, PM isn't the fastest graphical system 
  156. on the planet, but it is flexible, and it is capable of some 
  157. impressive feats if you know how to use it correctly.  I'll 
  158. describe techniques you can use to obtain the fastest 
  159. animation possible.
  160.  
  161.  
  162.  
  163. Sounds.  The PC speaker has always been a miserable source 
  164. of sound effects.  However, some manufacturers of sound 
  165. cards are busy developing OS/2 drivers, especially for OS/2 
  166. 2.0.  I'll try to get beta versions of these drivers and 
  167. include sound effects that take advantage of the advanced 
  168. hardware.
  169.  
  170.  
  171.  
  172. Networks and Modems.  Two is better than one, and playing a 
  173. game across a network or via a modem should add to the 
  174. excitement.  As I mentioned earlier, one of the network 
  175. nodes can be a GM running the show.  Or you could have 
  176. several players at once, each one seeing the world through 
  177. his own eyes only.
  178.  
  179.  
  180.  
  181. Foreign languages.  Let's not forget our friends overseas, 
  182. who might be eager to play with us.  The difficulty will be 
  183. keeping all text localized, so that there are only a few 
  184. source files that need to be translated.  I can get 
  185. translations into German and French done for free.  Does 
  186. anyone want to volunteer for others?
  187.  
  188.  
  189.  
  190. 32-bit.  The development system I'll be using is IBM's new 
  191. 32-bit OS/2 C compiler and toolkits, which include the 
  192. WorkFrame/2 editing environment.  I will discuss the 
  193. differences from 16-bit programming that these new and 
  194. long-awaited OS/2 2.0 development tools have to offer.  I 
  195. will also try to incorporate as many of the new 2.0 
  196. functions as I can.
  197.  
  198.  
  199.  
  200. You get all this (and source code) for free!  The rules will 
  201. be presented as the project develops.  I'm very interested 
  202. in any comments from my readers.  Although my name appears 
  203. at the top of the page, I really want this to be a team 
  204. effort.