4x4 vehicle game in progress.

(Sphere) #1

I made this to play with the physics engine and decided to make a rockcrawler type game out of it. Game will be open, so please no commercial use. If anyone would like to contribute maps or bodies, I’m going to continue to refine the physics and geometry and release occasional blends.

4 wheel drive with torque to each wheel, brakes, emulated rack and pinion steering, live axle style suspension.

The suspension is accomplished by pairs of constraints from the axles to the frame sections. Steering is via angv to the knuckles, and the wheels are sync’d with the tie rod.

The model was not intended to go fast, simply to crawl over the terrain at a few miles per hour.

temporarily removed all but 1st scene due to some issues. Removed cam’s for now too.

Arrows for forward, reverse, left and right.
space for brakes.
Pad+ for 4 wheel drive
Pad- for 2 wheel drive
Pad1 for 1st gear
Pad2 for 2nd gear
Pad3 for 3rd gear
H for High range
L for Low range
Space for brakes (0.01 angV) Handy for easing down slopes.

There is no scripting, uses blender’s UI for everything (including the physics stuff), so should be easy to mod…






I’ve posted a number of .blends in this thread and decided to add the new blends here from now on with date/time.

April 25 (2nd update today.) See post on last page for details.

Updated .blend is here.

(Abel) #2

looks pretty good but i get annoyed by the slow speed :S i know you don’t want it to be fast but a lil faster won’t do any bad

(Sphere) #3

I haven’t had time to reduce the poly count or clean up. I’ve been running it with enable all frames on and it makes it a lot quicker… The sim slows down to the point where the gravity seems low and everything is in molasses without it turned on.

To drive faster without the suspension bobbling around as much, add a constraint from the frame to the front axle and offset the pivot toward the front of the vehicle about 3 units. Doing the same to the rear axle takes a lot of the articulation out (note that there are 2 frame sections…) The constraint would act like an axle locater bar.

Stiffening up the suspension makes it less like a rock crawling rig, and more like a street truck of the 70’s.

I’m planning on having the vehicle suspension/power/tires upgrade with each completed level. That particular model is supposed to be something like an old flat fender with just a spring lift in it. Later levels will have the 4wheel steering rig I’m working the bugs out of, and some pre-runner rigs with a double wishbone independent suspension (also debugging…)

(Chaser) #4

Seems a little messed up if you ask me.

It was really crazy, it was flippin all over the place, and I couldn’t get it to go where I wanted it to go.

Although the suspension seems pretty good, just the general physics seems to need some work.

(Sphere) #5

The steering does tend to dig in, still needs lots of work, and the model doesn’t do well at all at anything more than a walking pace (really isn’t supposed to.) Tap the up arrow to ease forward, and keep the brakes handy.

As you can see here, rockcrawling is a very slow strategic activity:

The point is to simply make it from point a to point b, not to get there in a hurry. The map is really open and doesn’t illustrate that very well.

Try making a lap around the perimeter of this one (again make sure to enable all frames and stay off of the gas unless needed. X is there to get out of tricky spots/stucks etc.)

Updated .blend is here.

(Spenn13) #6

Really cool, would love a tutorial, it just seems there aren’t enough good GE tutorials for stuff like this. But what my crit is, with the little knowledge i know, is, go to a part, go to the logic panel, and add a restart. It seemed like I flipped over way to many times.

(Sphere) #7

Added a scene restart (on the map mesh.) Key R
Changed static cam to a floating follow cam (key 0, not Pad0…)
Added 8 “spotter” cams at the orange markers (key 1 - 8)
Changed the first deep gully to make it easier to navigate.

Haven’t had time to adjust the camera focus, so some are really “fisheye-ish.”

In progress:
-Removing poly’s wherever possible on the model (I’ll do a low poly map later…)
-Toying with lowering the center of gravity a bit and moving it aft 1 or 2 units.
-Changing the wheels and trying different “tread” meshes to see if I can make the steering more responsive and less likely to “throw” the model when the wheels are stuck. I’d like the wheels to spin a bit more and “hard” bounce less.
-tweaking the friction/torque values.

Anyone know how to bind the mouse to a cam for a fps view?

P.S. please post framerate if possible. I’d like to see how my old radeon 9500 stacks up , and if the behavior is different with faster cards. Thanks for the comments btw. All are appreciated. I’ll see what I can do about a tutorial.
Feel free to ask questions in the meantime.

Updated .blend is here.

(QNev) #8

Hah that’s awesome! Keep it up man!

(scabootssca) #9

ya it’s cool

and i get like 110 fps on my radeon 9200

(mr_yeahman) #10

damn, this was fun, I never had so fun with something created in blender so far.
Well, work little more on the frontwheels.
Put some graphics and some levels, U got a great game and many people gonna enjoy it, include me.
And the last thing, start out with a easier firstlevel-map, u know for invite n00bgamers to enjoy some levels too.
It would be nice if you write a tutorial how u did…

(JonMW) #11

Well, work little more on the frontwheels.
Are you referring to the way that the wheels don’t seem to be properly fixed to the axle?
Judging from my own (very limited) work on vehicles, I believe that this is the result of problems in the constraints themselves (the programming of Blender, not the fault of Sphere). As far as I know, this can’t be fixed to (my) satisfaction unless we get another build.

(Spenn13) #12

Yeah, sometimes when I back up, the back wheels flip out and go in all directions, and then I"m upside down. How did you figure out how to do this. I can only get as complex as the BSOD, I can’t find more complex tutorials to make what you accomplished.

(Sphere) #13

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 :wink: 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…:wink: 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.

(blendenzo) #14

This looks promising. I enjoyed the challenge of the game, though I often found myself flipping over, as others have noted (I’m just not patient enough for rock crawling, I guess). The behavior of the wheels (the front ones especially) does seem a bit erratic. The suspension is great, and I really liked your terrains. Keep it up.

(BumpyMonkey) #15

Ugh… The camera makes me dizzy…

(PSK131) #16

I envy your dedication.

(QNev) #17

Dude if you need any help modeling the vehicles, I’d be glad to help. I made a low-poly Land Cruiser FJ a while ago that might fit in with the game.

(Sphere) #18

-Reworked the frame to be a single object.
-Moved all of the constraints around to better balance the vehicle.
-Changed the center of gravity.
-Moved the steering rod constraints forward to limit steering.
-New knuckle meshes.
-New tires.
-Added finish line (hit the yellow post for now to go to level 2)

Vehicle still has some issues, but seems much more stable now. Still possible to plant the front end and endo, but now you can (with skill and the right spot on the map…) ride the endo for a little bit!

Level 2 vehicle is supposed to be like a VW dune buggy. Faster, 2 wheel drive, lower center of gravity. If the map seems oddly familiar, it’s just level one streched way out and smoothed for speed. I’ll make a set of new maps when I get a chance.

The VW model could easily be reworked to make a car for a track… Slam it a little more, rework the tires and add a body. I may do that for fun at some point.

Enjoy, .blend is here.

(Sphere) #19

QNev, just saw your post. That’d be awesome. Plop it onto the frame (space it 1 or 2 units in Z and parent it to the frame.) It may take some scaling etc…

The dimensions of the vehicle can be changed without affecting much. If you move the front axle, knuckles, tires, and tie rod together you can lengthen or shorten the vehicle and all that will be affected is the wheelbase (and what it can climb over.)

(QNev) #20

Right on. I’ll get on that in a bit.