Game Development Community

Some Wheeled Vehicle problem

by Bullitt Sesariza · in Torque Game Engine · 12/21/2007 (12:39 am) · 2 replies

Hi, I tried using AI Wheeled Vehicles in my game. First I tried using the buggy from the starter.racing and worked fine. But when I use my own model, it goes all wrong. FYI, I used 3DS Max 9 for making the model (a 6 wheeled truck). Here are the problems:

1. When I first mounted the wheel and tried it in the starter.racing, the all the wheels rotated with the pivot point not on the center of the wheel but somewhere outside of the wheel. This made the wheels to move up and down like a yoyo. I've done all the steps from the TDN, tutorials, etc, but still the same problem occurs.

2. And then I tried remaking it from the buggy (just changing the meshes but still with the same nodes + 2 additional nodes for the 5th & 6th wheels) and now the wheels can rotate normally. But now the problem is some parts of the truck's wheels went inside the ground and the truck can occasionally past through the ground. It's not the ground nodes FYI because I'm pretty sure they are right.

3. When I tried placing some triggers to hit by the truck, it can't call them at all. But when I changed it back to the demo buggy, it can recognize the triggers and activate it's callbacks.

So why do all of those happen? What I need to figure out is how to overcome these problems:
1. How to place the wheels on the ground (not inside it)?
2. How can I make the truck to trigger the triggers?

Thanks in advance.

#1
12/21/2007 (2:10 am)
How did you setup your drive/steer wheels in your vehicle.cs file?

If you look in "starter.racing/server/scripts/car.cs" for "function WheeledVehicleData::onAdd(%this,%obj)"
you will see how the wheels are set. You may also want to check out your collision box for the tires.
#2
12/23/2007 (11:07 pm)
I've checked the collision box for the tires and IMHO it's alright. Also in the script, I changed it to make all the wheels powered. But what has it got to do with some portion of the tires / wheels went inside the terrain and not triggering a trigger? BTW, the collision of the truck itself is right IMO because I tried hitting it with my player (from the side and the front) and it can call the onCollision callback. Also when I tried using the wheels from the demo buggy, it didn't go inside the terrain. So I guess it's my own wheels that are problematic but I can't understand why.

BTW, I've got some more vehicle questions
1. How does the physics in vehicles work? I'm not a fan of automotive nor am I a major in physics or machinery. I even suck at general physics. So I'm so confused at how this works.
2. How do I add something like a nitro / speed boost in the vehicle? I searched for 'nitro', 'boost', etc but came out nothing.

Well, I think I'll postpone this issue until new year cause we will all be on vacation. :D

Merry Xmas and Happy New Year. Cheerss....

(^_^)v