Car racing game concept, idea, want, worth a try?

Chat about anything CX16 related that doesn't fit elsewhere
Kilian Hekhuis
Posts: 24
Joined: Sun Jul 12, 2020 6:04 pm

Car racing game concept, idea, want, worth a try?

Post by Kilian Hekhuis »


The background could be tiled on the back plane, the objects sprites and the road itself in bitmap mode on the foreground plane. You could tune down the resolution a lot to speed it up (doesn't matter if it looks crude, background and sprites will look good). But what do I know, it's a long time ago that I did any kind of game programming ?.

Guybrush
Posts: 63
Joined: Fri Jul 10, 2020 10:38 pm

Car racing game concept, idea, want, worth a try?

Post by Guybrush »


You definitely don't want to draw the road in bitmap mode. Just create a fixed tile map for the road, a central perspective of the road and make it pretty wide. In the default position (road in the center, a long straight ahead) there will be some amount of horizontal scroll. Then it's just (hehe, just! ?) a matter of calculating the right scroll offset for each screen line, depending on the position on the track. For instance, if the road ahead is turning to the left, the top line of the road will have the smallest x scroll offset, with the scroll offset increasing each line until it reaches the default position at the bottom of the screen. If you're feeling particularly bold, you can also simulate terrain elevation. It's all just a matter of choosing the right line of the tile map with the right scroll. Also, you can simulate texturing either by modifying the palette on each line or (a simpler method) create multiple tile maps with different colored tiles and change the tile map per raster line. You can do all the calculations in vsync interrupt handler. Of course, this all requires a raster interrupt for each line where the road is drawn, but since you've already calculated the scroll, it's only a couple of LDA's and STA's per line.

As for the background (mountains, sky, etc.), you can use another layer, or you can reuse the same layer as for the road, you just need to switch tile maps on the right raster line.

Everything else (cars, signs, trees and bushes) should be done with sprites.

Kilian Hekhuis
Posts: 24
Joined: Sun Jul 12, 2020 6:04 pm

Car racing game concept, idea, want, worth a try?

Post by Kilian Hekhuis »

Can the VERA handle offset changes pretty scan line? You could then have a fixed offset line for every possible track line (in bitmap mode), and just select the right offset. And alternate the palette for white or red side-markings.
User avatar
StephenHorn
Posts: 565
Joined: Tue Apr 28, 2020 12:00 am
Contact:

Car racing game concept, idea, want, worth a try?

Post by StephenHorn »


There is a line IRQ feature, and you can scroll tile and text layers, which can produce the effect I believe you're describing. That said, line IRQs are broken on r37. You can build the current source code yourself, though, and get the fix.

Developer for Box16, the other X16 emulator. (Box16 on GitHub)
I also accept pull requests for x16emu, the official X16 emulator. (x16-emulator on GitHub)
Guybrush
Posts: 63
Joined: Fri Jul 10, 2020 10:38 pm

Car racing game concept, idea, want, worth a try?

Post by Guybrush »


For the demo of the technique, see this post (not mine):

https://www.facebook.com/groups/CommanderX16/?post_id=617425515675213

Kilian Hekhuis
Posts: 24
Joined: Sun Jul 12, 2020 6:04 pm

Car racing game concept, idea, want, worth a try?

Post by Kilian Hekhuis »

Mmm, that link doesn't seem to open...
Guybrush
Posts: 63
Joined: Fri Jul 10, 2020 10:38 pm

Car racing game concept, idea, want, worth a try?

Post by Guybrush »


Hmmm... are you a member of the Commander X16 group on facebook?

Kilian Hekhuis
Posts: 24
Joined: Sun Jul 12, 2020 6:04 pm

Car racing game concept, idea, want, worth a try?

Post by Kilian Hekhuis »

Yup, but the link just goes to the group main page. I'll try on my pc (on phone now).
User avatar
DusanStrakl
Posts: 127
Joined: Sun Apr 26, 2020 9:15 pm
Location: Bay Area, California
Contact:

Car racing game concept, idea, want, worth a try?

Post by DusanStrakl »


Interesting project. I was actually thinking about putting it on my list of possible future projects but unfortunately that list is way too big already especially considering available free time ?

Considering that sending data to VERA can be a bottleneck some sort of hybrid solution of tile background with hardware scrolling and bitmap road with bending by using scan line shifting might work and leave enough CPU time for manipulating animated sprites that could be used for everything else.

Keep us updated and good luck!

 

Fenner Machine
Posts: 68
Joined: Tue Jul 28, 2020 8:30 pm

Car racing game concept, idea, want, worth a try?

Post by Fenner Machine »


I’ve made some placeholder/concept art.


I’ve made it in a way to easily encode it and test effects.


Also learning pixel art and animation.


This is a scene with several elements merged.


image.png.61b22add028996e2932f6fdc81415108.png

 

Post Reply