|
Shard Soyinka
ubertease
Join date: 6 Nov 2005
Posts: 23
|
11-03-2007 19:07
(Please note that I am NOT a car person so I'm sorry if I get some of these terms wrong!)
Hey all! I have been experimenting with vehicles scripts and there is one part that has been really bothering me. From what I have seen it appears that a vehicle's power is tied directly to its maximum linear motor velocity (ie: VEHICLE_LINEAR_MOTOR_DIRECTION). By this I mean that say you have a slow vehicle that has a maximum velocity of 1 vs a fast vehicle with a max velocity of 30. The fast one will skip and bounce over every bump on the ground and likely ramp itself out of the sim while the slow one can not even make it over a small bump.
My problem is that I am trying to create vehicles that have a high power ratio but a low top speed. Think of a bulldozer, a huge unstoppable machine that could move a mountain but you can almost walk faster than it. I am trying to make a vehicle that is slow but has no problem climbing hills and grades. Any clues?
|
|
Tegg Bode
FrootLoop Roo Overlord
Join date: 12 Jan 2007
Posts: 5,707
|
11-04-2007 01:18
Yep seen this problem, for some reason offroad vehicles in SL climb steeper and better in higher gears than low crawl speeds because the scripts increase torque and speed together instead of the inverse.
_____________________
Level 38 Builder [Roo Clan]
Free Waterside & Roadside Vehicle Rez Platform, Desire (88, 17, 107)
Avatars & Roadside Seaview shops and vendorspace for rent, $2.00/prim/week, Desire (175,48,107)
|
|
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
|
11-04-2007 09:05
The VEHICLE_LINEAR_MOTOR_TIMESCALE can be likened to torque. It's not exactly the same, but the timescale is how quickly the vehicle will get from 0m/s to its top speed. It's not an exact number of seconds (it's an exponential decay timescale), but the lower the number, the more forcefully the motor will attempt to reach its top speed, which I think will correlate pretty well with torque. Try lowering your timescale.
|
|
Kage Seraph
I Dig Giant Mecha
Join date: 3 Nov 2004
Posts: 513
|
11-05-2007 12:16
An additional means of adding subtle torque effects is to run a simple timer event checking speed against desired top speed, relative to acceleration time. Let us suppose that the car is trying to achieve 50 m/s but its actual llVecMag(llGetVel()) returns something < 1 m/s after 4 seconds of attempted acceleration. Clearly, you're stuck on something. So llApplyImpulse your butt over/past the impediment. You can use this to both simulate extra climbing power at low speed and to break the explicit limits on the linear motor.
Alternately, or perhaps as an additional supplement, you can provide additional control events that get around the problem other ways. For example, many cars can turn into hover vehicles for just this reason. Somewhat fewer vehicles can "hop." I use both these techniques in the Elemental, as well as llApplyImpulse in some situations.
|