Motorbike tech-demo and tutorial
Total Trackbacks 0
Awesome, first good bike in RoR! Great workSo... erm, yeah.
This started as a proof of concept a few months ago and I was very surprised when it actually worked.
Inspired by "This is RoR, everything is possible (except Motorbikes)" - Nadeox1 and with some discussion with Creak, I decided to work on it a bit more.
This is what I have learned, and there is no point keeping it to myself.
The concept and explaination;
Motorbikes are counter-intuitive, to turn left, you must steer right a little first and vice-versa. It is because of this that the player cannot control the steering directly (with hydros) because the response time is too long and there is no feedback like when you ride a bicycle. So you must use animators and the "roll" option. This is what we use to turn the front wheel.
The roll means the angle between the camera plane and the ground plane, so you can adjust it buy rotating the camera. This is the main way of controlling the bike, you essentialy trick the bike into thinking its falling onto one side and it will always try to be level. In other words, you're not steering, just controlling the lean angle.
A shiny picture to adhere to people with short attention spans;
Due to RoR I didnt bother trying to get my bike too light, It wasn't a key issue.
The bike I have provided is sort of a low geared, lightweight racing bike, enough power to pop a wheelie in first gear if you drop the clutch but will top out at about 200kph.
Should be quite stiff with high damping to stop the bike bouncing and jigglying around. Any shaking is bad for the stabilization and control.
The wheels should be as thin as possible and be made very stiff to stop flexing. I added a snode out to the side for both front and back wheels to stop them form flexing so much.
I cheated and increase the grip for both wheels, because RoR is designed for heavy trucks.
Was inserted before the wheels section, stops wheel spin and although drifting in the bike was amazing, it wasn't good for control or corneringCode:set_node_defaults -1, 3, -1, -1
The steering assembly is able to move up and down with the suspension on slide nodes and controls the balance of the bike.
There are four animators that form a sort to diamond shape they are defined something like this;
Note how the short and long limit are quite small, you don't need a large number because the castor angle on the front wheel helps the bike turn when it is in a lean.Code:29, 34, 1, roll | shortlimit: 0.15 | longlimit: 0.15
You can control the lean angle of the bike by controlling the lean angle of the camera, and you do this using hydros. I recommend trying about 20 deg then gradually increasing until a balance between control and stability is found. Offroad bikes should have less because of lower grip.
I made the brakes quite strong
I Have used animators with the option "Parking brake", this is so when you stop just apply the parking brake and "legs" will drop down and stop the bike from falling.
To control the bike you just steer as if it were a car, but try to be gentle as sharp movements will upset the bike just like with real life.
To steer sharper, just slow down, there is a sweet spot between 30 and 60 mph were there is great handling.
To pop a wheelie, either put the bike in neutral, full revs then change to first, or better, switch to fully manual and drop the clutch.
I suspect I have missed something out, but oh well.
Thanks for reading and be sure to test the .truck file. I recommend large open maps, like that N-labs terrain or bajatrack in the screenshots.
Be sure to post your mods etc. below and well as ask for advice if you want to do your own. I may wikifi this depending on the response.
Original thread (comment there): Motorbike-tech-demo-and-tutorial