Vehicles in Latest Torque Version
by Daniel "opcode" Arnold · in General Discussion · 03/26/2002 (7:22 pm) · 18 replies
Hey Guys,
We are working on TSRR. It is a racer, so the vehicles are very importantant to me. Espically how they act. This, I feel, is going to be a long process. So I am appealing to the GG community. Let us help each other create vehicles w/ the attributes and character we need for our games.
For anyone who hasn't figured this out yet (as I had not, thanks for your help Ken). So far the vehicles are part of the racing mod in the latest version of the Torque engine. To access this part, create a shortcut with the command of the example executable and attach the string '-mod racing' to the end of the command. (i.e F:\Torque\example\example.exe -mod racing). This will execute the racing mod.
So now onto the meat of this topic.
I have been playing around with the vehicle script code for a few days now. All the code I am refering to is in car.cs in the example. I am only asking for help in this area.
I only have a semi understanding of all the variables I can tweak through the script. Variables such as 'friction' are self explainatory. I have little knowedge of the 'integration' variable, although it seems to be very important, as well as the Wheel variables.
Here are some the attributes I need:
1. Vehicles need to grip the road. Only slide a little when turning.
2. Vehicles should be able to fall on their side when turning too sharp. Also, they should be able to roll.
3. Ability to keep reasonably upright while 'in flight'. Done by jumpng a hill.
That is a nice start. Here are the major problems I am having.
1. Vehicle wants to stay upright. If I try to tip it on its side it just goes upright again.
2. Spinning out of control. When the vehicle gets into a position on its back, it will usually try to go upright causing it to spin out of control.
3. Horozontal 180 spins. When jumping hills if the vehcile is at the slightest turn angle the vehicle will just turn around in mid air instead of staying reasonably straight.
Here are some solutions I have come up with.
1. Slick tires can be fixed by upping the friction variable. I guess that was too easy.
2. Setting the integration variable to 1 tends to make the vehcile more stable. This is far from a fix.
Any insight to better understand what the variables do would be great. Others please post your vehicle requirements and perhaps we can get them to act the way we want. Thanks.
We are working on TSRR. It is a racer, so the vehicles are very importantant to me. Espically how they act. This, I feel, is going to be a long process. So I am appealing to the GG community. Let us help each other create vehicles w/ the attributes and character we need for our games.
For anyone who hasn't figured this out yet (as I had not, thanks for your help Ken). So far the vehicles are part of the racing mod in the latest version of the Torque engine. To access this part, create a shortcut with the command of the example executable and attach the string '-mod racing' to the end of the command. (i.e F:\Torque\example\example.exe -mod racing). This will execute the racing mod.
So now onto the meat of this topic.
I have been playing around with the vehicle script code for a few days now. All the code I am refering to is in car.cs in the example. I am only asking for help in this area.
I only have a semi understanding of all the variables I can tweak through the script. Variables such as 'friction' are self explainatory. I have little knowedge of the 'integration' variable, although it seems to be very important, as well as the Wheel variables.
Here are some the attributes I need:
1. Vehicles need to grip the road. Only slide a little when turning.
2. Vehicles should be able to fall on their side when turning too sharp. Also, they should be able to roll.
3. Ability to keep reasonably upright while 'in flight'. Done by jumpng a hill.
That is a nice start. Here are the major problems I am having.
1. Vehicle wants to stay upright. If I try to tip it on its side it just goes upright again.
2. Spinning out of control. When the vehicle gets into a position on its back, it will usually try to go upright causing it to spin out of control.
3. Horozontal 180 spins. When jumping hills if the vehcile is at the slightest turn angle the vehicle will just turn around in mid air instead of staying reasonably straight.
Here are some solutions I have come up with.
1. Slick tires can be fixed by upping the friction variable. I guess that was too easy.
2. Setting the integration variable to 1 tends to make the vehcile more stable. This is far from a fix.
Any insight to better understand what the variables do would be great. Others please post your vehicle requirements and perhaps we can get them to act the way we want. Thanks.
#2
I see two places where 'integration' is used in: void WheeledVehicle::updateForces(F32 dt).
I've only had Calculas 1, 2. That covered Functions, Limits, Derivatives, Integrals, Infinite Sequences, Series, 3 Space and Surfaces.
I haven't studied Differential Equations so I wouldn't know how to construct or modify a function of one.
Are you suggesting I edit the WheeledVehicle::updateForces(F32 dt) in the source? That may be the only way to get the vehicles to act the way I want.
03/27/2002 (11:45 am)
Thanks for the post Frank,I see two places where 'integration' is used in: void WheeledVehicle::updateForces(F32 dt).
I've only had Calculas 1, 2. That covered Functions, Limits, Derivatives, Integrals, Infinite Sequences, Series, 3 Space and Surfaces.
I haven't studied Differential Equations so I wouldn't know how to construct or modify a function of one.
Are you suggesting I edit the WheeledVehicle::updateForces(F32 dt) in the source? That may be the only way to get the vehicles to act the way I want.
#3
Editing the updateForces may be necessary if you are not happy with the vehicle physics engine and even after changing its parameters it does not fit your need.
On our game, we have put some totally different physics for the plane than the one in Torque.
However, it's a tough job if you are not used to cinematic & dynamics physics (hope it the right english term).
03/27/2002 (2:35 pm)
Calculus 1,2 ??? Is it somehow a degree ?Editing the updateForces may be necessary if you are not happy with the vehicle physics engine and even after changing its parameters it does not fit your need.
On our game, we have put some totally different physics for the plane than the one in Torque.
However, it's a tough job if you are not used to cinematic & dynamics physics (hope it the right english term).
#4
Not sure what you mean. That was just to tell you the limit of my knowledge.
I've done more tweaking with the wheeled vehicle script. looks like I'll definitly be changeing the physics in the source.
03/27/2002 (3:49 pm)
> Calculus 1,2 ??? Is it somehow a degree ?Not sure what you mean. That was just to tell you the limit of my knowledge.
I've done more tweaking with the wheeled vehicle script. looks like I'll definitly be changeing the physics in the source.
#5
server\scripts\vehicles\drone.cs(229):explosion = ScoutFlyerExplosion;
Any idea where ScoutFlyerExplosion resides in the new code?
( Been reading till I am blind. :)
04/11/2002 (5:16 pm)
Well I tried incorporating the new vehicle datablock variables and see that this needs definingserver\scripts\vehicles\drone.cs(229):explosion = ScoutFlyerExplosion;
Any idea where ScoutFlyerExplosion resides in the new code?
( Been reading till I am blind. :)
#6
1. The ability to set transmission, gear ratios or other options per vehicle instance.
2. Decals applied to the sides of vehicles(simulated mud splashes etc.)
3. More realistic vehicle related sounds.(I would like to make the engine sound more realistic rather then just increasing volume.)
This and many other things I would like to Improve,tweak or add.
04/11/2002 (6:15 pm)
Things I am looking to add to vehicles.(Not in any particular order)1. The ability to set transmission, gear ratios or other options per vehicle instance.
2. Decals applied to the sides of vehicles(simulated mud splashes etc.)
3. More realistic vehicle related sounds.(I would like to make the engine sound more realistic rather then just increasing volume.)
This and many other things I would like to Improve,tweak or add.
#7
Simulated mud splashes, hmm if they were combined with the decal puff colour in mapping then it would be interesting, but I am not sure here. It would be lots of work for both coder and modeller/skinner I think.
Just being able to assign a few sounds based on speed ratios would do. Slow sound, medium sound, fast sound, mid air sound accelerating, Idle sound, Stuck spnning wheels sound, oh and separate tire skidding on surfaces sounds (data would go in addmapmaterial for that)
04/14/2002 (11:48 pm)
Gears would be cool, so really fast ones can be poor at hill climibing with different engine sounds and stuff. I think only Lo and Hi gear would be enough for me personally.Simulated mud splashes, hmm if they were combined with the decal puff colour in mapping then it would be interesting, but I am not sure here. It would be lots of work for both coder and modeller/skinner I think.
Just being able to assign a few sounds based on speed ratios would do. Slow sound, medium sound, fast sound, mid air sound accelerating, Idle sound, Stuck spnning wheels sound, oh and separate tire skidding on surfaces sounds (data would go in addmapmaterial for that)
#8
As for the 'feel' of the car, the original values in the racing mod were for the 'block on wheels' Tim created. I've gotten a new car in-game but haven't quite tweaked all of the values for the specific car. The wheels for 'the block' where nice and big. The wheels on my car are small (it's a sports car). As far as handeling, I think the code is there and it should work (from what I've seen). It'll just take some work to figure out how exactly all of the various forces, damping, etc. work. I'm no guru on car physics ... yet :-).
04/15/2002 (5:42 am)
Gears are something I'd like to get into Torque. Along with the associated HUD and sounds :-). I'm also looking at putting in some manual/automatic transmission code/script.As for the 'feel' of the car, the original values in the racing mod were for the 'block on wheels' Tim created. I've gotten a new car in-game but haven't quite tweaked all of the values for the specific car. The wheels for 'the block' where nice and big. The wheels on my car are small (it's a sports car). As far as handeling, I think the code is there and it should work (from what I've seen). It'll just take some work to figure out how exactly all of the various forces, damping, etc. work. I'm no guru on car physics ... yet :-).
#9
A link I found very useful
I think we should get a TCP project going for vehicles. There is alot I want to do but will take me a long time to get the understanding/skill to get it all working on my own, so as Daniel said, Lets work together on this.
04/15/2002 (8:43 am)
I am pretty much considering only changing wheeled vehicles because the hovers and fliers work well enough for me and I cant see having gears in a hovercar.Here is a good link that makes some of the math that I want to include a little more simple. It shows how the RPM's can be calculated etc.A link I found very useful
I think we should get a TCP project going for vehicles. There is alot I want to do but will take me a long time to get the understanding/skill to get it all working on my own, so as Daniel said, Lets work together on this.
#10
I have found a few links that relate to the forces (damping, etc.) that may be useful. I'll edit this post when I round them up.
04/15/2002 (8:50 am)
Some sort of TCP project would be helpful so that we all don't invent the same wheel (and thus by not doing it together it's "square" :-D). I don't have any intentions on changing the hover/flying vehicles, either. Most of what I'd like to personally work on has to do with making the Wheeled Vehicles have more of a "real car" feel, instead of it just being like a go cart. You go, or you stop :-).I have found a few links that relate to the forces (damping, etc.) that may be useful. I'll edit this post when I round them up.
#11
I've been away on a business trip for a week so I'm not up on everything yet.
I did find out how to make the vehicle stable. I don't know if it is any interest to you guys but just incase, read this Post.
As for the gears, you could have that affect the engine torque, since it can be dynamically changed.
I'll be getting back to work on tihs stuff now.
04/16/2002 (1:02 pm)
Hey Guys,I've been away on a business trip for a week so I'm not up on everything yet.
I did find out how to make the vehicle stable. I don't know if it is any interest to you guys but just incase, read this Post.
As for the gears, you could have that affect the engine torque, since it can be dynamically changed.
I'll be getting back to work on tihs stuff now.
#12
What I have planned for this first round is:
Simple Axle Gear math - Mostly done but want to play with it more. Currently I have it set in the vehicle datablock, but probably will make it into its own datablock.
Simple Manual Transmission - Working on adding a Transmission datablock containing gear ratios and other variables that may show the need later on.(ex. transmission efficiency etc.)
For the first pass I am using maxwheelspeed to limit the vehicle. Eventually I want to move that to RPM.
This is a pretty good math exercise for me, Anyhow, Just wanted to tell you all what I was working on. And if anyone else is already working on this I'd be interested in hearing from you.
Edit:
We really should move this out of General and into one of the TCP or SDK forums out of everyone elses way.
04/16/2002 (2:09 pm)
I started to work on Gears today and am making some progress. What I have planned for this first round is:
Simple Axle Gear math - Mostly done but want to play with it more. Currently I have it set in the vehicle datablock, but probably will make it into its own datablock.
Simple Manual Transmission - Working on adding a Transmission datablock containing gear ratios and other variables that may show the need later on.(ex. transmission efficiency etc.)
For the first pass I am using maxwheelspeed to limit the vehicle. Eventually I want to move that to RPM.
This is a pretty good math exercise for me, Anyhow, Just wanted to tell you all what I was working on. And if anyone else is already working on this I'd be interested in hearing from you.
Edit:
We really should move this out of General and into one of the TCP or SDK forums out of everyone elses way.
#13
wouldn't it be easier to exchange skins (much like the damage skins in T2) instead of applying decals? have a variable for "muddiness" and do something like:
if (mud>10) { skin=some_mud; }
if {mud>20) { skin=lots_of_mud; }
if {mud>30} { skin=mod_covered; }
04/17/2002 (2:39 am)
on the mud splashes:wouldn't it be easier to exchange skins (much like the damage skins in T2) instead of applying decals? have a variable for "muddiness" and do something like:
if (mud>10) { skin=some_mud; }
if {mud>20) { skin=lots_of_mud; }
if {mud>30} { skin=mod_covered; }
#15
04/18/2002 (6:46 am)
Has anyone addressed tracked vehicles yet? They seem to be a function of wheeled vehicle code, but I'd like to hear what you guys think.
#16
I haven't tryed tracks yet, but since you sparked my interest I'll try it out tonight, and let you know what I found.
By the way, It seems some people want to discuss this topic in the SDK forums. I agree. Below is the link.
SDK Forums->Engine->Torque Vehicles
04/18/2002 (12:19 pm)
Hey Scott,I haven't tryed tracks yet, but since you sparked my interest I'll try it out tonight, and let you know what I found.
By the way, It seems some people want to discuss this topic in the SDK forums. I agree. Below is the link.
SDK Forums->Engine->Torque Vehicles
#17
04/28/2002 (9:36 pm)
when i tried to configure the racing mod and tried to save it, it doesn't save at all. Can anyone help
#18
04/29/2002 (5:32 am)
What do you mean 'configured' it? What were you trying to configure/save?
Torque 3D Owner Frank Bignone
Darkhand Studio
The integration variable is very important to have a stable physisc model as it somehow 'smooths' the integration : more robust integration of the differential equation. Things that you can do BTW is to put the integration in the processTick of the vehicle class and not when you update the forces/torque.