|
Virrginia Tombola
Equestrienne
Join date: 10 Nov 2006
Posts: 938
|
06-21-2007 10:39
Hullo all, spotted an odd behavior in one of my vehicles. It's a cart, and uses the AP basic car script- /15/d0/11048/1.htmlWhen the rider gets on and the cart becomes physical, it trembles a bit, not very noticable, but if it sits for a while, it will actually start a slow drift to the side. It works fine when moving. Not an earthshattering defect, but it does bother me a bit. Rather like having a mustard stain on your skirt and being convinced everyone in creation can see it (well, fine, that was a not very random chosen example--where is club soda when you really need it?) The main modifications I've made to the script is adding sound and llSays for some of the key presses (the llSays coordinate animations of attachments), and setting float_forward_power as a integer variable that is changable with PgUp/PgDn And, I have a hunch that this line I changed might be important: I wanted the vehicle to be able to turn in place so I changed this (also did the right turn) [php} if(level & (CONTROL_RIGHT|CONTROL_ROT_RIGHT)) { cur_wheel_direction = "WHEEL_RIGHT"; angular_motor.z -= speed / turning_ratio * reverse; } [/php] to this: [php} if(level & (CONTROL_RIGHT|CONTROL_ROT_RIGHT)) { cur_wheel_direction = "WHEEL_RIGHT"; angular_motor.z -= turning_ratio * reverse; } [/php]
|
|
Virrginia Tombola
Equestrienne
Join date: 10 Nov 2006
Posts: 938
|
06-23-2007 12:27
Well, some troubleshooting on this--
*It only occurs when the cart is physical (perhaps obvious, but there we are)
*The cart shows no erratic behavior when moving, and the drift can be stopped by any key input (ie, a slight turn stops the drift)
*The very odd behavior is that it doesn't occur unless the driver avatar is wearing an attachment (about half the vehicle is worn as an attachment). The attachment has one listen state and periodic internal message links to activate some set alpha animations, but does not transmit llSay. Nor is the base vehicle transmitting when at rest.
Since the movement is a slight left drift, I put in a line to ensure the angular motor is off when the key is released (the following transcription is from memory), but I noticed no improvement.
[php} if(level==FALSE) { angular_motor.z = 0; } [/php]
|
|
Daten Thielt
Registered User
Join date: 1 Dec 2006
Posts: 104
|
06-23-2007 15:46
Make sure u dont have any llSetBoyancys in there, anything lower than 0 will try to make it float downwards causing it to tramble
|
|
Domino Marama
Domino Designs
Join date: 22 Sep 2006
Posts: 1,126
|
06-24-2007 13:16
Does it show the problem on level ground, or is it on a hill? You might be seeing a gradual slide down a slope. If that's the problem, then experimenting with the *_FRICTION_TIMESCALE values should help it come to rest.
|
|
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
|
06-25-2007 04:35
I've noticed this problem with just about every ground vehicle, so I don't know as there is a way to fix it other than forcing the vehicle to sit still if no buttons are being pressed...which that could just introduce new bugs. Another problem with every ground vehicle is they generate an insane amount of collisions and thereby lag. I've seen faster cars grind a sim to a halt before. Example is that I was never aware that a simple 2-wheel motorcycle should generate 4000+ collisions going a slow 10m/s on even ground (I made the ground even myself), but evidently SL thinks so under varying circumstances. Other times it will generate 500 driving at the same speed on the same line. My conclusion? SL physics engine is very touchy and obviously very buggy.
|
|
Virrginia Tombola
Equestrienne
Join date: 10 Nov 2006
Posts: 938
|
06-25-2007 08:41
Thanks for the help! *Buoyancy is not set (it's a modified version of the Aaron Perkins car script). *It happens on level ground, it wasn't on a slope. Playing with the friction sounds like a good idea, though. From: Tiarnalalon Sismondi I've noticed this problem with just about every ground vehicle, so I don't know as there is a way to fix it other than forcing the vehicle to sit still if no buttons are being pressed...which that could just introduce new bugs. Erg, yes. I already tried forcing the angular motor to zero when no keys were pressed--should have been anyway, but it was worth a shot. No effect. I suppose I could turn physics off whenever it stops, but the clunkiness of that makes me shudder. As you say, that sort of thing seems to inevitably glitch. From: someone My conclusion? SL physics engine is very touchy and obviously very buggy. AGREED! 
|
|
Virrginia Tombola
Equestrienne
Join date: 10 Nov 2006
Posts: 938
|
Update
06-28-2007 08:05
Well, I played a bit more with the vehicle. First I increased the friction parameters for angular and linear. That seemed to help a bit, but if it sat still long enough, it still started drifting.
So, I played around with the actual vehicle design a bit. The original root prim was at the top of the vehicle and behind, and going on a hunch, I created a new, transparent root prim and put it underneath where I wanted the center of mass to be. Then I played about with sitpos to get the driver back in the high and behind seat.
Lowering the root prim helped a lot--I increased its size and the vehicle became even more stable.
To be honest, this is more alchemical than scientific; I'm not quite sure WHY it works now and it didn't before. The SL physics engine is still fairly incomprehensible to me, but I shall use what works!
|