Stunt Racer 2000 frame rate

chat about arc/risc pc gaming & RISC OS software here (NOT the core OS!)

Related forum: adventures


sirbod
Posts: 663
Joined: Mon Apr 09, 2012 8:44 am
Location: Essex
Contact:

Stunt Racer 2000 frame rate

Postby sirbod » Wed Mar 15, 2017 8:07 am

I recently did a recording of the StrongARM release of Stunt Racer 2000 running on the Pi and what quickly becomes apparent is how unplayable it is, due to its low frame rate. As with many of the early games, the frame rate is artificially restricted to a rate the 8Mhz ARM2 was capable of, which in this case is 12.5fps.

Last night, I had a look through my FedNet source code, which does include the uncompressed BASIC code, but to my dismay none of the machine code source. If I had the source, I could probably change the speed of cars and time, so the frame rate could be increased to 50fps.

Failing that, I removed the FPS cap - which incidentally counts 4 ticks of OS_Byte 176 (the so called "50hz ticker", but is actually a decrementing counter based on VSync), predictably the game ran way too fast, although did look very smooth. The in-game time is also hardcoded for 12.5fps, so cars were putting in 15 second lap times!

Getting to the point of my post, is anyone aware of any patches to Stunt Racer 2000 to improve the FPS?

User avatar
vanpeebles
Posts: 376
Joined: Wed Nov 28, 2012 10:01 am
Location: UK
Contact:

Re: Stunt Racer 2000 frame rate

Postby vanpeebles » Wed Mar 15, 2017 10:56 am

That sounds strange as I thought it was too fast on the A5000 compared to playing it on the A3010. I'm sure in the options it told you what ARM it was running.

User avatar
vanpeebles
Posts: 376
Joined: Wed Nov 28, 2012 10:01 am
Location: UK
Contact:

Re: Stunt Racer 2000 frame rate

Postby vanpeebles » Wed Mar 15, 2017 11:00 am

https://www.youtube.com/watch?v=7MvsOYIJRxI

That was on a real A5000 and split screen. I wish I had kept that 33mhz A5000 it was a proper beast.

sirbod
Posts: 663
Joined: Mon Apr 09, 2012 8:44 am
Location: Essex
Contact:

Re: Stunt Racer 2000 frame rate

Postby sirbod » Wed Mar 15, 2017 3:45 pm

vanpeebles wrote:That sounds strange as I thought it was too fast on the A5000 compared to playing it on the A3010. I'm sure in the options it told you what ARM it was running.

As noted in the OP, the game timing is linked to the 50Hz ticker, so a faster monitor refresh rate would cause the game to speed up. I'm not sure why that was never fixed as there were three releases of the game, the original (1993), RiscPC (1994) and StrongARM (1997).

vanpeebles wrote:That was on a real A5000 and split screen. I wish I had kept that 33mhz A5000 it was a proper beast.

You can tell by the timing clock it's running too fast, although probably more playable at that refresh rate.

User avatar
vanpeebles
Posts: 376
Joined: Wed Nov 28, 2012 10:01 am
Location: UK
Contact:

Re: Stunt Racer 2000 frame rate

Postby vanpeebles » Fri Mar 17, 2017 7:53 am

Ah!!! :)

David1664
Posts: 51
Joined: Thu Feb 25, 2010 2:24 am

Re: Stunt Racer 2000 frame rate

Postby David1664 » Sun Mar 19, 2017 7:33 pm

Are there any technical reasons why the author(s) of SR2000 couldn't have made the game frame-rate independent - using delta time, integration or whatnot? I know this tends to lead to very variable frame rates from one moment to the next, but at least objects appear to move at the same speed regardless (smoothly on fast machines, less smoothly on slower, but nevertheless the same apparent speed).

sirbod
Posts: 663
Joined: Mon Apr 09, 2012 8:44 am
Location: Essex
Contact:

Re: Stunt Racer 2000 frame rate

Postby sirbod » Mon Mar 20, 2017 12:24 pm

David1664 wrote:Are there any technical reasons why the author(s) of SR2000 couldn't have made the game frame-rate independent

No. I believe it was developed on an ARM250 and developers quite often didn't cater for ARM chips getting faster back then.

I'm not aware of any games that regulate in game assets based on the frame rate. SR2000 isn't alone, other examples are Conqueror and E-Type (12.5fps) and Formula Fun (7 fps) with the majority of 3D games being 25fps, I'm not aware of any that support 50fps.

Some games didn't even cap their frame rate, so Zarch for example, runs at 800+fps on a Pi!

On the good news front, I have found two copies of the source code, so will see if they can produce the final code and be updated to support a faster refresh rate.

User avatar
vanpeebles
Posts: 376
Joined: Wed Nov 28, 2012 10:01 am
Location: UK
Contact:

Re: Stunt Racer 2000 frame rate

Postby vanpeebles » Mon Mar 20, 2017 2:07 pm

Oooo I'd love a special version :)

sirbod
Posts: 663
Joined: Mon Apr 09, 2012 8:44 am
Location: Essex
Contact:

Re: Stunt Racer 2000 frame rate

Postby sirbod » Mon Mar 20, 2017 3:21 pm

vanpeebles wrote:Oooo I'd love a special version :)

I've got it running at 50fps on the Pi by lowering the steering and the car movement, although its unplayable due to knock on side effects. I've yet to look at gravity and there's also mention of balls, hammers and other things that probably need adjusting. It looks like its all based on hardcoded ASR #<value> so I've simply adjusted the shift value to match the x4 frame rate increase.

I think Andrew Hutchings or Tim Parry suffer Tourettes. I've counted 31 f**ks, 2 tw*ts, 4 sh*ts and 2 wan**rs in the car_code source alone :lol:

User avatar
vanpeebles
Posts: 376
Joined: Wed Nov 28, 2012 10:01 am
Location: UK
Contact:

Re: Stunt Racer 2000 frame rate

Postby vanpeebles » Mon Mar 20, 2017 3:25 pm

:lol:

sirbod
Posts: 663
Joined: Mon Apr 09, 2012 8:44 am
Location: Essex
Contact:

Re: Stunt Racer 2000 frame rate

Postby sirbod » Mon Mar 20, 2017 6:17 pm

It looks the source code I have is probably an early test build, so I can't just recompile it and drop it in the main game. I have however compared the assembler with the SA version, to find the relevant code in the game itself and patch it.

I've managed to locate and patch:
  • Cornering glue (that's what its called in the game, in reality its downforce)
  • Gravity
  • Movement
  • Flying/Skidding X axis rotation (ie the front dropping due to weight distribution)
What I've not located, as its not in the source, is the clock and recording playback. I have a horrible feeling the recording playback is based on the frame, instead of time, which will make recordings four times bigger and not backward/forward compatible.

The source code itself isn't actually that useful as there's next to no documentation in it and it's full of fixed immediates, instead of variables. I've had to tinker with an instruction that looks promising, run it, see what changed, undo it and tinker with something else until it changes for the better!

Oh well, it was a fun exercise.

sirbod
Posts: 663
Joined: Mon Apr 09, 2012 8:44 am
Location: Essex
Contact:

Re: Stunt Racer 2000 frame rate

Postby sirbod » Thu Apr 27, 2017 4:34 pm

I've put up a short video showing the changes made and what it runs like at 50fps.

User avatar
vanpeebles
Posts: 376
Joined: Wed Nov 28, 2012 10:01 am
Location: UK
Contact:

Re: Stunt Racer 2000 frame rate

Postby vanpeebles » Mon May 08, 2017 9:23 am

Looks good, how did it play?? :D

sirbod
Posts: 663
Joined: Mon Apr 09, 2012 8:44 am
Location: Essex
Contact:

Re: Stunt Racer 2000 frame rate

Postby sirbod » Mon May 08, 2017 12:52 pm

vanpeebles wrote:Looks good, how did it play?? :D

Aside from the over-the-top bumps, it appears to be easier to control with a higher frame rate. Until I fix the recording and time, its hard to tell if this help to improve laptimes.

Trapper
Posts: 131
Joined: Tue Apr 21, 2015 11:59 am

Re: Stunt Racer 2000 frame rate

Postby Trapper » Tue Oct 31, 2017 2:17 am

Does anyone know where to get the RISC PC SA version?

My original just crashes on my RISC PC using !StrongGuard and trying ADFFS

sirbod
Posts: 663
Joined: Mon Apr 09, 2012 8:44 am
Location: Essex
Contact:

Re: Stunt Racer 2000 frame rate

Postby sirbod » Thu Nov 02, 2017 9:06 am

Trapper wrote:My original just crashes on my RISC PC using !StrongGuard and trying ADFFS

I'll attempt to fix ADFFS for the 2.63 release, looks like it's not worked for a while as I've tried going back a few builds and it does the same thing on all of them.

sirbod
Posts: 663
Joined: Mon Apr 09, 2012 8:44 am
Location: Essex
Contact:

Re: Stunt Racer 2000 frame rate

Postby sirbod » Fri Nov 03, 2017 10:50 pm

sirbod wrote:
Trapper wrote:My original just crashes on my RISC PC using !StrongGuard and trying ADFFS

I'll attempt to fix ADFFS for the 2.63 release, looks like it's not worked for a while as I've tried going back a few builds and it does the same thing on all of them.

Reading my notes, this version (I'm assuming you have the RO3.1 release and not the RPC version) has never worked on a RiscPC, I was confusing it with the RPC version.

I've investigated today and its highlighted three bugs in ADFFS and an issue in Stunt Racer 2000, so thanks for pointing out the problem. The reason the RO3.1 version doesn't work under ADFFS (and possibly also StrongGuard) on a RiscPC is due to the game setting an invalid VDSL/VDER during the intro sequence; this causes the machine to lock solid, possibly due to a race condition of VSync IRQ's.

After fixing these four issues I have it running under emulation and from the commandline on physical ARM710 / StrongARM, however there's further issues to investigate: When installed to HD and run on physical StrongARM it prompts for disc 2 and both ARM710 and StrongARM hang on the intro when its run under the WIMP.

Trapper
Posts: 131
Joined: Tue Apr 21, 2015 11:59 am

Re: Stunt Racer 2000 frame rate

Postby Trapper » Sun Nov 05, 2017 10:08 pm

Hi Jon,

I've found I have three distinct versions of Stunt Racer 2000! I've got so many archives and disc images that I've collected over the years a lot of them aren't well titled.

I have v1.00 on my original pukka floppy discs. This doesn't work on my RISC PC at all.

I have v1.10 on ADF images from <somewhere>. This loads on my RISC PC with StrongGuard and the updated !Run from ADFFS

and I have the RISC PC StrongARM version - nicely patched and works out of the box. Interestingly the copy protection has been removed from this version (the 4th Dimension date/time file is set as 1997 rather than 1994 on the original). I was able to copy this to remove protection on the earlier versions - I do have the 4D disc protection BASIC file, but it never worked on Stunt or Birds of War.

sirbod
Posts: 663
Joined: Mon Apr 09, 2012 8:44 am
Location: Essex
Contact:

Re: Stunt Racer 2000 frame rate

Postby sirbod » Sun Nov 05, 2017 10:47 pm

Trapper wrote:I've found I have three distinct versions of Stunt Racer 2000!

There were three releases:
  • The original two disc release (14-09-93) which has file encryption and a crack prevention Module
  • The RiscPC version (24-11-94) that came on a single disc without file encryption and anti-crack Module
  • The StrongARM version (25-10-97) that was identical to the RiscPC version, with a few tweeks for SA compatibility
If I remember correctly, the RPC/SA versions have to be installed to HD to work due to a bug in the disc detection.
Trapper wrote:I have v1.00 on my original pukka floppy discs. This doesn't work on my RISC PC at all.

It's the disc decryption Module that causes the issues, it's patched in the boot script when run on StrongARM onward.
sirbod wrote:When installed to HD and run on physical StrongARM it prompts for disc 2 and both ARM710 and StrongARM hang on the intro when its run under the WIMP.

I've taken a further look tonight and have fixed three signed comparison bugs to get the HD detection to work, I also have it running under the Wimp, but the mouse cursor doesn't appear on StrongARM, so I need to investigate that next to see if it's a bug in ADFFS or down to the way the game redefines the mouse cursor.


Return to “software”

Who is online

Users browsing this forum: No registered users and 1 guest