Game Development Community

Torque Vehicles

by Daniel "opcode" Arnold · in Torque Game Engine · 04/17/2002 (9:46 am) · 48 replies

Hello fellow Vehiclians.

This thread is for all of us who must deal with any type of vehicle in the torque engine. We are here to share our knowledge and help each other out.

Thanks
Page «Previous 1 2 3 Last »
#1
04/17/2002 (9:43 pm)
Ok for starters, here are a few notes.

1. Make sure your wheel nodes are inside your collission box, or else!

2. The center of mass of the object is relative to the center of the enviroment it is in (such as the x,y,z grid in milkshape). Set it near the back if you want to be able to jump things.

3. Watch that spring damping, it controls how fast your springs slow their oscillation.
#2
04/18/2002 (7:01 am)
for gears you could just have a gear variable on the engine code which sets to the gear ratio
for example:

1:1.6

so you will set the gearratio var to 1.6 .. that means for each turn of the wheels you have 1.6 turns on the crankshaft (this is a non-technical explanation for those of you who know about mechanics) :D
That ratio isnt even real.

Ok, now you will set that variable from script when the user presses the gear up or down key... so the engine torque value will automatically be read from the datablock and multiplied by the gear ratio...

just a thought
#3
04/18/2002 (7:58 am)
Does anyone have a .cs file which holds the Wheel datablocks? I didnt get the race mod so I dont have the info. Thanks
#4
04/18/2002 (12:16 pm)
Xavier: you may have not given a mechanics description, but that is the best idea I have heard yet. Easy to code at that. KISS!

Sam: I have the .cs files. If you download the latest source code you can get the racing mod as well. Is there any reason you wouldn't just get the latest source code? slow connection? Anyway, that may be the best way to go. But I can zip up the racing mod and put a link up here if you like.
#5
04/18/2002 (12:30 pm)
@ Daniel
Quote:
1. Make sure your wheel nodes are inside your collission box, or else!

Why? I have exported my model with the "hub#" nodes out side the collision messh and it works fine. However if they are bordering or overlapping I find that the wheels will have a periodic bump. But I solved it by taking the hubs totally outside the collision mesh. Is there any reason they should be inside?
#6
04/18/2002 (12:32 pm)
Currently I have added an axleRatio Variable to the vehicle datablock. the engine torque is multiplied by it and the maxwheelspeed is divided by it. Giving you the effect of gearing down.. more power less speed.
#7
04/18/2002 (1:55 pm)
@Bruce: does it work well?

@Anthony My car was going out of control. Tim answered with the quote below, perhaps this is fixed now, I don't know. When I put them inside the collission mesh it was alot more stable.

Quote:
Tim Gift
Employee Posted: Apr 03, 2002 16:05 PST

The center of mass joint doesn't do anything, at least not that I know off. That was something I had working originally, but it was disabled when Dave integrated in the rigid body class.

The center of mass is the origin of the shape, where ever the 0,0,0 point is in either MS or Max.

Couple notes...

- It's good to have the center of mass near the top of the spring. Low center of mass gives better stability.

- Keep the top of the spring nodes inside the collision box. This way the springs don't end up underground or insides things when the car flips over.
#8
04/18/2002 (3:10 pm)
Daniel: nice you liked my idea :)
I can give u a tech discussion about engines for hours if you want :D ... tho i dont think you need to know all that to simply code a gear ratio thingy
If you take a dive in it let me know.. i dont have much time now to look at it and my game doesnt use that kind of stuff anyway :)
If you plan on making a racing game btw let me know.. i was interested in this a while back before joining my current team..
#9
04/18/2002 (3:13 pm)
Hehe... Daniel, you planning on making a racing game?
#10
04/18/2002 (3:30 pm)
yes It works ok, But I want more heh, Right now I am having trouble with my first attempt at adding a new datablock to the engine.. well its added but having trouble getting the information to my vehicle =\
#11
04/18/2002 (6:22 pm)
Anyone looked into doing any racing AI?
#12
04/18/2002 (9:18 pm)
I guess I should mention I am working on the TSRR Project. :)

Right now I'm working on being able to switch control to the car when you get near it. I don't know if that stuff is built in the torque engine yet. It shouldn't be too hard. I also, plan to play with the car tracks and transmission emulation tonight.

Me and the Brat Tyler Frans made
#13
04/18/2002 (9:28 pm)
Ahhh crap. I see some polys that ended up reversed. Back to MS. :\ Heh
#14
04/18/2002 (9:34 pm)
I would just like to say, ahem, Tyler is a great artest and a very good modeler.
#15
04/18/2002 (10:43 pm)
The code for mounting vehicles is in the engine. It was missing in the scripts.
#16
04/18/2002 (11:32 pm)
Thanks Labrat,

I wasn't sure.

Also, not going very well for the tracks. I may need to go about it a different way.

The way I am trying now is to have a bunch of "little wheels" and somehow an outside track on those. But that may be a little too much. At any rate i'll learn something out of it, which is the point for now.
#17
04/19/2002 (9:26 am)
no, making many little wheels is completely resource hog... use animations
#18
04/19/2002 (2:12 pm)
If you find it to be a resource hog, just imagine it as two large wheels, Emp. Large rectangular contact points. Turning is handled with forward motion of one side and reverse of the other, could just handle the many 'road wheels' in animation (as said before). :)
#19
04/19/2002 (6:30 pm)
Yeah I did that, but the way it rotates causes a problem, this looks like a source fix. I have some great screenshots of it though, I'll send ya the links when I get home.
#20
04/29/2002 (9:18 am)
Update on the gearing that I've been working on:

Added an array to the vehicle datablock gear[0] - gear[5]
Added console function to set the current gear for your vehicle.
Things I am working on now:
Looking into engine sounds(any Ideas here on how to simulate them with the current audio?)I want to create the effect of powerful engines revving up etc.. The current code just plays your looping sound louder and louder..

*EDIT* added some pitch shifting that seems to be working alot better for engine sounds.. now to put in RPMs to match it to.

Probably first I'll be finishing with the downshifting..Applying engine brake when you are overspeed for that gear etc.

Future plans.
Working on adding RPMs to the math.
Working on Reverse and neutral gears.
Adding flag and math for automatic transmission.

Anyone else making progress on Vehicles?

Bruce
Page «Previous 1 2 3 Last »