To refresh your memory, here is where I began my journey...
solidcorp, on Wed Oct 26, 2011 11:15 AM, said:
Tursi, on Mon Oct 24, 2011 10:06 PM, said:
Well, um, I did the game like 20 years ago (1990-1991?). I still have the source code, sort of... The Amiga 3000's battery leaked in storage and ruined its motherboard. The hard disk *might* still work, I did just recover all my old ST files last year from 25 year old Supra and Mega drives. I also have the Amiga floppy disk backups somewhere and *might* be able to restore them *if* I can find a floppy drive and the right software.
...
As far as speed is concerned, there is (or at least should be) a sweet spot, or what is now in racing games called a blue line, an optimal path through the levels. In stun runners tubes it would be on the outside, where a pendulum would swing if you were truly racing around the corners. The stars in the first levels are placed on that line to train you where you should be on the track for maximum speed. In the flat areas only the walls slow you down, and I don't think anything slows you down while boosting. The problem you *may* be having with S.T.U.N. Runner (if there is not a bug) is that the controls are touchy and you really can be harshly penalized for climbing too high up the walls. I put a lot of work into the centrifugal sweet spot aspect, if I didn't then the star placement painstakingly reproduced from the coin op wouldn't work.
Well, here we are.
I have since verified the function of the Lynx game and the coin op game and they are clearly different as described, and I have managed to recover the Lynx source, but the story doesn't end there.
First, let's look at the offending code, here is an excerpt from the function xyphysics in srship.src, starting at line 534:
; ***** DETERMINE WHETHER TO USE TUNNEL OR FLAT PHYSICS lda shipterrain cmp #WARP beq .38 bit #FLATFLAG bne .50 lda shipangle cmp #TUNFLATR+1 bge .50 cmp #TUNFLATL-1 blt .50 .38 ; ***** TUNNEL PHYSICS ***** ; ***** CURVATURE DECELERATION ; sweetspot = shipangle-(curvature+sign(curvature))*16 ; there is no curvature deceleration on flats stz temp0 lda dx2tab+2 beq .41 bpl .49 dec dec .49 inc asl asl asl asl .41 eor #$ff sec adc shipangle ; set max speed depending on deviation from shipangle ; the net is $80-A with max check bmi .47 eor #$ff inc .47 ; give a little lee way in terms of max speed sec sbc #$80 bpl .42 lda #shipmaxvx .42 cmp #shipmaxvmax blt .43 lda #shipmaxvmax .43 sta shipmaxv .70 ; ***** CENTRIFUGAL/GRAVITY FORCE FOR TUNNEL ; CG pulls toward shipangle-(curvature)*16 stz temp0 lda dx2tab+2 beq .72 asl asl asl asl .72 eor #$ff sec adc shipangle ; A contains the deviation from the CG vector ; add -A/4 to shipvx eor #$ff inc bpl .71 dec temp0 .71 lsr temp0 ror lsr temp0 ror adc shipvx sta shipvx ; if the ship is moving slow and shipangle has the ; opposite sign of the curvature then tell the person ; how to play lda speed cmp #20 bge .7f lda dx2tab+2 beq .7f bmi .77 lda shipangle bpl .7f bra .78 .77 lda shipangle bmi .7f .78 ; try to announce "the outside wall is faster in turns" lda #OUTSIDEWALLSBIT sta msgbits lda #msgtime sta msgtimer .7f jmp .80 .50 ; ***** FLAT PHYSICS ***** ; reset shipmaxv lda #shipmaxvmax sta shipmaxv ; ***** CENTRIFUGAL FORCE FOR FLATS ; force pulls shipx in d2x direction ; shipvx = shipvx+shipv*(curve+-1)*4/256 lda #4 ldx dx2tab+2 beq .60 ; bpl .51 ; dec ; dec ; dex ;.51 ; inc ; sta MATHD ; stx MATHC ; lda shipv ; sta MATHB ; stz MATHA ; WAITMATH ; lda MATHG ; asl MATHH ; rol ; asl MATHH ; rol ; this centripital force adds 1, or -1 to shipvx ; depending on the direction of curve only ; if the ship is moving fast enough bpl .51 lda #-4 .51 ldx shipv cpx #$40 bge .52 lda #0 .52 clc adc shipvx sta shipvx .60 ; ***** FRICION ON WALLS FOR FLATS
The cause of the observed behaviour is due the these 5 lines near the top.
lda shipangle cmp #TUNFLATR+1 bge .50 cmp #TUNFLATL-1 blt .50
This is very peculiar in the following ways.
- The preceding code, clearly identifies and acts on the type of track (flat or tunnel) that the ship is
; ***** DETERMINE WHETHER TO USE TUNNEL OR FLAT PHYSICS lda shipterrain cmp #WARP beq .38 bit #FLATFLAG bne .50
but goes on to test the ship's angle in the tunnel on the following 5 lines and if in the bottom, go execute the flat track physics codelda shipangle cmp #TUNFLATR+1 bge .50 cmp #TUNFLATL-1 blt .50
- Later in the FLAT PHYSICS section of the file, note that code for centrifugal force was written but commented out.
; ***** CENTRIFUGAL FORCE FOR FLATS ; force pulls shipx in d2x direction ; shipvx = shipvx+shipv*(curve+-1)*4/256 lda #4 ldx dx2tab+2 beq .60 ; bpl .51 ; dec ; dec ; dex ;.51 ; inc ; sta MATHD ; stx MATHC ; lda shipv ; sta MATHB ; stz MATHA ; WAITMATH ; lda MATHG ; asl MATHH ; rol ; asl MATHH ; rol
OK, so now I've found the source of the issue (pardon the pun) but could still not tell you weather this was an error, or deliberate, so I pulled all the paperwork back out of storage and read every note and piece of correspondence I still have from S.T.U.N. Runner and found this.
It is the official Lynx S.T.U.N. Runner Atari Games review, the pre-release beta review of the Lynx game by the main programmer of the coin op game. It all came back to me right in item 2.




Item #2

I did exactly that, and to further adapt the game for the Lynx, Atari Corp management/QA requested I treat the floor of the tunnels the same as flat sections of track. Most of the time, enemies would force you off the floor anyway.
The whole Lynx recovery photo album inlcuding some coin op source, the full resolution letters, and more can be found here:
https://picasaweb.go...feat=directlink
So, the bottom line is, yes there is a discrepancy, but it is not a bug, it's an adaptation and at one point in development, it was true to the coin op.
That was fun and the very happy side effect is that I have all that source material recovered and backed up on DVD now.
Thanks for pointing it out Tursi!














