This is a video of the version described in the last post..
Monday, 19 January 2009
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.
Saturday, 8 November 2008
Updated handling & track
Ok this version has a lot of updates:
- steering is mapped to joystick's first axis... this is being tested on a psx controller + tigergame usb adapter untill we can do "configs", since that's about as close to a "standard" as we're going to get for now. I'm still having some issues with getting smooth linear motion from the joystick but it's getting resolved gradually. Currently it seems to go in steps but that could be I need to poll the sensor more frequently or something. It does have the beginnings of proportional steering though which is what I was after. Hasn't been tested on the G25 yet :\
- improved the scenery..it might seem like fluff but I figured the more credible the track is the better overall picture we'll get so I tidied up some of the edges, so now we're basically on a walled-off dirt track in the centre of a giant oval. Much of the lighting and texturing is still subject to randomness, but again that's being resolved over time :)
- It also looks like the car mass was waaay to high before which is why I couldn't get the suspension to behave properly. I've since reduced this from 950 to about 300 which seems to give quite a nice "momentum" feel and decent suspension deflection without feeling sloppy. I've had the car vaguely drifting a few times but there looks to be an issue with the current setup in that when you ge thte car sideways it won't put the power down to maintain the drift.
I suspect this could be fixed by reducing the grip of the tyre at that point (loss of traction) which would mimic reality better too, but for that I need to have access to positional data of the vehicle and I haven't figured that bit out yet.
to do:
- figure out how to replace the wheel models. I tried to make the current ones pointy to help righting the car but in fact they go right through the collision detection and make the car more unstable. Solution would be some nice detailed wheels but haven't figured how to replace a mesh cleanly.
- figure out how to attach other things to the car like guns and "righting mechanisms" to flip the car back up when you land on the roof. currently the car freaks when I attach anything and applying forces to it directly doesn't work.
To test download & install blender from www.blender.nl
Download the current build from the link on the top right "download CGZ files"
unzip/rar and run the file.
Once blender's open hit P to go into game mode and there you are \o/
Current build is:
track_car_convex_1_BIGFOOT_MUTANT_11_jOYSTICK_lightercar.rar
- steering is mapped to joystick's first axis... this is being tested on a psx controller + tigergame usb adapter untill we can do "configs", since that's about as close to a "standard" as we're going to get for now. I'm still having some issues with getting smooth linear motion from the joystick but it's getting resolved gradually. Currently it seems to go in steps but that could be I need to poll the sensor more frequently or something. It does have the beginnings of proportional steering though which is what I was after. Hasn't been tested on the G25 yet :\
- improved the scenery..it might seem like fluff but I figured the more credible the track is the better overall picture we'll get so I tidied up some of the edges, so now we're basically on a walled-off dirt track in the centre of a giant oval. Much of the lighting and texturing is still subject to randomness, but again that's being resolved over time :)
- It also looks like the car mass was waaay to high before which is why I couldn't get the suspension to behave properly. I've since reduced this from 950 to about 300 which seems to give quite a nice "momentum" feel and decent suspension deflection without feeling sloppy. I've had the car vaguely drifting a few times but there looks to be an issue with the current setup in that when you ge thte car sideways it won't put the power down to maintain the drift.
I suspect this could be fixed by reducing the grip of the tyre at that point (loss of traction) which would mimic reality better too, but for that I need to have access to positional data of the vehicle and I haven't figured that bit out yet.
to do:
- figure out how to replace the wheel models. I tried to make the current ones pointy to help righting the car but in fact they go right through the collision detection and make the car more unstable. Solution would be some nice detailed wheels but haven't figured how to replace a mesh cleanly.
- figure out how to attach other things to the car like guns and "righting mechanisms" to flip the car back up when you land on the roof. currently the car freaks when I attach anything and applying forces to it directly doesn't work.
To test download & install blender from www.blender.nl
Download the current build from the link on the top right "download CGZ files"
unzip/rar and run the file.
Once blender's open hit P to go into game mode and there you are \o/
Current build is:
track_car_convex_1_BIGFOOT_MUTANT_11_jOYSTICK_lightercar.rar
Sunday, 2 November 2008
Merged tests
ok managed to get something like the best of both worlds, same url as below, file is
track_car_convex_1_BIGFOOT_MUTANT_8_jOYSTICK.rar
- now runs with a joystick, still only digital controls and the button assignments may not be the same
- offroad oval with some texturing
- quite reasonable handling (using convex polytope)
Updated test environments..
there seem to be two routes with this, one using a bounding box for the car collisions and the other using convex hull polytope and they give quite different results.
I've been exploring both paths at the same time and have made a number of amendments to the powertrain script:
- improved ebrake
- added "nos" (n key) - steering's hardly possible under full power and currently we're on keys so this allows a degree of stepping
- added some basic differential functionality which varies the power distribution on inside and outside wheel during cornering. Once I've figured out how to get the rotation speeds of the wheels and the velocity of the vehicle I can can set up a similar sort of power distribution thing like in the nissan skyline.
the file you want is track_and_bigfoot... oh yes there's monster trucks :)
proposed test systems to get something networked
(this list will be completed later, i want to try and run something...)
In order of steev preference:
blender + ogre3d + pygame
blender + ogre3d + raknet
blender + ogre3d + tnl
(not sure if ogre3d is needed or pygame)
blender + torque3d + xxx
blender (bge) + python sockets
In order of steev preference:
blender + ogre3d + pygame
blender + ogre3d + raknet
blender + ogre3d + tnl
(not sure if ogre3d is needed or pygame)
blender + torque3d + xxx
blender (bge) + python sockets
This is and updated test scenario with higher gravity (2x9.8) - makes the car handle much nicer, front doesn't lift of anymore now, handles not far off gta or twisted metal black imho.
I've made a nicer oval track and am working on a decent skybox both currently as external files.
I'm using the vehicle setup made in a tutorial here:
I basically just expanded the test environment a bit and have been playing with the car physics to try and get the sort of handling I'm aiming for. W/S = forward backwards, left/right cursor for steering and possibly space for handbrake.
I'm stil working on the terrain-generation from google maps...looks promising but noting I'm particularly happy with yet. I'm hoping we can use the original image as a coloured texture over the displaced, desaturated version.
On a side note - I wonder if we can use yahoo pipes to handle some of the realtime data-gathering?
Subscribe to:
Posts (Atom)