Stunt Racer 2000 frame rate

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

Related forum: adventures


sirbod
Posts: 567
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: 302
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: 302
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: 567
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: 302
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: 567
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: 302
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: 567
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: 302
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: 567
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: 567
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: 302
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: 567
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.


Return to “software”

Who is online

Users browsing this forum: No registered users and 1 guest