Advanced vehicle physics

@OTO
Do you mean the car isn’t spawning? It loads the vehicle through LibLoad. The most common reason this fails is loading test_map from an already opened Blender - you have to load test_map by doubleclicking on it, so that the BGE’s execution directory is correct. If that doesn’t fix it, could you post the console output?

@Joystik Studios
That sounds like a fun issue to debug. Is it inverted left-right with the arrow keys, or are you using a gamepad / joystick? I don’t know how it could be backwards with the arrow keys, they couldn’t be different between keyboards… could they? .__. Are there errors on the console? If all else fails, try going to the player script and replace sensor(“right”) - sensor(“left”)) with -(sensor(“right”) - sensor(“left”)))
And thanks ^-^

@Matpi
Oh, bother! I thought I fixed that issue before D: Thanks for pointing that out. I’ve reuploaded with the fix.

@3d solar system builder
If you have any vehicle models I’d be happy to integrate them =)

I was working on a vehicle one but i have not finished it yet.I stopped working on it because i am working on a game where you program allies and robots to attack enemies in a particular sequence you choose in the blender game engine.I am doing it with
logic bricks and not python.

Hello Raiderium

“Do you mean the car isn’t spawning?” Yes, it was the meaning! :slight_smile:

I’ve tried your method with no results either, so I’ve placed the “testmap.blend” file and the two folders inside the blender directory and now it works!
Great sim!!!
Thank you very much!
Bye
ps. If you care to make a “bike template” I’ll be in heaven ( I’ve adapted your car one but its not satisfactory)

Hey there!
I just found this thread, and am impressed with how well it has ended up. I was wondering if it would be alright with you if I use your game as a base to build my own game off from. Please PM me if it is!

@NID Graphics
are you “talking” to me? :wink:
Bye
p.s. all this is quite old material, now!

Well, once again, this great resource its not working any more, with Blender’s current version ( 2.76)!
So, if some Python guru ( HG1 ?) could check, please, it’ll be great!
Bye

Dear HG1 ,
I could kiss you!
Works wonderfully.
Bye and many thanks.

Could somebody add following to this?

  • Engine curve based torque
  • RPM system(get RPM and use for torque, show it as a property so that user can use it for displaying)
  • Transmission system(with automatic property as boolean so that user can choose between manual and automatic)

It would make it great setup:)

How easy would be to use this on multiple vehicles?

I have forgotten to uncomment some lines which are used for the dust particles.
I also added the same basic gearing ratio, which I fond in the Geeborg - Proof of concept Blender 2.62 file.
advanced_vehicle_physics2.blend (774 KB)

@MarvinCJames It is quiet simple.

  1. Duplicate the camera.
  2. Then modify the start position at line 16 in the player.001. Or comet it if you want that the car will be placed where the camera is placed.
  3. Change the keyboard sensor for the second player.

Ok, thanks

What gearing ratio don’t see it?

Look at r_wheel.py line 11.

what’s going on here then

here, have an updated version
http://www.gameblender.org/download/file.php?id=3575

it’s good for what ails you


Blender Game Engine Started
Python script error - object 'main_cam', controller 'Python':
Traceback (most recent call last):
  File "player", line 48, in <module>
  File "/home/user/Lejupielādes/AdrianaLejuplādes/Blender/Demos/Vehicle physics 0.96/test map.blend/r_vehicle.py", line 42, in loadXML
  File "/opt/Blender/2.75/python/lib/python3.4/xml/etree/ElementTree.py", line 1187, in parse
    tree.parse(source, parser)
  File "/opt/Blender/2.75/python/lib/python3.4/xml/etree/ElementTree.py", line 587, in parse
    source = open(source, "rb")
FileNotFoundError: [Errno 2] No such file or directory: 'vehicles/evolution.txt'
Blender Game Engine Finished

Come on…

Try Blender 2.76 mebbe.

Actually, not that. Try opening the file directly, not by opening Blender first. It changes the directories being searched.

Edit: Fixed the problem, re-uploaded. Should work properly regardless of where it’s opened. Nice to have that issue dealt with properly.

Can you tell me advantages/disadvantages of this compared to Bullet vehicle wrapper?

And how easy/difficult would it be to replace Bullet wrapper script to this?

Raiderium,
thank you very much, for the new version!
Works just perfectly!
Bye

Solid! Although I did fall through the floor a couple times when hitting steep inclines.
Blender 2.76