Home » Archimedes archive » Acorn User » AU 1997-10 B.adf » 3D » !AU_Attack/!Run

!AU_Attack/!Run

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Acorn User » AU 1997-10 B.adf » 3D
Filename: !AU_Attack/!Run
Read OK:
File size: 0A54 bytes
Load address: 0000
Exec address: 0000
File contents
| ************************************************************* |
| !Run File (new version +comments) for Acorn User 3-d Articles |
| ************************************************************* |
| Notes:
| The latest edition of the source.engine (ray caster) has had 
| so many updates that it needs to be mentioned. Most importan
| tly the engine can now be passed parameters and hence there
| needs to be documentation as to what values should be passed.

| This command will open the engine directory for easy access to 
| important files and the saved screenshot

*Filer_OpenDir <AUARay$Dir>

| Establish a wimpslot (memory) of 512k

Wimpslot -min 640k -max 640k

| All that is now required is to prepare and then call the engine
| with appropriate values
|
| <syntax for engine>
|
| engine <view_x> <view_y> <view_ang> <scr_wid> <scr_hei> <angles> <vscale> <move> <rotate> <viewvar> <view2> <demoflag>
|<demoflag2> <object_index>
| Notes:
| <view_x> <view_y> are normally in the range 0-4096 (fine coordinates, not 
| grid squares).
|
|<scr_wid> and <scr_hei> are the sizes of window which the engine will render
|<scr_wid> must be divisible by 32 and not exceed 320, <scr_hei> should be 0-|200, though try others by all means!
|
|
| <view_ang> is limited by <angles>. <angles> is the number of elements in 
| the angular look-up method (e.g. 0-1920 normally. This needs to be careful
| ly calculated with the following formula
|
| <angles>= <scr_wid> * 360 / desired Field of View (0-90 recommended)
|
| <vscale> is used to scale the slivers, normal ranging (5000-15000). It can| be calculated with the formula:
|
| <vscale> = <scr_hei> * 64� (though you can experiment with values)
| 
| <move> controls how many units you move per keypress (2-30 rmmnd)
| <rotate> controls the angle rotated per keypress (5-90 rmmnd)
| <viewvar> and <view2> are numbers used to plot objects correctly (160 / tan(FOV/2) for <viewvar> and view2<viewvar)
| <demoflag2> when 1 write demo 0 do nothing
| <demoflag�> when 1 read demo 0 do nothing
| <object_index> relates to frame rate and controls how fast objects move
| e.g.s engine 400 400 200 128 128 768 8192 10 30 277 250 0 0 0.4
|       engine 400 400 100 288 200 1728 12800 10 30 277 250 0 0 0.4
|       engine 400 400 0 64 64 384 4096 (!!!) 10 30 277 250 0 0 0.4
|       engine 400 400 100 288 160 1728 10800 10 30 277 250 0 0 0.4
| Finally, call the engine after loading a gunshot

*RMLoad <AUARay$Dir>.gunshot
*Channelvoice 1 gunshot


*Run <AUARay$Dir>.source.engine 400 400 100 320 200 1920 12800 20 30 277 230  0 0 30
*Channelvoice 1 1
*RMKill gunshot
| Return to normal style of font

*Fx 20
00000000  7c 20 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  || **************|
00000010  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000030  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 20  |*************** |
00000040  7c 0a 7c 20 21 52 75 6e  20 46 69 6c 65 20 28 6e  ||.| !Run File (n|
00000050  65 77 20 76 65 72 73 69  6f 6e 20 2b 63 6f 6d 6d  |ew version +comm|
00000060  65 6e 74 73 29 20 66 6f  72 20 41 63 6f 72 6e 20  |ents) for Acorn |
00000070  55 73 65 72 20 33 2d 64  20 41 72 74 69 63 6c 65  |User 3-d Article|
00000080  73 20 7c 0a 7c 20 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |s |.| **********|
00000090  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
000000c0  2a 2a 2a 20 7c 0a 7c 20  4e 6f 74 65 73 3a 0a 7c  |*** |.| Notes:.||
000000d0  20 54 68 65 20 6c 61 74  65 73 74 20 65 64 69 74  | The latest edit|
000000e0  69 6f 6e 20 6f 66 20 74  68 65 20 73 6f 75 72 63  |ion of the sourc|
000000f0  65 2e 65 6e 67 69 6e 65  20 28 72 61 79 20 63 61  |e.engine (ray ca|
00000100  73 74 65 72 29 20 68 61  73 20 68 61 64 20 0a 7c  |ster) has had .||
00000110  20 73 6f 20 6d 61 6e 79  20 75 70 64 61 74 65 73  | so many updates|
00000120  20 74 68 61 74 20 69 74  20 6e 65 65 64 73 20 74  | that it needs t|
00000130  6f 20 62 65 20 6d 65 6e  74 69 6f 6e 65 64 2e 20  |o be mentioned. |
00000140  4d 6f 73 74 20 69 6d 70  6f 72 74 61 6e 0a 7c 20  |Most importan.| |
00000150  74 6c 79 20 74 68 65 20  65 6e 67 69 6e 65 20 63  |tly the engine c|
00000160  61 6e 20 6e 6f 77 20 62  65 20 70 61 73 73 65 64  |an now be passed|
00000170  20 70 61 72 61 6d 65 74  65 72 73 20 61 6e 64 20  | parameters and |
00000180  68 65 6e 63 65 20 74 68  65 72 65 0a 7c 20 6e 65  |hence there.| ne|
00000190  65 64 73 20 74 6f 20 62  65 20 64 6f 63 75 6d 65  |eds to be docume|
000001a0  6e 74 61 74 69 6f 6e 20  61 73 20 74 6f 20 77 68  |ntation as to wh|
000001b0  61 74 20 76 61 6c 75 65  73 20 73 68 6f 75 6c 64  |at values should|
000001c0  20 62 65 20 70 61 73 73  65 64 2e 0a 0a 7c 20 54  | be passed...| T|
000001d0  68 69 73 20 63 6f 6d 6d  61 6e 64 20 77 69 6c 6c  |his command will|
000001e0  20 6f 70 65 6e 20 74 68  65 20 65 6e 67 69 6e 65  | open the engine|
000001f0  20 64 69 72 65 63 74 6f  72 79 20 66 6f 72 20 65  | directory for e|
00000200  61 73 79 20 61 63 63 65  73 73 20 74 6f 20 0a 7c  |asy access to .||
00000210  20 69 6d 70 6f 72 74 61  6e 74 20 66 69 6c 65 73  | important files|
00000220  20 61 6e 64 20 74 68 65  20 73 61 76 65 64 20 73  | and the saved s|
00000230  63 72 65 65 6e 73 68 6f  74 0a 0a 2a 46 69 6c 65  |creenshot..*File|
00000240  72 5f 4f 70 65 6e 44 69  72 20 3c 41 55 41 52 61  |r_OpenDir <AUARa|
00000250  79 24 44 69 72 3e 0a 0a  7c 20 45 73 74 61 62 6c  |y$Dir>..| Establ|
00000260  69 73 68 20 61 20 77 69  6d 70 73 6c 6f 74 20 28  |ish a wimpslot (|
00000270  6d 65 6d 6f 72 79 29 20  6f 66 20 35 31 32 6b 0a  |memory) of 512k.|
00000280  0a 57 69 6d 70 73 6c 6f  74 20 2d 6d 69 6e 20 36  |.Wimpslot -min 6|
00000290  34 30 6b 20 2d 6d 61 78  20 36 34 30 6b 0a 0a 7c  |40k -max 640k..||
000002a0  20 41 6c 6c 20 74 68 61  74 20 69 73 20 6e 6f 77  | All that is now|
000002b0  20 72 65 71 75 69 72 65  64 20 69 73 20 74 6f 20  | required is to |
000002c0  70 72 65 70 61 72 65 20  61 6e 64 20 74 68 65 6e  |prepare and then|
000002d0  20 63 61 6c 6c 20 74 68  65 20 65 6e 67 69 6e 65  | call the engine|
000002e0  0a 7c 20 77 69 74 68 20  61 70 70 72 6f 70 72 69  |.| with appropri|
000002f0  61 74 65 20 76 61 6c 75  65 73 0a 7c 0a 7c 20 3c  |ate values.|.| <|
00000300  73 79 6e 74 61 78 20 66  6f 72 20 65 6e 67 69 6e  |syntax for engin|
00000310  65 3e 0a 7c 0a 7c 20 65  6e 67 69 6e 65 20 3c 76  |e>.|.| engine <v|
00000320  69 65 77 5f 78 3e 20 3c  76 69 65 77 5f 79 3e 20  |iew_x> <view_y> |
00000330  3c 76 69 65 77 5f 61 6e  67 3e 20 3c 73 63 72 5f  |<view_ang> <scr_|
00000340  77 69 64 3e 20 3c 73 63  72 5f 68 65 69 3e 20 3c  |wid> <scr_hei> <|
00000350  61 6e 67 6c 65 73 3e 20  3c 76 73 63 61 6c 65 3e  |angles> <vscale>|
00000360  20 3c 6d 6f 76 65 3e 20  3c 72 6f 74 61 74 65 3e  | <move> <rotate>|
00000370  20 3c 76 69 65 77 76 61  72 3e 20 3c 76 69 65 77  | <viewvar> <view|
00000380  32 3e 20 3c 64 65 6d 6f  66 6c 61 67 3e 0a 7c 3c  |2> <demoflag>.|<|
00000390  64 65 6d 6f 66 6c 61 67  32 3e 20 3c 6f 62 6a 65  |demoflag2> <obje|
000003a0  63 74 5f 69 6e 64 65 78  3e 0a 7c 20 4e 6f 74 65  |ct_index>.| Note|
000003b0  73 3a 0a 7c 20 3c 76 69  65 77 5f 78 3e 20 3c 76  |s:.| <view_x> <v|
000003c0  69 65 77 5f 79 3e 20 61  72 65 20 6e 6f 72 6d 61  |iew_y> are norma|
000003d0  6c 6c 79 20 69 6e 20 74  68 65 20 72 61 6e 67 65  |lly in the range|
000003e0  20 30 2d 34 30 39 36 20  28 66 69 6e 65 20 63 6f  | 0-4096 (fine co|
000003f0  6f 72 64 69 6e 61 74 65  73 2c 20 6e 6f 74 20 0a  |ordinates, not .|
00000400  7c 20 67 72 69 64 20 73  71 75 61 72 65 73 29 2e  || grid squares).|
00000410  0a 7c 0a 7c 3c 73 63 72  5f 77 69 64 3e 20 61 6e  |.|.|<scr_wid> an|
00000420  64 20 3c 73 63 72 5f 68  65 69 3e 20 61 72 65 20  |d <scr_hei> are |
00000430  74 68 65 20 73 69 7a 65  73 20 6f 66 20 77 69 6e  |the sizes of win|
00000440  64 6f 77 20 77 68 69 63  68 20 74 68 65 20 65 6e  |dow which the en|
00000450  67 69 6e 65 20 77 69 6c  6c 20 72 65 6e 64 65 72  |gine will render|
00000460  0a 7c 3c 73 63 72 5f 77  69 64 3e 20 6d 75 73 74  |.|<scr_wid> must|
00000470  20 62 65 20 64 69 76 69  73 69 62 6c 65 20 62 79  | be divisible by|
00000480  20 33 32 20 61 6e 64 20  6e 6f 74 20 65 78 63 65  | 32 and not exce|
00000490  65 64 20 33 32 30 2c 20  3c 73 63 72 5f 68 65 69  |ed 320, <scr_hei|
000004a0  3e 20 73 68 6f 75 6c 64  20 62 65 20 30 2d 7c 32  |> should be 0-|2|
000004b0  30 30 2c 20 74 68 6f 75  67 68 20 74 72 79 20 6f  |00, though try o|
000004c0  74 68 65 72 73 20 62 79  20 61 6c 6c 20 6d 65 61  |thers by all mea|
000004d0  6e 73 21 0a 7c 0a 7c 0a  7c 20 3c 76 69 65 77 5f  |ns!.|.|.| <view_|
000004e0  61 6e 67 3e 20 69 73 20  6c 69 6d 69 74 65 64 20  |ang> is limited |
000004f0  62 79 20 3c 61 6e 67 6c  65 73 3e 2e 20 3c 61 6e  |by <angles>. <an|
00000500  67 6c 65 73 3e 20 69 73  20 74 68 65 20 6e 75 6d  |gles> is the num|
00000510  62 65 72 20 6f 66 20 65  6c 65 6d 65 6e 74 73 20  |ber of elements |
00000520  69 6e 20 0a 7c 20 74 68  65 20 61 6e 67 75 6c 61  |in .| the angula|
00000530  72 20 6c 6f 6f 6b 2d 75  70 20 6d 65 74 68 6f 64  |r look-up method|
00000540  20 28 65 2e 67 2e 20 30  2d 31 39 32 30 20 6e 6f  | (e.g. 0-1920 no|
00000550  72 6d 61 6c 6c 79 2e 20  54 68 69 73 20 6e 65 65  |rmally. This nee|
00000560  64 73 20 74 6f 20 62 65  20 63 61 72 65 66 75 6c  |ds to be careful|
00000570  0a 7c 20 6c 79 20 63 61  6c 63 75 6c 61 74 65 64  |.| ly calculated|
00000580  20 77 69 74 68 20 74 68  65 20 66 6f 6c 6c 6f 77  | with the follow|
00000590  69 6e 67 20 66 6f 72 6d  75 6c 61 0a 7c 0a 7c 20  |ing formula.|.| |
000005a0  3c 61 6e 67 6c 65 73 3e  3d 20 3c 73 63 72 5f 77  |<angles>= <scr_w|
000005b0  69 64 3e 20 2a 20 33 36  30 20 2f 20 64 65 73 69  |id> * 360 / desi|
000005c0  72 65 64 20 46 69 65 6c  64 20 6f 66 20 56 69 65  |red Field of Vie|
000005d0  77 20 28 30 2d 39 30 20  72 65 63 6f 6d 6d 65 6e  |w (0-90 recommen|
000005e0  64 65 64 29 0a 7c 0a 7c  20 3c 76 73 63 61 6c 65  |ded).|.| <vscale|
000005f0  3e 20 69 73 20 75 73 65  64 20 74 6f 20 73 63 61  |> is used to sca|
00000600  6c 65 20 74 68 65 20 73  6c 69 76 65 72 73 2c 20  |le the slivers, |
00000610  6e 6f 72 6d 61 6c 20 72  61 6e 67 69 6e 67 20 28  |normal ranging (|
00000620  35 30 30 30 2d 31 35 30  30 30 29 2e 20 49 74 20  |5000-15000). It |
00000630  63 61 6e 7c 20 62 65 20  63 61 6c 63 75 6c 61 74  |can| be calculat|
00000640  65 64 20 77 69 74 68 20  74 68 65 20 66 6f 72 6d  |ed with the form|
00000650  75 6c 61 3a 0a 7c 0a 7c  20 3c 76 73 63 61 6c 65  |ula:.|.| <vscale|
00000660  3e 20 3d 20 3c 73 63 72  5f 68 65 69 3e 20 2a 20  |> = <scr_hei> * |
00000670  36 34 8c 20 28 74 68 6f  75 67 68 20 79 6f 75 20  |64. (though you |
00000680  63 61 6e 20 65 78 70 65  72 69 6d 65 6e 74 20 77  |can experiment w|
00000690  69 74 68 20 76 61 6c 75  65 73 29 0a 7c 20 0a 7c  |ith values).| .||
000006a0  20 3c 6d 6f 76 65 3e 20  63 6f 6e 74 72 6f 6c 73  | <move> controls|
000006b0  20 68 6f 77 20 6d 61 6e  79 20 75 6e 69 74 73 20  | how many units |
000006c0  79 6f 75 20 6d 6f 76 65  20 70 65 72 20 6b 65 79  |you move per key|
000006d0  70 72 65 73 73 20 28 32  2d 33 30 20 72 6d 6d 6e  |press (2-30 rmmn|
000006e0  64 29 0a 7c 20 3c 72 6f  74 61 74 65 3e 20 63 6f  |d).| <rotate> co|
000006f0  6e 74 72 6f 6c 73 20 74  68 65 20 61 6e 67 6c 65  |ntrols the angle|
00000700  20 72 6f 74 61 74 65 64  20 70 65 72 20 6b 65 79  | rotated per key|
00000710  70 72 65 73 73 20 28 35  2d 39 30 20 72 6d 6d 6e  |press (5-90 rmmn|
00000720  64 29 0a 7c 20 3c 76 69  65 77 76 61 72 3e 20 61  |d).| <viewvar> a|
00000730  6e 64 20 3c 76 69 65 77  32 3e 20 61 72 65 20 6e  |nd <view2> are n|
00000740  75 6d 62 65 72 73 20 75  73 65 64 20 74 6f 20 70  |umbers used to p|
00000750  6c 6f 74 20 6f 62 6a 65  63 74 73 20 63 6f 72 72  |lot objects corr|
00000760  65 63 74 6c 79 20 28 31  36 30 20 2f 20 74 61 6e  |ectly (160 / tan|
00000770  28 46 4f 56 2f 32 29 20  66 6f 72 20 3c 76 69 65  |(FOV/2) for <vie|
00000780  77 76 61 72 3e 20 61 6e  64 20 76 69 65 77 32 3c  |wvar> and view2<|
00000790  76 69 65 77 76 61 72 29  0a 7c 20 3c 64 65 6d 6f  |viewvar).| <demo|
000007a0  66 6c 61 67 32 3e 20 77  68 65 6e 20 31 20 77 72  |flag2> when 1 wr|
000007b0  69 74 65 20 64 65 6d 6f  20 30 20 64 6f 20 6e 6f  |ite demo 0 do no|
000007c0  74 68 69 6e 67 0a 7c 20  3c 64 65 6d 6f 66 6c 61  |thing.| <demofla|
000007d0  67 8c 3e 20 77 68 65 6e  20 31 20 72 65 61 64 20  |g.> when 1 read |
000007e0  64 65 6d 6f 20 30 20 64  6f 20 6e 6f 74 68 69 6e  |demo 0 do nothin|
000007f0  67 0a 7c 20 3c 6f 62 6a  65 63 74 5f 69 6e 64 65  |g.| <object_inde|
00000800  78 3e 20 72 65 6c 61 74  65 73 20 74 6f 20 66 72  |x> relates to fr|
00000810  61 6d 65 20 72 61 74 65  20 61 6e 64 20 63 6f 6e  |ame rate and con|
00000820  74 72 6f 6c 73 20 68 6f  77 20 66 61 73 74 20 6f  |trols how fast o|
00000830  62 6a 65 63 74 73 20 6d  6f 76 65 0a 7c 20 65 2e  |bjects move.| e.|
00000840  67 2e 73 20 65 6e 67 69  6e 65 20 34 30 30 20 34  |g.s engine 400 4|
00000850  30 30 20 32 30 30 20 31  32 38 20 31 32 38 20 37  |00 200 128 128 7|
00000860  36 38 20 38 31 39 32 20  31 30 20 33 30 20 32 37  |68 8192 10 30 27|
00000870  37 20 32 35 30 20 30 20  30 20 30 2e 34 0a 7c 20  |7 250 0 0 0.4.| |
00000880  20 20 20 20 20 20 65 6e  67 69 6e 65 20 34 30 30  |      engine 400|
00000890  20 34 30 30 20 31 30 30  20 32 38 38 20 32 30 30  | 400 100 288 200|
000008a0  20 31 37 32 38 20 31 32  38 30 30 20 31 30 20 33  | 1728 12800 10 3|
000008b0  30 20 32 37 37 20 32 35  30 20 30 20 30 20 30 2e  |0 277 250 0 0 0.|
000008c0  34 0a 7c 20 20 20 20 20  20 20 65 6e 67 69 6e 65  |4.|       engine|
000008d0  20 34 30 30 20 34 30 30  20 30 20 36 34 20 36 34  | 400 400 0 64 64|
000008e0  20 33 38 34 20 34 30 39  36 20 28 21 21 21 29 20  | 384 4096 (!!!) |
000008f0  31 30 20 33 30 20 32 37  37 20 32 35 30 20 30 20  |10 30 277 250 0 |
00000900  30 20 30 2e 34 0a 7c 20  20 20 20 20 20 20 65 6e  |0 0.4.|       en|
00000910  67 69 6e 65 20 34 30 30  20 34 30 30 20 31 30 30  |gine 400 400 100|
00000920  20 32 38 38 20 31 36 30  20 31 37 32 38 20 31 30  | 288 160 1728 10|
00000930  38 30 30 20 31 30 20 33  30 20 32 37 37 20 32 35  |800 10 30 277 25|
00000940  30 20 30 20 30 20 30 2e  34 0a 7c 20 46 69 6e 61  |0 0 0 0.4.| Fina|
00000950  6c 6c 79 2c 20 63 61 6c  6c 20 74 68 65 20 65 6e  |lly, call the en|
00000960  67 69 6e 65 20 61 66 74  65 72 20 6c 6f 61 64 69  |gine after loadi|
00000970  6e 67 20 61 20 67 75 6e  73 68 6f 74 0a 0a 2a 52  |ng a gunshot..*R|
00000980  4d 4c 6f 61 64 20 3c 41  55 41 52 61 79 24 44 69  |MLoad <AUARay$Di|
00000990  72 3e 2e 67 75 6e 73 68  6f 74 0a 2a 43 68 61 6e  |r>.gunshot.*Chan|
000009a0  6e 65 6c 76 6f 69 63 65  20 31 20 67 75 6e 73 68  |nelvoice 1 gunsh|
000009b0  6f 74 0a 0a 0a 2a 52 75  6e 20 3c 41 55 41 52 61  |ot...*Run <AUARa|
000009c0  79 24 44 69 72 3e 2e 73  6f 75 72 63 65 2e 65 6e  |y$Dir>.source.en|
000009d0  67 69 6e 65 20 34 30 30  20 34 30 30 20 31 30 30  |gine 400 400 100|
000009e0  20 33 32 30 20 32 30 30  20 31 39 32 30 20 31 32  | 320 200 1920 12|
000009f0  38 30 30 20 32 30 20 33  30 20 32 37 37 20 32 33  |800 20 30 277 23|
00000a00  30 20 20 30 20 30 20 33  30 0a 2a 43 68 61 6e 6e  |0  0 0 30.*Chann|
00000a10  65 6c 76 6f 69 63 65 20  31 20 31 0a 2a 52 4d 4b  |elvoice 1 1.*RMK|
00000a20  69 6c 6c 20 67 75 6e 73  68 6f 74 0a 7c 20 52 65  |ill gunshot.| Re|
00000a30  74 75 72 6e 20 74 6f 20  6e 6f 72 6d 61 6c 20 73  |turn to normal s|
00000a40  74 79 6c 65 20 6f 66 20  66 6f 6e 74 0a 0a 2a 46  |tyle of font..*F|
00000a50  78 20 32 30                                       |x 20|
00000a54