home *** CD-ROM | disk | FTP | other *** search
/ No Fragments Archive 10: Diskmags / nf_archive_10.iso / MAGS / ST_USER / 1990 / USERNV90.MSA / TEXT_STOS.DOC < prev    next >
Text File  |  1990-05-24  |  11KB  |  247 lines

  1.                            SPRITE PATH DEFINER
  2.  
  3.          This month's STOS feature is devoted to Phil Lawson's
  4.         utility for creating sprite paths to include in your own
  5.                          mega-blasting arcade games.
  6.  
  7. Well, I've promised it for long enough, so now here it is. If you recall the
  8. articles from a couple of months back, you'll remember we discovered how to
  9. control the sprites by using an array, holding the X and Y coordinates of every
  10. position the sprite goes though.
  11.  
  12. The Sprite Path Definer, (SPD), does a similar thing, except the actual
  13. starting position is the only real coordinate present. All the rest are offsets
  14. from the previous position. For example:
  15.  
  16. Start pos = 100,100
  17. If next values are 2 and 4, the actual coordinates will be 102 and 104. If the
  18. next two were 4 and -3, the coordinates would be (102+4,104-3) 106 and 101.
  19.  
  20. The reason for this small alteration in storing the sprite positions is that it
  21. drastically reduces the amount of space needed to save the data on disk. I'm
  22. not going to start explaining the workings of 16-bit arithmetic, so you'll just
  23. have to believe me on this one. Anyway, enough of the waffle, let's get down to
  24. business.
  25.  
  26. The easiest way for you to understand what each option does is for me to
  27. explain them in turn, so here goes.
  28.  
  29.                                 MENU 1
  30.                                 ¯¯¯¯ ¯
  31.  
  32. LOAD - Loads a previously saved set of sprite paths
  33.  
  34. SAVE - Once you've created the sprite paths, it would be a shame if you
  35. were not able to save them.
  36.  
  37. UNUSED - There are two of these, mainly because I designed the screen and then
  38. couldn't think of anything else to include. No doubt you'll have your own ideas
  39. of what these should be used for, so I've left them for you to alter the
  40. program and do with them what you will. (STOS owners only).
  41.  
  42. SET X and SET Y  - Several options require one or two parameters to be set. For
  43. example, if you wished to copy only a section of a path to the end of another
  44. one, you would set the X and Y values to the start and finish number of the
  45. section to copy, and then use the COPY X/Y TO END option.
  46.  
  47. Each of the nine paths has its own unique X and Y values, which are
  48. automatically displayed whenever you select a new path. To increase the number,
  49. position the pointer over the required option and press the right mouse button.
  50. To decrease it press the left button.
  51.  
  52. Notice that under each of the nine paths, selected by clicking in one of the
  53. boxes, is a 3-digit number. This is the number of coordinates that each path
  54. currently contains. This will range from 0, (meaning empty), to 999.
  55.  
  56. When trying to set the X and Y values, the numbers will whizz round pretty
  57. quickly. To allow a bit of "fine-tuning" to select a specific number, press the
  58. S key. To get things going at full speed again press F.
  59.  
  60. RESET - This will reset everything to zero, including speed, x and y values and
  61. the contents of all the paths. Since selecting this by mistake would be very
  62. upsetting, especially after several hours work, both mouse buttons have to be
  63. pressed before the reset is performed.
  64.  
  65. SELECT SPRITE - There's no point in defining paths if you cannot use your own
  66. sprites, therefore this option will allow you to choose one of the sprites
  67. currently stored in the sprite-bank.
  68.  
  69. LOAD SPRITES - Quite obvious really. When the program is fully running, a lot
  70. of memory is taken up. Therefore try and keep the sprite banks to a minimum.
  71. One way of doing this is to create a second file containing only the main
  72. sprites you intend to use in the your game.
  73.  
  74. LOAD BKGND .PI1 - Since most arcade games contain some form of terrain that the
  75. sprites are to pass over, it would be nice to make sure they're going where
  76. they're supposed to. This option will load a standard Degas PI1 picture, and
  77. can then be used to check on the movement of the sprite.
  78.  
  79. LOAD BKGND .MBK - Exactly the same as the above option, except it will load a
  80. screen that has been compacted with the STOS accessory, COMPACT.ACB. If you're
  81. not intending to use the game in STOS, this option can be disabled. See STOS /
  82. OTHER.
  83.  
  84. DELETE ONE PATH  - Does just what it says. The current sprite path will be
  85. deleted. Take care though, once it's gone there's no way of getting it back
  86. again. To change the current path, position the pointer over one of the nine
  87. boxes at the top of the screen and press the left mouse button. The selected
  88. path number will be shown at the far right of the screen.
  89.  
  90. DELETE ALL PATHS - Go on, try and guess what this one does.
  91.  
  92. MENU 2 - Displays the second set of options available.
  93.  
  94. BACKWARDS - If selected, the PLAY commands will result in the sprite going
  95. backwards. Can be used to give the illusion of two paths being defined by one
  96. set of data. Just have one type of sprite going forwards, and another going
  97. backwards. With a little work and thought, this can produce really amazing
  98. effects.
  99.  
  100. FORWARDS - The normal way of moving a sprite. See BACKWARDS
  101.  
  102. STOS / OTHER. Since the main program has been compiled, it follows that anyone
  103. can use it to define their own sprite paths. In this case, they may not have
  104. access to sprite banks and compressed picture screen. By selecting the other
  105. option they can turn off the STOS only options.
  106.  
  107. PLAY - Use this option to check the movement of a sprite along a previously
  108. defined path. Before using, seek the PLAY OPTIONS in menu 2.
  109.  
  110. PLAY & PLOT - Just like PLAY, except each point the sprite passes through is
  111. plotted on the screen.
  112.  
  113. SPEED - To closely check what the sprite is doing, change the value of speed.
  114. As with SET X and SET Y, this is achieved with the left and right mouse
  115. buttons. The speed value can range from 0 (fast) to 100 (zzzzz).
  116.  
  117. QUIT - Back to the desktop. As with RESET, this need both mouse buttons to be
  118. pressed at the same time.
  119.  
  120.                                  MENU 2
  121.                                  ¯¯¯¯ ¯
  122.  
  123. DELETE 1 to X - Deletes the whole of the current path from the first position
  124. to the Xth position. All the ones from X onwards are moved down to fill the
  125. gap.
  126.  
  127. DELETE X to END - Deletes everything from the Xth position to the end of the
  128. current path.
  129.  
  130. KEEP X - Y - Everything apart from the data between X and Y is deleted.
  131.  
  132. PLAY OPTIONS
  133.  
  134. UNTIL MOUSEKEY - Will play the whole path until a mousekey is pressed or the
  135. end of the path is reached.
  136.  
  137. FROM X to Y - Plays between X and Y only.
  138.  
  139. UNTIL X VALUE - Plays from the beginning, (or end if BACKWARDS is selected)
  140. until the X value is reached.
  141.  
  142. With all these play options, once the sprite has finished moving, the current X
  143. and Y coordinates of the sprite are displayed, along with the position number.
  144. By setting the SET X and SET Y values to numbers slightly lower and higher
  145. respectively, you can now examine the area of the path around where the sprite
  146. was stopped.
  147.  
  148.  
  149. BACKGROUND OPTIONS
  150.  
  151. BACKGROUND ON - If a background picture has been loaded, it will be displayed.
  152.  
  153. BACKGROUND OFF - Surprise, surprise. This option will stop any loaded pictures
  154. from being displayed.
  155.  
  156. MENU 1 - Takes you back to the first set of options.
  157.  
  158. COPY OPTIONS
  159.  
  160. 1 to X - Will copy the first X amount of data from the current path to the path
  161. you next click on, which will be totally overwritten by the new data
  162.  
  163. X to Y - Copies the data between X and Y from the current path to the one you
  164. next click. This option will also overwrite the original data held in the
  165. selected path.
  166.  
  167. X/Y to END - Copies the data between X and Y to the end of the next selected
  168. path. This option is best used to produce complicated paths by joining together
  169. many smaller ones.
  170.  
  171.  
  172. Your best chance of becoming famliar with SPD is to actually play around with
  173. it, but some extra information may be of use later on.
  174.  
  175. 1) When saving the path data to a file, the following format is used:
  176.  
  177. The first four bytes are 11, 22, 33 and 44. This is used to identify a sprite
  178. path file when loading it back into SPD. The next byte is how many positions
  179. are defined in this path.
  180.  
  181. The next four bytes are the actual starting position of the sprite, in hi-lo
  182. order. For instance, if these were 01, 04, 00 and 95, the start position can be
  183. found by:
  184.  
  185.        x = (01 * 256) + 04  =  260
  186.        y = (00 * 256) + 95  =   95
  187.  
  188.  
  189. The remainder is taken up with the offset values for each of the sprite
  190. positions defined within this path. Note, if an offset value is greater than
  191. 127, treat it as a negative number. The way to calculate negatives is:
  192.  
  193. if num > 127 then num = 256 - num
  194.  
  195.  
  196. All the above information, apart from the 11,22,33 and 44, is repeated for the
  197. whole nine paths. If any of these is empty, the "how many" value will be zero.
  198.  
  199. To start using the program, first load your sprites. Non-STOS users will have
  200. to make do with the three I've included as part of the program. These are 8 by
  201. 8, 16 by 16 and 32 by 32 pixels respectively.
  202.  
  203. You will now have to select which sprite to use. After choosing the SELECT
  204. SPRITE option, pressing the right mouse button will display the next sprite in
  205. the bank, while pressing the left button will display the previous one. To
  206. select a particualr sprite, make sure it is shown on the screen and press the
  207. return key.
  208.  
  209. To define the path, click once on the DEFINE PATH option and the screen will
  210. clear. If a background picture has been loaded, and not turned off, it will now
  211. be displayed. The mouse pointer now changes into the image of the selected
  212. sprite and can be moved around the screen. To define a point press the left
  213. mouse button. Note, you cannot define another point in the same place as the
  214. last one.
  215.  
  216. The top of the screen will show the current X and Y coordinates of the sprite
  217. along with how many points have been defined. Since trying to define a
  218. previously defined path would result in the original data being lost, you will
  219. have to press both mouse buttons at the same time when selecting the DEFINE
  220. option if the current path already contains data.
  221.  
  222. Since large numbers are treated as being negative, don't try to move the sprite
  223. in large jumps across the screen. Around 10 pixels is most a sprite should move
  224. from one place to another, otherwise it will seem "jerky". When you've finished
  225. defining the path, press the right mouse button.
  226.  
  227. Nine paths may not seem like very many, but few games have more. If you do need
  228. some extra ones though, try creating small ones and joining them together with
  229. the COPY X/Y to END option. It would be a simple matter to separate these when
  230. you load them into the game.
  231.  
  232. ===========================================================================
  233.  
  234. If any STOS users require the original Basic program, to either study or adapt
  235. to their own specific needs, please send a cheque for £2.00 (to cover postage,
  236. packing, cost of blank disc and wear & tear on a worn & torn disc drive), to:
  237.  
  238. PHIL LAWSON
  239. 7, Eaglescliffe Close
  240. New Marske
  241. Redcar
  242. Cleveland
  243. TS11 8BB
  244.  
  245. Please, do not include any other correspondance for the STOS column, since this
  246. must be addressed to the magazine. (We've got to keep those editors busy).
  247.