Terrain Rider: Physics Based Mountain Bike Game

og

Hey all - I’ve been working on Terrain Rider, a physics-based mountain biking game that runs in the browser.

It’s built with Three.js / React Three Fiber and Rapier, with procedural terrain, bike customization, timed trails, chairlifts, weather changes, and some very unforgiving ragdoll crashes!

Still tuning the riding feel and adding more trails, so I’d love to hear what you think.

Play it here: https://terrainrider.com/

6 Likes

It was fun, the feeling is OK. Maybe a bit too stable – I zigzagged and it still kept recovering balance and riding. The graphics is OK. At some point the scene froze, then became black with “recursive use of object” error message.

1 Like

Amazing! Right from the first few seconds, we can see it’s a great game! The physics of the player falling is very realistic and very funny at the same time. Congrats!

1 Like

thanks for the feedback - I haven’t seen that bug but I will investigate. sounds like rapier.

as for stability - it’s a real balancing act (so to speak)! since I’m trying to keep it purely physics based without baking/scripting animations it means some amount of auto steering is necessary (it would be nearly impossible to balance otherwise). currently it uses a pd controller to adjust steering while you ride, and balance is an emergent property of steering and lean as it is in the real world. finding the sweet spot is not easy. you’ll notice that it is very hard to crash on perfectly level ground, but if you get into the mountains and ride some trails you may find the opposite. anyway, I’ll keep tuning to try and get it more realistic. one of my main reasons for building this game was that other bike games never seem to use real physics, but I think it can be done.

1 Like

In case it would help, here is a snapshot of the screen with the console:

image

1 Like

was this happening on the valley xc trail by chance? if so, should be fixed now.

1 Like

made a full round, no browser crash

beauty - thanks for the help debugging. turned out to be a bug in @react-three/rapier - issue opened.

1 Like

This is REALLY cool :rofl:

As an E-MTB Rider myself I REALLY enjoyed scratching your project just barely. It took me several “crashed” states to finally get a hold on the ASWD controls :roll_eyes:

Great game play, and I especially love the “spinning out” of the the rear wheel after crashing :rofl:

Thumbs up for the implemenation and idea of this application

2 Likes

thanks for the feedback and playtest! if you’ve got an old Xbox controller or similar it plays a lot better than WASD as you can vary your steering/lean inputs.

Wow, this is awesome. I’m pretty new to Three.js, so I’m really impressed by how smooth it feels.

A couple questions:

  1. What helped the most with keeping the FPS high?
  2. Did the procedural terrain or physics cause any major performance issues?

super cool! How do you get up?

FPS is largely a product of hardware, and since this game is fairly heavy overall I decided to create graphic quality tiers with an auto detected quality by default that adjusts things like resolution, shadows, textures, terrain lod, grass density, wind particles, fog, among other things. I also exposed the quality tiers in the pause menu though so you can play around to find a setting that works best. the procedural terrain itself is fairly light-weight. just basic noise for the most part. I have been playing with some more realistic terrain generation though that I might add which will be a bit heavier. I might offload that to a server though.

1 Like

thanks - hit r on your keyboard, or B on gamepad. if you haven’t crashed already, it will ragdoll you. fun for throwing yourself off mountains etc