Race games - how is it done?

The place for codemasters or beginners to talk about programming any language for the Spectrum.
Bizzley
Dizzy
Posts: 59
Joined: Thu Nov 16, 2017 10:47 am

Re: Race games - how is it done?

Post by Bizzley » Thu Jul 05, 2018 4:29 pm

spectron wrote:
Thu Jul 05, 2018 1:57 pm
This is sort of how it was done for Gameboy road rash.
I coded a similar thing for a Gameboy version of Formula 1 for Psygnosis that never progressed past the proof of concept stage. They wanted to see a working 3D road so I used the HBLANK method to slide individual lines into curves etc. I've got a compiled version on a development cart somewhere as well as the source code and it is a really quick and easy way to get an into-the-screen road up and running. To save on in-game processing time I pre-calculated a selection of straights, curves, chicanes etc. at varying degress and built a complete track out of those sections held in tables.

I told Psygnosis that if they wanted to see more details like dips, hills, trackside objects, other cars etc. then they'd have to pay actual money but it never got any further - for "political" reasons it didn't get a green light - but it was a fun thing to code up I remember.
6 x

spectron
Berk
Posts: 20
Joined: Thu Mar 29, 2018 2:27 pm

Re: Race games - how is it done?

Post by spectron » Fri Jul 06, 2018 1:32 pm

Bizzley wrote:
Thu Jul 05, 2018 4:29 pm

I told Psygnosis that if they wanted to see more details like dips, hills, trackside objects, other cars etc. then they'd have to pay actual money but it never got any further - for "political" reasons it didn't get a green light - but it was a fun thing to code up I remember.
It was indeed fun and hills were just a case of taking that extra step of altering VBLANK as well as HBLANK to give the impression of going up and down. It's the sort of thing most of us would have stumbled upon back then given the freedom of experimenting; luckily we were given that time to mess.
0 x

Ralf
Manic Miner
Posts: 904
Joined: Mon Nov 13, 2017 11:59 am
Location: Poland

Re: Race games - how is it done?

Post by Ralf » Tue Aug 07, 2018 10:05 am

@R-Tape , did you made any progress with racing game engines? ;)
0 x

Joefish
Manic Miner
Posts: 332
Joined: Tue Nov 14, 2017 10:26 am

Re: Race games - how is it done?

Post by Joefish » Tue Aug 07, 2018 11:00 am

If you've ever seen Electraglide on an 8-bit Atari it looks absolutely stunning, with a colourful fast-running road leading to the horizon.
But really it's just a flat picture of a triangular road. The road moving is done by colour-swapping on alternate lines, and the curves are done by scroll-shifting individual pixel rows left and right. And that' all it can do. When objects appear you can see they're crude geometric shapes made of hugely upscaled sprite pixels; it's simply impossible to make it do a racing game with rival detailed vehicle graphics on the track with anything like that slick frame rate.

To do the same on the Spectrum means the hard graft and pre-shifted data to re-draw all the lines of the screen scrolled to different positions horizontally, and re-distributed vertically to make hills, but then you can draw it however you like and add whatever sprites you want. It would be neat to combine a racing game with a multicolour engine to do the roadside strips in colour, but it would take some very clever coding to use the processing time in the wait-periods productively.
0 x

User avatar
R-Tape
Site Admin
Posts: 1774
Joined: Thu Nov 09, 2017 11:46 am

Re: Race games - how is it done?

Post by R-Tape » Tue Aug 07, 2018 6:39 pm

Ralf wrote:
Tue Aug 07, 2018 10:05 am
@R-Tape , did you made any progress with racing game engines? ;)
Not yet, I find this quite hard to understand but I just need to set a some time aside with a cold flannel on my head to think it through.

However, current priorities are a laptop free holiday and then finish Bean Brothers!
0 x

User avatar
Vampyre
Dizzy
Posts: 57
Joined: Wed Nov 15, 2017 2:51 pm

Re: Race games - how is it done?

Post by Vampyre » Wed Aug 08, 2018 9:28 am

Joefish wrote:
Tue Aug 07, 2018 11:00 am
If you've ever seen Electraglide on an 8-bit Atari it looks absolutely stunning, with a colourful fast-running road leading to the horizon.
But really it's just a flat picture of a triangular road. The road moving is done by colour-swapping on alternate lines, and the curves are done by scroll-shifting individual pixel rows left and right. And that' all it can do. When objects appear you can see they're crude geometric shapes made of hugely upscaled sprite pixels; it's simply impossible to make it do a racing game with rival detailed vehicle graphics on the track with anything like that slick frame rate.

To do the same on the Spectrum means the hard graft and pre-shifted data to re-draw all the lines of the screen scrolled to different positions horizontally, and re-distributed vertically to make hills, but then you can draw it however you like and add whatever sprites you want. It would be neat to combine a racing game with a multicolour engine to do the roadside strips in colour, but it would take some very clever coding to use the processing time in the wait-periods productively.
I'd never heard of Electraglide before but just seen a vid on YT. That is superbly smooth for an 8-bit game.
0 x

Ralf
Manic Miner
Posts: 904
Joined: Mon Nov 13, 2017 11:59 am
Location: Poland

Re: Race games - how is it done?

Post by Ralf » Wed Aug 08, 2018 10:43 am

I've just had a look on Electraglide too.

Yes, very smooth movement but ultimately boring. No other cars, no hills, very sparse scenery.

Now, Chase H.Q. on Spectrum on the other hand... ;)
0 x

Dr beep
Berk
Posts: 2
Joined: Mon Oct 01, 2018 7:53 pm

Re: Race games - how is it done?

Post by Dr beep » Mon Oct 01, 2018 7:58 pm

Here is a pseudo 3D racing game coded for the ZX81 in just 1K and a hires way.



The game is based on the same track coded for the ZX Spectrum in Grandpr1x, also just 1K of code, but on the ZX Spectrum you have more memory available.
0 x

Post Reply