I thought I’d share a little bit about motorcycle physics in Road Redemption.Even if you’ve never taken a physics course, you still might find this interesting.
Have you ever wondered why leaning, while riding on a motorcycle, makes it turn? Clearly turning the handlebars, which rotate the motorcycle’s front tire, should change the motorcycle’s heading. But why does tilting the bike frame have the same effect? This had me puzzled for a while. If I’m leaning left, but both tires are still facing forward, why should the bike TURN to the left? Shouldn’t it just keep moving forward in a straight line? What’s going on?
It’s actually quite simple and is due to the shape of a motorcycle’s tire. We tend to think of motorcycle tires as having the shape of a thick slice of a cucumber, with the edges being completely flat. Indeed, if this were the case, you would NOT be able to turn that bike by leaning.
In reality, motorcycle tires are shaped like the image above. As you can see, the tire is tapered. Its circumference is larger in the center (red line) and smaller on the sides (blue line). This is important.
Imagine we’re riding our motorcycle and we lean to the left. This has the effect of making the left edge of the tire come in contact with the road. So every time the tire makes a rotation, its center (large circumference) covers more ground than its left edge (small circumference).
Hence, the entire bike actually ends up turning to the left even though both tires are still facing forward.
So that’s why you turn left when you lean left.
So how does this affect Road Redemption?
Basically it doesn’t. We’re using the Unity engine wheel colliders for our tires, which are shaped more like the cucumber slice tire. Of course, these colliders are invisible so the tires you see in the game still LOOK like actual motorcycle tires.
We chose to go this route, rather than create our own custom wheel collider, because the Unity wheel collider is great for so many other things, and honestly, it wouldn’t be worth the added strain on the CPU to simulate this kind of thing realistically anyway.
I can’t imagine that any videogame bothers to accurately simulate the physics of a motorcycle tire, since you can achieve the exact same result from faking it, with less work on the CPU.
So in Road Redemption, when your biker leans left, his bike turns left, but it’s the rotation of the handlebars/front tire that actually make this happen.
This is just one of the many physics manipulations we do to make driving in Road Redemption feel “right”, which I’ll talk about in future posts.
The Road Rash Series does this all the time. Don’t believe me? Well, in the most popular iterations of the Road Rash series (Sega Genesis/Megadrive, Sega CD, 3dO, and the first title on PS1) you can’t actually TURN your bike at all!
You can only strafe, right and left, along the bottom of the screen. The game gives you the illusion that you’re turning. In fact, if you hold the accelerator, and let go of the steering controls, the game world will actually turn, on its own, under your tires!
Funny how what’s fun and what’s realistic can often be at such odds.