Thanks for all of the great input guys. Again, really appreciated! Sorry for the long post, but I’m having a blast developing this vehicle =-)
Map one will definately be pretty flat with some basic in game tutorial stuff to build offroad driving skills. I was thinking that I’d have some low poly NPC’s (funny looking “redneck rampage” type characters…) at each of the spotter cams that yell out a piece of advice (or an insult when nearing the next obstacle. Checkpoints and markers for the course, a finish line with a parking target to trigger the next level.
I’m not a big fan of time limits, but I’ll probably add a highscore type time recorder to each level, and maybe a qualifying time limit after 2 or three levels.
As for the physics…
One of the big problems is emulating the huge gear reduction in a real rockcrawler. Usually they can only go 3 or 4 miles an hour, but have enormous torque ("granny low "gears…) for crawling over obstacles.
The large torque values on the wheels allow the model to go too fast for the sim, but are necessary for getting over the obstacles. I suppose that at some point I’ll have to dig into the blender and bullet API’s and start adding some python to regulate the vehicle speed.
Using keyboard controls for now is pretty limiting too… A throttle indicator that increments with each tap, and a brake button that sets the throttle back to 0 may help.
Quick note… The “brakes” actually add .01 AngV forward. Useful for descending rock faces slowly, but could be causing some issues when stuck…
Usually the model misbehaves under power when one piece of it gets stuck. The front axle has a tendency to do something that real rockcrawlers do. It’s called spring/axle wrap. When the power to the wheels is great enough, and the wheel is stuck, it can rotate the axle and wrap the spring around it. When all of that force releases, the vehicle goes orbital. In real life the same can happen with really scary similar results. More often however the spring snaps with the sound of a cannon (something I can’t really emulate yet… I think that the “square” edges of the wheels are contributing to the problem. I’ve been meaning to mess with that, but the mesh is only part of the issue. The bounding box for a cylinder has square edges too… I’ll also try changing the ball constraints for the springs to hinges. That should remove some of the lateral play that lets the axles hit the steering knuckles when on an off-camber slope.
I’m working on adding a constraint that would emulate something called a “ladder bar”. It’s designed to stop axle wrap in high horsepower applications, but it’s not always used on rockcrawlers because it can limit all of that nice Z axis wheel travel that helps the wheels find things to grab onto.
As for the backup bobbling, the axle and knuckles are rotated -3 degrees. The tires are toed in by several degrees to help center the steering when driving forward on a flat surface, and to add grip when the front end is loose (say on a rock face…). The geometry was meant to emulate the caster/camber angles in a real front end. It makes a big difference driving around in the rough, and reduces the tendancy for the wheels to catch on something and slap in the opposite direction of where your steering. I don’t want to completely eliminate that effect as it also happens in real life. Rule #1 of offroad driving is “Never wrap your thumbs around the steering wheel”. Broken thumbs are not at all uncommon… I would like to reduce it some however (power steering vs manual as a vehicle upgrade in later levels.)
Unfortunately the caster/camber settings have the opposite effect under power in reverse. I’ll keep toying with it. I’ve had some success reducing the bobble with constraints from the frame to knuckles, but again, it cuts the wheel travel (along Z) way down. I’ve played with rotational damping, but it doesn’t seem to have much effect.
There are still some wheel/frame bounding box collisions that cause odd unnatural behavior too (hence the two piece frame for a smaller bounding box in the front.)
I should have a better behaved .blend on it’s way tomorrow. I’ll work on it this eve.
I’ve started jotting down notes for a tutorial here. I’ll rebuild the model from scratch with a flat featureless map and take screenies along the way when I have some time.