home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / ibm / pc / soundcar / 5770 < prev    next >
Encoding:
Internet Message Format  |  1992-12-26  |  14.8 KB

  1. Path: sparky!uunet!munnari.oz.au!nutmeg!nunn
  2. Newsgroups: comp.sys.ibm.pc.soundcard
  3. Subject: THE README FILE (FRING11.lZH)
  4. Message-ID: <1992Dec23.112503.4453@darwin.ntu.edu.au>
  5. From: nunn@it.ntu.edu.au (JsNO  BAR---NUNN)
  6. Date: 23 Dec 92 11:25:01 +0900
  7. Reply-To: nunn@it.ntu.edu.au
  8. References: <1992Dec23.112043.4452@darwin.ntu.edu.au>
  9. Distribution: world
  10. Organization: Information Technology, Northern Territory University
  11. Nntp-Posting-Host: nutmeg.ntu.edu.au
  12. Lines: 449
  13.  
  14.  
  15.                         READ.ME FILE
  16.            FRINDGUS (An incomplete game) (14/11/92)
  17.            ----------------------------------------
  18.              By Jason Nunn (JsNO BAR----NUNN)
  19.                  nunn@pandanus.cs.ntu.edu.au
  20.  
  21.     (Note: This is a quick "slap-up" documentation, I'll do
  22.            a better job later.....but for now)
  23.  
  24.  
  25.                         A VGA GAME
  26.                         ----------
  27.  
  28.  Hello,
  29.  
  30.  
  31. I started this game "FringDus" a couple of months ago. Due
  32. to the fact that I've completed my degree (hence unemployed),
  33. I have to find a job. I'm also nackered after my computing
  34. project which clocked up 25000 lines of Pascal code in 10
  35. weeks and MONTANUS is still isn't finished!.
  36.  
  37.   Basically I'm getting too old for this sort of stuff,
  38. and now giving it to someone else; the idea's and concepts
  39. to write a game. Another reason why I'm "throwing it in",
  40. is because I have absolutely NO artistic talent what's
  41. so ever!. When it comes to programming, I'm good, but when it
  42. comes to designing graphics- I'm absolutely shithouse.
  43.  
  44. All code is totally freeware. YOU CAN DIRECTLY USE THIS CODE
  45. IN GAMES ETC.
  46.  
  47.  
  48.                           LEGALS
  49.                           ------
  50.  
  51.  - I do not take any responibility of any hardware/software
  52. loss or any other loss that is the direct/indirect consequence
  53. of seeing/using this code/executables.
  54.  
  55. (To my knowledge, this code is completely safe. The only
  56. reason I'm giving this warning it because everybody else
  57. does!.)
  58.  
  59. - You may freely use is code. You may use it directly in your
  60. source, even if you make Millions of Dollars on a game you made
  61. using this code. It only took me a night to write the basic code
  62. so it's no skin off my nose (I took me alot longer to design the
  63. graphics though!).
  64.  
  65.  
  66.                         DISTRIBUTION
  67.                         ------------
  68.  
  69. This distribution comes with:
  70.  
  71.    fringdus.pas   <game source>
  72.    pic_make.pas   <sprite maker source>
  73.    map_mak2.pas   <map maker source for editing the FRING1.MAP file>
  74.    pack.pas       <transforms *.PIC (sprite graphics) to
  75.                    the FRINGPC1.PIC file>
  76.  
  77.    fringdus.exe   <the excutables>
  78.    pic_make.exe
  79.    mak_mak2.exe
  80.    pack.exe
  81.    pack.ini       <the pic list that pack reads to dtermine which
  82.                    pic files to append to "fringpc1.pic">
  83.  
  84.    flr1.pic thru to-
  85.    flr32.pic      <the individual sprites>
  86.  
  87.    b_scr.bmp      <The base screen file (in windows format)>
  88.  
  89.    bs.bat         <Boot scrap compiling sequence, with the relevent
  90.                    flags etc>
  91.  
  92.  
  93.               Very Techical Notes & Discussion Notes
  94.               --------------------------------------
  95.  
  96. FRINGDUS.PAS:
  97. -------------
  98.  
  99. Have you ever heard of Paradroid?. It was a game I used
  100. to play on a friends C-64 a long time ago (1987). I reckon
  101. it was the best game ever written. Fringdus has the same
  102. scrolling effect of the graphics as Paradroid. It looks really
  103. good!, I'm really impressed with what I have done. As you operate
  104. the key-pad keys, it looks like the "ground floor" is moving
  105. under you. It looks very smooth, but still needs some
  106. modifications so that it is faster. The computing solutions are
  107. the first solvable solutions, not the best ones.
  108.  
  109. Basically, the code that resides in the Pascal source:
  110. "FringDus.pas" is like a Database Manager. It manages a
  111. 2 entity 1-N relational database. The ERD (Entity
  112. Relationship Diagram) is below:
  113.  
  114.  
  115.  
  116.                          ^
  117. ----------------        / \        ---------------
  118. |              |   1   /   \   N   |             |
  119. | FRINGPC1.PIC |------/ HAS \----->| FRING1.MAP  |
  120. |              |      \     /      |             |
  121. ----------------       \   /       ---------------
  122.                         \ /
  123.                          .
  124.  
  125.  
  126. It copies blocks of graphics contained of the "FRINGPC1.PAS"
  127. (FRINGdus PiCture 1) file (which is stored in memory), according
  128. to what the "FRING1.MAP" tells it (also stored in memory). The
  129. "FRING1.MAP" file is really the "map of the floor", which only
  130. contains position references to the blocks of graphics in the
  131. "FRINGPC1.PAS" file.
  132.  
  133. (Note/ From now on, we'll call the blocks of graphics: "Sprites"-
  134. from my good old C-64 days :) ).
  135.  
  136. When "Fringdus.exe" is executed, the computer reads a
  137. section of the "FRING1.MAP", It reads the relative locations
  138. of the sprites in the "fringpc1.pic file. It then reads the
  139. sprite and then copies it the video memory located at decimal
  140. address 40960 (A000h). The screen dimensions for Fringdus are:
  141. 320*200 pixels (or 64K of memory).
  142.  
  143. (Note that this for VGA only. You will have to make the relevent
  144. changes to the code to turn it in to a EGA or CGA game.)
  145.  
  146. Fringdus provides a quick assembly base to copy chucks of data
  147. to the video (invisible) memory. As you will see, many of these
  148. assembly routines are tailor made for certain situtions.
  149. The problem is with graphic libraries is that they are standardised.
  150. The problem with standardised anythings, is that they compensate
  151. for any kind of situation (philosophically speaking). Hence they are
  152. slow. If you want speed, you need to custom make routines for only
  153. certain situtions in assembly. Disassembled 3GL's like Pascal are
  154. very Stack intensive. There is alot of overhead in preparing values
  155. for the registers. Analagously, they "have a few drinks, watch a
  156. few porn's, have a couple of games of pool, then go to sleep" before
  157. they do they they useful. With assembly, you can "contain" the
  158. processing, within the action registers AX, DX, CX, BX, so that
  159. processing is very fast.
  160.  
  161. These routines are in no way efficient. I don't consider myself an
  162. assembly expert. An assembly expert will look at these routines and
  163. speed them up by 5 times, because they know what intructions are fast
  164. and what instructions are slow. A lot can be said about Assembly
  165. experts, but we won't go in to that now.
  166.  
  167.  
  168. NB/  A detailed look at how they work, is in the source documentation.
  169. If your still having problems with how they work, write me. I haven't
  170. documented them properly, but will. Remember!, I might be documenting
  171. for a living, so please remember that cooks don't like cooking when
  172. they get home :).
  173.  
  174.  
  175.   The sprites are 30 pixels by 30 pixels, as follows:
  176.  
  177.  
  178.                         (NOT TO SCALE)
  179.  
  180.  
  181.                              30 X
  182.                 -------------------------------
  183.                 |    o        o       o       |
  184.              3  |   o o      o o     o o      |
  185.              0  |    o        o       o       |
  186.                 |    o        o       o       |
  187.              X  | oooooooooooooooooooooooooo  |
  188.                 |    o        o       o       |
  189.                 |    o        o       o       |
  190.                 |    o        o       o       |
  191.                 |   o o      o o     o o      |
  192.                 |  o   o    o   o   o   o     |
  193.                 | o     o  o     o o     o    |
  194.                 -------------------------------
  195.  
  196.  
  197.  
  198. Each pixel (due to being VGA) consists of 1 byte to define it.
  199. As said before, these will get copied to the memory block:
  200. 40,960-106,495 (320*200 256 colour). These sprites are 900 bytes
  201. in length. I don't know why I chose 30x30. It looked a pretty
  202. optimal matrix. As you move smaller blocks, you get a high CPU
  203. load but the less blocks you have to store, the more diversifable
  204. grpahics you have because you can make more graphics with smaller 
  205. blocks. As you move bigger blocks, copying becomes more efficient, 
  206. BUT you need alot of memory to have a diversifed array of graphics.
  207.  
  208.  
  209. Fringdus reads the fring1.map (now in memmory), to determine what
  210. sprites to copy. It looks simliar to this:
  211.  
  212.  
  213.  
  214.                     (AGAIN, NOT TO SCALE)
  215.  
  216.  
  217.                         100 X
  218.             --------------------------------------
  219.            |   shhhhu                             |
  220.          1 |   d    d       aaaaau                |
  221.          0 |   d    d            d                |
  222.          0 |   d    d            d                |
  223.            |   d    d            d                |
  224.          X |   hffffl            d                |
  225.            |                     d                |
  226.            |                     d                |
  227.            |                     d                |
  228.            |                     d                |
  229.             --------------------------------------
  230.  
  231.  
  232. It is a 100x100 bytes. Each byte presents a sprite. As you may be
  233. wondering, this is a huge area. In real terms it is 3000*3000 pixels.
  234. Again, each byte contains a reference to a given sprite in the
  235. "fringpc1.pic" file. For example, if the value of a given
  236. position in the above map was say "4" (the 5th sprite), then
  237. the position of the fifth sprite would be at offset 4 * 900 =
  238. 3600...simple. It would go to postion 3600, copy 900 bytes
  239. from that offset, and then paste it to the screen (in a simple
  240. sense).
  241.  
  242.  
  243.   35 sprites are copied on the screen to define the floor surface,
  244. starting at coorinates (50,30). It look as follows:
  245.  
  246.  
  247.                     (NOT TO SCALE)
  248.  
  249.  
  250.                 -----------------------
  251.                 |   /- starts at 50,30|
  252.                 |   |                 |
  253.                 |   x x x x x x x x   |
  254.                 |                     |
  255.                 |   x x x x x x x x   |
  256.                 |                     |
  257.                 |   x x x x x x x x   |
  258.                 |                     |
  259.                 |   x x x x x x x x   |
  260.                 |                     |
  261.                 |   x x x x x x x x   |
  262.                 |     ^ sprites       |
  263.                 -----------------------
  264.  
  265.  
  266. If the sprites are not at their discrete postions, they will be
  267. scrolled. The assembly algo's, cut the border sprites so that
  268. they don't leak out from the painting area (this unfortunatly,
  269. takes up alot of O/H).
  270.  
  271. The key-pad keys, change the value of a marginal dx & dy values
  272. that change the value of the real x & y values. These values
  273. determine what sprites to copy when compared with the map file
  274. (fring1.map). For example, if real x and real y were 244 and
  275. 345 respectively then fringdus will refer to the map file at
  276. postions:
  277.  
  278.   x: (244 / 30)  thruto   (244 / 30) + 7
  279.  
  280.   y: (345 / 30)  thruto   (345 / 30) + 5
  281.  
  282. When "mod"'ed (eg X mod 30, Y mod 30), they determine the degree
  283. of scroll from the offset discrete position of a given sprite.
  284.  
  285.  
  286.   The operation keys are as follows:
  287.  
  288.  
  289.                    home    pgup
  290.                      \  |  /
  291.  
  292.                     -       -    (key pad)
  293.  
  294.                     /   |  \
  295.                    end     pgdn
  296.  
  297.  
  298. PIC_MAKE.PAS:
  299. -------------
  300.  
  301. I had to make my own sprite graphics program to make the sprites.
  302. The code is obvious, therefore I'm only going to briefly explain
  303. it here.
  304.  
  305. This program makes a 30x30 256 colour sprite that PACK.EXE will
  306. pack into "fringpc1.pic".
  307.  
  308. To execute this utility type in:
  309.  
  310.  
  311. Command: PIC_MAKE <sprite file>
  312.  
  313.  
  314. NB/ You don't have to have the PIC extension, it can be anything you
  315. like.)
  316.  
  317.  
  318.   The operation keys are:
  319.  
  320.                         |
  321.  
  322.                     -       -    (key pad)
  323.  
  324.                         |
  325.  
  326.   Enter Key: To write a pixel in the sprite the selected colour.
  327.  
  328.   -: GO up one colour
  329.   +: Go down one colour
  330.  
  331.   /: Go up 10 colours
  332.   *: Go down 10 colours.
  333.  
  334.   `: Fload full sprite with colour
  335.  
  336.   Esc: Exit (Abend)
  337.  
  338.   s: save present sprite
  339.   f: flip sprite and save (flips vertically)
  340.   t: turn sprite and save (flips horzontally)
  341.  
  342.  
  343. Once you have composed something, then you ever hit 's' for save or
  344. 'f' or 't' to save. Once saved, then you hit 'Esc' to exit.
  345.  
  346. The reason for the 'f' and 't', is that it saves you alot of work
  347. recomposing a drawing that that only needs to be "turned around" etc.
  348. If you want a mirror image of something, just create a clone copy
  349. of the sprite you want to flip or turn (eg IN DOS:
  350. copy jas1.pic jas2.pic), then load it up (eg pic_make jas2.pic). Once
  351. loaded, you can turn or flip it with the appropriate 'f' or 't' key.
  352. Once done- hit 'esc'.
  353.  
  354. PACK.PAS:
  355. ---------
  356.  
  357. Creates the "fringpc1.pic" file whichs contains the sprites that
  358. Fringdus reads. Pack read a list of pic files (*.pic - doesn't have
  359. to have the PIC extension, it can be anything) and then appends them
  360. to "fringpc1.pic".
  361.  
  362. command: PACK
  363.  
  364. Once executed, pack reads the 'PACK.INI' file, and moves/appends the
  365. files that are in this directive file, to the 'fringpc1.pic'.
  366.  
  367.  
  368. MAP_MAK2.PAS:
  369. -------------
  370.  
  371. This program edits the map file: "fring1.map". There was a
  372. map_make.pas, but that was an initiating program that was really
  373. shity. This program allows you to change the sprite references-
  374. hence the sprites to be displayed.
  375.  
  376. To execute, type in:
  377.  
  378. Command: map_mak2
  379.  
  380.  
  381.  
  382.   The Operation keys are:
  383.  
  384.                         |
  385.  
  386.                     -       -    (key pad)
  387.  
  388.                         |       :This is a block scroll
  389.  
  390.  
  391.  
  392.                         i
  393.  
  394.                     j       k   :Once positioned with keypad, you
  395.                                  move around with these keys
  396.                         m
  397.  
  398.  
  399.    enter: When you want to change a value in the map file matrix
  400.           simply hit this key. You then enter in the new value.
  401.           If you were repeating the same value (the same value last
  402.           entry), then just hit enter without entering in the value
  403.           again- this makes entring data alot faster (and less
  404.           frustrating).
  405.  
  406.    s: 's' saves fring1.map. Once saved, it immediately exits.
  407.  
  408.  
  409. bs.bat:
  410. -------
  411. Boot strap compiler sequence. With tpc (Borland Turbo Pascal V6) in
  412. your path just type in: bs. Fringdus will be built with the relavent
  413. compiler flags.
  414.  
  415.  
  416.  
  417. b_scr.bmp:
  418. ----------
  419.  
  420. The base screen. Fringdus writes this file in video memory initially.
  421. You can edit it this file to your needs using windows "paint Brush"
  422. for example.
  423.  
  424. (Note, I don't know the BMP format, I've just took a rough stab, just
  425. by displaying BMP's raw, and determining the format. Please send me 
  426. the correct BMP format)
  427.  
  428. *.pic:
  429. ------
  430.  
  431. The Individual sprite files before being packed.
  432.  
  433.  
  434.  
  435.  
  436. Enjoy :). Feel free to contact me if you don't understand something,
  437. or can't that something working.
  438.  
  439.  
  440.                                ooo0ooo
  441.  
  442. -----------------------------------------------------------------------------
  443.                               JsNO BAR----NUNN
  444.  
  445.          Spelling Disclaimer: "MY SUN keyboard is a chunk of shit"
  446.  
  447.    "Computer Science students learn how to become computing professionals,
  448.    Business Information Systems students are users learning about themselves"
  449.                               NTU, DARWIN, OZ
  450.                         nunn@pandanus.cs.ntu.edu.au
  451. -----------------------------------------------------------------------------
  452.  
  453.  
  454.   or
  455.   snail:
  456.  
  457.     8 Winton Street,
  458.     Jingili, Darwin,
  459.     NORTHERN TERRITORY,
  460.     0810,
  461.     AUSTRALIA.
  462.  
  463.