Sunday, 18 January 2009

Vehicle handling updates

This update is relatively significant in that it introduces some more advanced handling aspects.

From what I can tell blender's built-in vehicle engine doesn't cope with loss-of traction situations and based on the vehicle model/rig we started off with also seems to use a fixed diff and by default.

I've been hacking the scripts around and have introduced proportional steering i.e. the inner wheel steers more than the outer, as well as a crude differential action for when cornering (i.e. the outer wheel rotates faster than the inner wheel) which makes the handling of the car seem more natural.

It's possible to do something resembling "Kansei" drifts (i.e. the car steps out as you lift off the power) but those are the only ones which seem to work reliably at the moment because (as far as I can tell) power isn't applied when the wheels have lost traction so as soon as you try to drift using the handbrake you lose the option of applying power to the wheels so it's only with the weight-shift that it works.

I think it might be possible to set up a second set of handling rules for "loss of traction" (sideways)  situations but I haven't yet found a way of determining when the vehicle is in a loss of traction situation or it's speed etc.

One other addition is the vehicle now has a gun turret, the direction of which is controllable from the keys. It doesn't fire anything yet because I haven't sussed how to do that yet but the basis is there. Connecting anything to the car's body seems to cause it to flip out is spectacular ways (no idea why)...not sure what I did to make it work, it just started working so I left it be ;)

Also since I haven't got reliable analogue/proportional steering working properly we're back onto key-control for the time being.

Keys are roughly as follows:

left: cursor left
right cursor right
accelerate: W
brake: S
reverse: X
e-brake: space
Turret left: Q
Turret Right: E

Latest version here:

filename is: 

Currently I'm working on getting shadows working- currently the plan is that the car drops shadow shaped particles on the floor which then become visible on contact with the floow. If that works then it should mean I can do tyre tracks too, but I'm still learning how to do particles in BGE so it's early days yet. There's some good tutorials on particles in Blender Game Engine here

There's a new version of Blender out recently (2.48) and apprently has lots of updates to the game engine for the yo Frankie game, so that should help things a bit. I'm pretty sure I saw joysticks mentioned so perhaps analogue support might be an option now... which means it could work with the Logitch G25, which will allow much more thorough testing of the handling setup.

No comments: