Looking for a 2.5 car template

I wanna make game with cars, and am looking for a template that provides the basic setup for wheeled vehicles. I know some, but they’re all 2.4, and I’m looking for a 2.5 system. What I need it to include is:

  • Any car model, with wheels that turn as you steer. If possible, wheels attached without using scripts, but joint constraints instead.

  • Basic car dynamics. If possible, using game logics for the normal dynamics rather than a script.

  • Supports automatic gears and engine RPM. Holding down the brake button when stopped should also go into Reverse gear.

  • Support for selecting multiple cars. Selecting a car meaning a new mesh and dynamic / physics rules.

  • Optionally, detection for wheels scratching the ground (when braking too hard or sliding). So you can add wheel scratching sounds and smoke.

  • Optionally, a speedometer HUD with needle showing RPM, and text showing speed and current gear.

  • Optionally, an engine sound that respects the RPM. Or at least a system that can change a sound’s pitch based on RPM and gear.

  • Optionally, a system that can lay a separate material over the car when braking (for brake lights).

Anything even close to this would be appreciated. I don’t need the models or textures to be fancy (since I plan to find and use my own), but just the basic logic layout for all these functions.

Thank you for those links. The speedometer and sound should be good for now. A real engine / gear system is all I still lack.

Like I said, I don’t wish to use scripts for the physics, so I’m skipping the wrappers part. I’m doing it via dynamics, and wheels connected with Rigid Body Joint constraint. But I’m having problems with setting up the physics (especially steering), and I can’t get them to work right at all. Seen some tutorials about this, but still won’t work for me yet :frowning:

[EDIT] I decided to go with the vehicle wrapper in the end, as it’s indeed much better than normal motions. So that works well now. I still can’t figure how to give the engine a real RPM + gear system however.

The car don’t have any engine so You have to fake it all.

Meaning have a script continuous monitoring the cars speed, calculate the rpm backwards based on the gear, then calculate the driving force from the rpm and speed based on some power envelope table or equal. Make some logic for changing gear in the process.

It’s not only scripting, it’s fairly heavy scripting - but You will learn allot :slight_smile:

Ouch. I was hoping some of the vehicle wrappers might already have it, and calculate RPM properly to apply force with it.

Calculating it backwards might be tricky. If it doesn’t work properly, and have a different acceleration / force based on gear, it could look fake. Especially if your car slows down in the air or during a crash. Let alone the fact I know no BGE scripting at all :stuck_out_tongue:

I think it would work by calculating velocity ranges, and changing the gear number in the script based on them, while also reducing acceleration rate the greater the gear. I already asked about this for the first wrapper that HG1 linked… will see if anyone knows how it could be done there.

This should be calculated similar to NFS. I think.
each gear will have a max speed it can reach (e.g: 50 in first)
that max will be the max revs (8000?)
so the revs might be easiest calculated on this with some basic curves (non-linear)

just my thougts

I found a old gear example file for Blender 2.43 (no engine simulation). I changed the script. It works now with Blender 2.49b and 2.5x.

Attachments

Speedometer Gears2.xx.blend (407 KB)

If you calculate the forces for each wheel, you should be save. The vehicle wrapper makes the vehicle not to drive forward, when the wheels do not touch the ground. The same for braking and steering.

If you play the demos you might see it. Just brake when you are jumping. That shouldn’t have any effect (except on landing :wink: )

Best thing I’ve seen is mike pan’s game using bullet trough python script:

http://blog.mikepan.com/blender-vehicle-physics-tutorial/

but, dont know how its related to VehicleWrapper,
its the same thing/script/method ???

also it seems that mike is working on a new game:
http://blog.mikepan.com/a-new-racing-game/

Nice! I shall check that game out as well.

Currently, I went with Monster’s vehicle wrapper script (which is a great one), and almost finished adapting it to a high quality car mesh.

My main concern now is finding an RPM script. The script only needs to set a game property as the current gear, and another game property as the engine rotation speed. If possible, by increasing / decreasing RPM when pressing the up or down arrow keys. I can then link that to car force based on gear. Should also be easy to put on an f-curve, and make the speedometer needle spin. I don’t know if I can make such a script by myself, though I’ll try.

[EDIT] lol. I think the new game Tommy5 linked uses the same car mesh that I’m working with now. Hopefully though, my game will be different and not conflict its idea (plans to be a street racing / city racing game, like Need for Speed). Regardless, that game has some lovely graphics so far! Can’t wait to see how it goes :slight_smile:

yep, new stuff looks awesome!
while ago i tried to make own checkpoint race game based on mike’s demo, but never finished…

http://tommy5.net/blender/Race.jpg