Nürburgring - a new track for Revs (testers wanted!)

User avatar
MarkMoxon
Posts: 606
Joined: Thu Jul 18, 2019 4:38 pm
Contact:

Re: Nürburgring - a new track for Revs (testers wanted!)

Post by MarkMoxon »

jms2 wrote: Mon Aug 15, 2022 8:06 pm Thanks for providing more fascinating material to read Mark!

One question regarding the dynamic track generation - doesn't this slow the game down a bit? Presumably it does, but this is not noticeable because the animation is still locked to a fixed number of frames per second and there was a bit of spare time available?
Good question!

It might be slightly slower, but even in the original Silverstone track, the track shape is dynamically generated in the sense that we always start from the beginning of a track section, and then add the segment vectors sequentially to get the coordinates of each of the track segments in that section. This is the same in the extra tracks, except the segment vectors are also generated rather than being read from memory; the extra steps for each segment are adding the deltas to the yaw angle and slope, and then looking up the vector from the curve tables, which isn't that much more, in the end. It certainly doesn’t feel slower in the extra tracks, so I assume the small number of extra cycles per segment are too small to make a difference.

Also, the game isn't locked to a specific frame rate, but because the screen is buffered and the process of copying the buffer to the screen is relatively quick, we get really smooth animation. The custom screen mode's palette changes are locked to vsync, but the screen content refreshes once every iteration of the main loop, without syncing to the frame rate, so the whole game can speed up or slow down without looking any different.

Mark
User avatar
aidanthegasman
Posts: 24
Joined: Wed Jun 03, 2020 11:32 pm
Contact:

Re: Nürburgring - a new track for Revs (testers wanted!)

Post by aidanthegasman »

Hi Mark,
I I just wanted to give a little bit of feedback.
I have recently been watching the YouTube videos about Revs. There has been a lot of praise from various YouTubers about how sophisticated the game is, and this in turn prompted me to take a look at your disassembly of Revs. I can't pretend to understand much of the very technical aspects of the programming, but nonetheless I am absolutely dazzled by (1) the genius of Geoff Crammond in getting it all to work at all, and (2) your genius in being able to unravel what must have (metaphorically) looked like a very tight ball of many different unlabelled bits of string, and then laying them out neatly and in parallel so that we can see what bit of string does what.
Faced with some pretty hard limits, I wonder what Crammond was forced to leave out of the game, and what he might have done with (say) a Master-enhanced or even Tube-enhanced version.
It's all made me appreciate this amazing game even more, and in fact this morning I've been getting it set up on my emulator to have a few laps.
What I remember from BITD was being able to turn the car and drive around the circuit backward. I would deliberately crash head-on into the other cars, and (as your website states) one can cause an enemy car to die, so that it just sits there unmoving on the track every further lap you pass.
Having looked through your website, there's a page about what happens when the car isn't in contact with the road (such as when it hits the kerb). Is it possible in the game for the car to leap on the track? Are there any parts of the track which have a steep enough section for the car to transiently get some air (I've seen cars do this in other simulations, such as Gran Turismo).
Anyway, thanks again for teasing apart Elite, Aviator and Revs, and for providing such amazing info for these extraordinary games.
Cheers,
Aidan.
User avatar
MarkMoxon
Posts: 606
Joined: Thu Jul 18, 2019 4:38 pm
Contact:

Re: Nürburgring - a new track for Revs (testers wanted!)

Post by MarkMoxon »

aidanthegasman wrote: Sat Feb 10, 2024 10:54 pm I can't pretend to understand much of the very technical aspects of the programming, but nonetheless I am absolutely dazzled by (1) the genius of Geoff Crammond in getting it all to work at all, and (2) your genius in being able to unravel what must have (metaphorically) looked like a very tight ball of many different unlabelled bits of string, and then laying them out neatly and in parallel so that we can see what bit of string does what.
Ha, that's an excellent analogy - disassembly is very much like unpicking a jumble of threads. I like it. :-)

And thank you for the kind words! I'm really glad you like the analysis.
aidanthegasman wrote: Sat Feb 10, 2024 10:54 pm Having looked through your website, there's a page about what happens when the car isn't in contact with the road (such as when it hits the kerb). Is it possible in the game for the car to leap on the track? Are there any parts of the track which have a steep enough section for the car to transiently get some air (I've seen cars do this in other simulations, such as Gran Turismo).
Anyway, thanks again for teasing apart Elite, Aviator and Revs, and for providing such amazing info for these extraordinary games.
Unfortunately you can only jump off the surface track in two situations: hitting the kerb and being lifted back onto the track following a crash. The driving model does include the car's height above the track - so engine torque is lost when you're jumping, for example - but you can't leave the ground by going really fast over a hilly part of the track.

To jump, you need to have at least one wheel off the track, and to be heading off the track (so you can't jump over the track by driving at the kerb from the grass, as it won't jump when you hit the kerb that way). Here's the code:

https://revs.bbcelite.com/source/main/s ... track.html

So the answer appears to be "no", I'm afraid. Revs is not Stunt Car Racer, unfortunately!

Mark
User avatar
aidanthegasman
Posts: 24
Joined: Wed Jun 03, 2020 11:32 pm
Contact:

Re: Nürburgring - a new track for Revs (testers wanted!)

Post by aidanthegasman »

Thanks for your reply Mark.
I'm sure you've come across this already, but Stairway to Hell has a Cheat version of Revs which says it has an "improved vehicle". Can you say what improvements there are to the car? I've attached it just in case you haven't got it handy.
Cheers,
Aidan.
Attachments
CHT_Revs-ImprovedVehicle.ssd
(39.25 KiB) Downloaded 4 times
User avatar
MarkMoxon
Posts: 606
Joined: Thu Jul 18, 2019 4:38 pm
Contact:

Re: Nürburgring - a new track for Revs (testers wanted!)

Post by MarkMoxon »

I analysed this cheat as part of my project - it was the only clue I could find anywhere when it came to the actual code!

Here are the notes I made at the time:

Code: Select all

In R.Revs2 in hack disc, the following get changed:

.PrintGearNumber, &42DE
gears=&42DF - address in this instruction is hacked to load from gear2 instead of gearNumberText

.ApplyEngine, &49F2
ratios=&49F3 - address in this instruction is hacked to load from ratio2 instead of trackData+1798 = trackGearRatio

.ApplyEngine, &4A81
powers=&4A82 - address in this instruction is hacked to load from power2 instead of trackData+1805 = trackGearPower

Then the following hacks change the tests for the max gear number in ProcessDrivingKeys:

higear=&6451  - 0x16d1 in binary, changes LDA #6 before .keys26 to LDA #A%
higear2=&644D - 0x16cd in binary, changes CMP #7 before .keys26 to CMP #A%-1

where A% = new highest gear number
and here's the hack code I'm referring to (ignore the strange characters, they're MODE 7 colours):

Code: Select all

   10REM Revs Cheat
   20REM
   30REM
   40DATA 7
   50DATA &67,&42,&35,&2E,&2A
   60DATA &A1,&68,&52,&48,&41
   70 
   80DATA 7
   90DATA &67,&42,&35,&2E,&2A
  100DATA &B0,&80,&68,&58,&50
  110 
  120DATA 8
  130DATA &56,&45,&3B,&32,&2B,&25
  140DATA &E0,&E0,&E0,&D8,&D8,&C8
  150 
  160DATA 5
  170DATA &42,&31,&2B
  180DATA &D0,&C0,&B0
  190 
  200DATA 4
  210DATA &48,&20
  220DATA &D5,&F0
  230 
  240oscli =&FFF7
  250C$=CHR$13
  260 
  270gear2 =&7F4
  280ratio2=&899
  290power2=&8AD
  300 
  310gears =&42DF
  320ratios=&49F3
  330powers=&4A82
  340 
  350higear=&6451
  360higear2=&644D
  370 
  380 
  390FOR I%=0 TO 2 STEP2
  400P%=&C00
  410[OPT I%
  420.cheat PHA
  430       LDX #FNl(prog)
  440       LDY #FNh(prog):JSR oscli
  450 
  460       PLA:TAX
  470       STX higear2
  480       DEX:STX higear
  490       LDA #0
  500       STA ratio+1:STA power+1
  510.copyl LDA gear,X:STA gear2,X
  520       LDA ratio,X:STA ratio2,X
  530       LDA power,X:STA power2,X
  540       DEX:BPL copyl
  550 
  560       LDA #FNl(gear2)
  570       STA gears
  580       LDA #FNh(gear2)
  590       STA gears+1
  600 
  610       LDA #FNl(ratio2)
  620       STA ratios
  630       LDA #FNh(ratio2)
  640       STA ratios+1
  650 
  660       LDA #FNl(power2)
  670       STA powers
  680       LDA #FNh(power2)
  690       STA powers+1
  700 
  710       JMP &1200
  720 
  730.gear  OPT FNequs("RN1234567T")
  740 
  750.ratio OPT FNequb(&67):OPT FNequd(0)
  760       OPT FNequd(0):OPT FNequd(0)
  770 
  780.power OPT FNequb(&A1):OPT FNequd(0)
  790       OPT FNequd(0):OPT FNequd(0)
  800 
  810.prog  OPT FNequs("LOAD Revs3"+C$)
  820]:NEXT
  830VDU28,1,24,39,6,12
  840PRINT'"ÇWhich REVS mode can you handle :"'
  850PRINT'"É1á-ÜA stock standard car"
  860PRINT'"É2á-ÜA high performance car                Üwith stock gearing"
  880PRINT'"É3á-ÜA high performance car                Üwith a 6 speed gearbox"
  900PRINT'"É4á-ÜA high performance car                Üwith a 3 speed gearbox"
  920PRINT'"É5á-ÜAn out of this world 2 gear car       Üwith FAST and VERY FAST"
  940PRINT'"ÖEnter choice of carÑ(1-5)Ü-Å";
  950W$=GET$:IFW$<"1"ORW$>"5"THEN950 ELSEPRINTW$;:ONVAL(W$)GOTO960,970,980,990,1000
  960RESTORE 40:GOTO1010
  970RESTORE 80:GOTO1010
  980RESTORE 120:GOTO1010 
  990RESTORE 160:GOTO1010
 1000RESTORE 200:gear?2=ASC"F":gear?3=ASC"V" 
 1010READ A%
 1020FOR I%=2 TO A%-1
 1030READ I%?ratio
 1040NEXT
 1050FOR I%=2 TO A%-1
 1060READ I%?power
 1070NEXT
 1080CALL cheat
 1090END
 1100 
 1110DEF FNl(A%)=(A% AND &FF)
 1120DEF FNh(A%)=(A% DIV 256)
 1130 
 1140DEF FNr(A%):LOCAL I%
 1150FOR I%=3 TO 0 STEP-1
 1160I%?&70=FNl(A%):A%=FNh(A%)
 1170NEXT
 1180=!&70
 1190DEFFNequs(string$)
 1200$P%=string$:P%=P%+LENstring$
 1210=I%
 1220DEFFNequb(byte)
 1230?P%=byte:P%=P%+1
 1240=I%
 1250DEFFNequd(word)
 1260!P%=word:P%=P%+4
 1270=I%
So this hack changes the number shown on the gear stick (PrintGearNumber), the number of the maximum available gear (ProcessDrivingKeys), the gear ratio (trackGearRatio) and the gear power (trackGearPower). The relevant code can be found here:

https://revs.bbcelite.com/source/main/s ... umber.html

https://revs.bbcelite.com/source/main/s ... tml#keys25

https://revs.bbcelite.com/source/silver ... ratio.html

https://revs.bbcelite.com/source/silver ... power.html

It's a very clever hack!

Mark
User avatar
aidanthegasman
Posts: 24
Joined: Wed Jun 03, 2020 11:32 pm
Contact:

Re: Nürburgring - a new track for Revs (testers wanted!)

Post by aidanthegasman »

Amazing.
I was always in awe of people who could hack a game to (say) give infinite lives, but this is much more subtle.
Thanks again for your replies.
Post Reply

Return to “miscellaneous new bbc and electron games”