CPCWiki forum

General Category => Programming => Topic started by: sigh on 12:01, 28 April 17

Title: Trailblazer programming
Post by: sigh on 12:01, 28 April 17
https://www.youtube.com/watch?v=AV3ElKsyTro

This looks incredibly smooth. The programming techniques used here - is it the same execution used for coding racing games?
I wonder if Martech racing games (SuperCycle/Nigel Mansell) used the same method.
Title: Re: Trailblazer programming
Post by: ||C|-|E|| on 12:44, 28 April 17
The game is very nice! I guess that the lack of sprite scaling, curves and rival cars are responsible for the smoothness that we donĀ“t see in many other titles :) There seem to be some other tricks, too. I would say that the grid is static and the program "just" changes the color of the tiles, counting the black ones as regions where there is nothing. On the other hand, the only sprite you see when playing is the little ball, I reckon that it helps as well and saves a lot of memory. In any case, great and clever game  :D
Title: Re: Trailblazer programming
Post by: Sykobee (Briggsy) on 14:12, 28 April 17
I don't think it's palette swapping - too many tiles for that.


I guess it's drawing on the differences, frame to frame.
Title: Re: Trailblazer programming
Post by: pelrun on 14:30, 28 April 17
Just like in Logon's Run, you can change the palette multiple times *during* a scanline, you're not restricted to doing it just in the horizontal blanking period.

...wait, the top section's mode 0. One palette change per scanline should be plenty.
Title: Re: Trailblazer programming
Post by: Duke on 14:51, 28 April 17
Quote from: pelrun on 14:30, 28 April 17
Just like in Logon's Run, you can change the palette multiple times *during* a scanline, you're not restricted to doing it just in the horizontal blanking period.

...wait, the top section's mode 0. One palette change per scanline should be plenty.

I would think it consists of 5 different colour static 'bars' then 5 raster changes per scanline (in the limited board area) to make the scrolling map?
Title: Re: Trailblazer programming
Post by: Axelay on 15:28, 28 April 17
Quote from: Duke on 14:51, 28 April 17
I would think it consists of 5 different colour static 'bars' then 5 raster changes per scanline (in the limited board area) to make the scrolling map?


Yes, that's exactly it.  You can see by looking at the screen ram in an emulator debugger:


[attach=2]


and you can see some of the code that would be doing the job as well, 5 colour changes:
[attach=3]


So it's perfect for what it is trying to do, but it wouldnt be so ideal for a game were you wanted to turn the track.  Although maybe you could fudge it to do that, it would probably be very crude with a limited number of steps in the turns, and likely reduce your available colours substantially.


The other thing to consider is that maintaining the colour changes for the track tiles requires about a 3rd of the screen frame, or a 1/3 of your cpu time, each and every screen refresh, so would be quite an overhead for a game with a lot of track side objects and/or cars.
Title: Re: Trailblazer programming
Post by: Sykobee (Briggsy) on 15:55, 28 April 17
Ah yeah, that's way better, using the rasters. Sometimes I forget the old games used these effectively!
Title: Re: Trailblazer programming
Post by: pelrun on 16:04, 28 April 17
Quote from: Duke on 14:51, 28 April 17
I would think it consists of 5 different colour static 'bars' then 5 raster changes per scanline (in the limited board area) to make the scrolling map?


Actually I was thinking that it was mode 1 and the bars were coloured 12321, and you just needed to change inks 1 and 2 at the midway point. But then you'd have no more inks for the ball.
Title: Re: Trailblazer programming
Post by: freemac on 20:46, 28 April 17
I confirm, fully raster based game.
Nice to calibrate rasters against falling down ball ;)
Title: Re: Trailblazer programming
Post by: Sykobee (Briggsy) on 19:51, 30 April 17
Quote from: pelrun on 16:04, 28 April 17

Actually I was thinking that it was mode 1 and the bars were coloured 12321, and you just needed to change inks 1 and 2 at the midway point. But then you'd have no more inks for the ball.


Time for a Plus conversion then :-)
Powered by SMFPacks Menu Editor Mod