This is a little scaled-sprite 3D graphics engine inspired by the old classic game Power Drift.
Still work in progress. Needs some basic game-play rules (laps, win/lose etc) and some difficulty balancing. But it's playable.
- Fixed bug in saving tracks to external cart.
- Added a little bit of steering assist to help line up the jumps.
- Some other tweaks I forget :)
- 2 tracks
- Track selector
- Trees generate in the same place
- New track
- (Slightly) better physics/collisions
- Finish line and corner signs
- New larger test track
- Performance optimisations. LOD system. More aggressive view volume culling
- Tweaked the steering
- More performance tweaks
- More performance tweaks, thanks to @freds72
- Updated physics to support driving upside down!
- New track with loop-the-loop (to test driving upside down :)
- AI cars. WIP. No collisions yet. Difficulty will probably be scaled down a bit eventually.
- Moved editor to separate cart.
- I tried to draw a palm tree.
- Different AI car colours.
- Fixed flip-Y logic when AI cars are upside down.
- Basic car collisions
- AI cars now steer around each other (and you)
- Cockpit graphics with animated front wheels.
- Main menu
- Race start sequence
- Fix wheel animation when frame rate <30
- Fix NPC cars getting stuck on hills
- Lap and position displayed on screen
- Race finishes after 5 laps
- Note: Difficulty level logic is not hooked up yet!
- Hook up difficulty levels
- First attempt at engine sounds
- "Ramps" logo :)
Not for the faint of heart :)
Still has some CPU issues. The main bottleneck is sorting the billboards from back to front. It's currently just using an insertion sort - which actually works pretty well most of the time, because the data is mostly sorted from the previous frame - but every now and then the camera turns far enough to flip a bunch of billboards into different order and the sort alg struggles.
For sort performance, have a look at radix sort. I forked a version from James: https://twitter.com/fsouchu/status/1212352497865674752?s=21
(might need a fix - can’t check atm)
Other than that, what about rendering road sprites as rectfill (with proper color) above a certain distance?
Or reducing track precision at distance?
@freds72 thanks, I'll give that a go. I tried a pivot sort before but couldn't get it fast enough.
@dw817 stunt car racer had a cool wreck system too. It all depends on having enough tokens though. I'm starting to consider having a separate track editor cart and game cart to fit it all in.
@freds72 looks quite clean actually.
I tried a version that was just rectfills, and found that if I also disable the sorting the CPU stays under 100% all the way around the track. (Although without the sorting it does strange things to my brain..). I think the sort is still the bottleneck right now.
Try to stop thinking in degrees and think in turns instead. Not only does it suit PICO-8's API better, but it's often a much more convenient way to express angles, since the angle in turns is just the number you slap in front of τ (or 2π) to send to trig functions on big-boy platforms. But mainly you want to eliminate all of the multiplying and dividing by 360, 180, 90, and other non-power-of-2 numbers.
Maybe round off the top/outside corners of your road chunks. You already round off the ramps a bit. It'll help the road look less blocky.
- Try a somewhat-wider FoV. It's discouragingly-hard to see what's coming around corners with the narrow p8 screen
[Please log in to post a comment]