Jittery vehicle
|
|
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
|
08-29-2007 06:36
I am trying to help someone out by looking at a vehicle script someone else put together. I am not *at all* proficient at scripting vehicles. I know the basics, but thought someone else might be able to point me in the right direction on this one.
The basic problem is perhaps two-fold. 1. When I *sit* in/on the vehicle, it switches to physical. Then, if I start it very far above the ground, gravity will bring it down, but nothing seems to actually touch the ground. It almost seems to hover. (This is a car, by the way).
2. Along with that, it twitches. Constantly. Like a three-year old trying to sit through a lecture on particle physics.
Any ideas for what to check/tweak?
thanks, Baron
|
|
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
|
08-29-2007 07:18
If it never touches the ground on any point of the vehicle...then the hit box for the av is and it's trying to balance on the av...which would look rather jittery. Even if the animation for the AV has it completely clear, this kind of thing can happen. Easiest way to test is to make the sit target go up a few meters and see if the jitteryness goes away.
|
|
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
|
08-29-2007 07:44
The car is at zero rotation. I raised the sittarget up to 3.0. Still jitters. When I rotate the camera, I can see between the bottom of the wheels and the floor. Any other ideas?
|
|
Shadow Subagja
Registered User
Join date: 29 Apr 2007
Posts: 354
|
08-29-2007 08:13
how is the vehicle built, what is in the script?
|
|
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
|
08-29-2007 08:21
Right now, vehicle is a "floorboard" with 4 wheels attached. When avatar sits, vehicle becomes physical.
The script becomes rather large, a memory check shows only about 450 bytes left at one point. I'm reluctant to show much of the script here as it is the work of another scripter; I have been asked to try to discover this and another problem and fix them if I can.
I'm sorry I'm being kind of vague. I just thought this might be some "normal" issue that others have dealt with. If not, I'll just continue to tinker around and see if I can find something.
Are there any particular things that you are asking about, Shadow?
|
|
Boss Spectre
Registered User
Join date: 5 Sep 2005
Posts: 229
|
08-29-2007 09:06
From: Tiarnalalon Sismondi If it never touches the ground on any point of the vehicle...then the hit box for the av is and it's trying to balance on the av...which would look rather jittery. Even if the animation for the AV has it completely clear, this kind of thing can happen. Easiest way to test is to make the sit target go up a few meters and see if the jitteryness goes away. On a side note to all vehicle makers... the bounding box for a sitting avatar is not affected by any offset in the animation, it's still located at the sit target. You can see where that sit target places the bounding box by turning off the script momentarily and sitting again. The best poses for sitting in vehicles have a minimal hip offset, so that the bounding box stays where you want it.
|
|
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
|
08-29-2007 09:49
Okay . . . I tried a couple more things. I stopped the script and sat. I was sitting with my feet above the floorboard. I raised the sittarget higher, feet way above the car. Turn on script, still jittery when I sit down. When I get off, jitters stop (even when I keep the car physical). I also tried commenting out vehicle flags like vertical attraction, hover, and anything that did not say "linear" or "angular" in the description. Still the same. I may just give up soon 
|
|
Shadow Subagja
Registered User
Join date: 29 Apr 2007
Posts: 354
|
08-29-2007 11:08
did you try raising the actual prim that contains the sit target? I think what was suggested may be that you still look like a rectangle of full standing height to the physics engine, and as though you are right on the non-altered sit target. So by moving the target around you only fool the visual representation but may actually still have your 'feet' sticking out the bottom.
if you move the chair up, you should go with it.
forgive me if I misunderstood.
|
|
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
|
08-29-2007 11:55
You didn't misunderstand, but the sit target is key in what me and Boss were explaining, which he's found that isn't the issue. What is the bouyancy of the vehicle set to, or is it set at all? I would try adding negative bouyancy if it doesn't have some already...I've found that some negativite setting sometimes helps hold it on the ground better. Especially on faster cars. The only car I've made jitters a little bit, but only when you start hitting the turn buttons while it's sitting still since the wheels turn, but the car does not, and should be expected since they're part of a physical object sitting on the ground. Edit: Also, what kind of prim are the wheels? Are they all the same height and sitting at the same global height on perfectly flat ground? I'm also assuming that the root prim is oriented perfectly at 0,0,0.
|
|
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
|
08-29-2007 12:08
I really appreciate the continued help.
I tried raising the floorboard (which is the root prim) relative to the wheels. Did not help.
I checked to make sure that the wheels all have the same z-position.
I tried rotating the sittarget 45 and 90 degrees so that if the bounding box is like a standing rectangle, this way it would be like a lying-down rectangle.
I tried setting the buoyancy from 0 to -5.
Nothing affected the jittering. I'm not moving the car at all yet. Just sitting down, physics going on, the jittering begins. The owner of it said that when driving, it sometimes causes the vehicle to slam to a halt or something along those lines.
I'm just plain running out of ideas.
|
|
Boss Spectre
Registered User
Join date: 5 Sep 2005
Posts: 229
|
08-29-2007 15:36
Do you happen to be wearing a "movelock" or anti-push attachment?
|
|
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
|
08-29-2007 19:14
Nope, I'm wearing nothing of the sort. The only attachments I've got are 1) a hug attachment and 2) a hat that I scripted to play a bow animation.
|
|
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
|
08-30-2007 04:43
It's really almost sounding like the root prim is misaligned somehow.
Bouyancy only goes from 1.0 to -1.0 btw.
If you rotate the vehicle to <0,0,0>, what direction is the front-end facing?
|
|
Virrginia Tombola
Equestrienne
Join date: 10 Nov 2006
Posts: 938
|
08-30-2007 08:54
I've seen something akin to the jittery vehicle before. The vehicle would wobble a bit and start a slow drift.Oddly, the jitterring would get worse when the avatar would wear an attachment (like the rest of the vehicle).
To be honest, I used voodoo. I would fiddle about with where the root prim was, adjusting sitpos as necessary. Lower seemed to help. I also added a stabilizing prim as a base (no-texture), which I suspect cut down on the issue by increasing the vehicle's mass and increasing friction with the ground.
Don't know if that will help in your situation.
|
|
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
|
08-30-2007 09:35
That's another thing to try...with a car, there is sometimes a cut cylinder that actually runs along part or all of the underside of the car. It helps with climbing and balancing.
If the rotation check I gave above doesn't help, try making the wheels either cylinders or tubes if they aren't already...see what that does, then try adding a 'sled' as I mentioned and see what happens.
Vehicles are some of the quirkiest things in SL to get just right.
|
|
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
|
08-30-2007 12:26
Rotating <0,0,0>, it is facing East.
Tried a half-cylinder running along the bottom, front to back. With physics off, it is sitting against the ground, like the wheels. As soon as physics was turned on, it rose up the same as before and started jittering. Then, I lowered the cylinder. And the whole car rose up so that the cylinder was the same level above the ground.
???
(Oh, and I set buoyancy to -1)
|
|
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
|
08-30-2007 12:51
Hmm..ok well...beyond those build and setup tests, the only thing I can think of at this point is something in the code.
If you can get your hands on the freebie car script that most cars use (even if it's no mod) you could try substituting that into another build of the car and see if it still jitters.
My fear is that perhaps the car uses some sort of applied force to break the normal vehicle speed barriers (most cars do), and that maybe it's not resetting down to 0. It could be some number that isn't enough to overcome the vehicle's mass, but enough to make the physics engine react to cause it to try and fall.
Or maybe the scripter has a constant downward force applied to try and keep it on the road better?
Basically this is the point where I would rip into the code...with the answers you've given to the tests, it doesn't seem like an AV hitbox or build issue. I would look for appyimpulse and setforce to see what, if any, they might have used and conduct tests from there if necessary to see if it's resetting to 0 when the vehicle is not in motion.
From the pattern you described where the vehicle will sometimes stop, it could be that a downward force is being calculated dependant upon the vehicle's speed, and the multiplier is set too high, which causes it to never actually turn off, even if the velocity is close to 0, and then gets too strong....essentially forcing the vehicle into the ground.
|
|
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
|
08-30-2007 13:37
Well, I did a little more hunting in the script and could not find any sort of force applied to it *as soon as I sit down*. I finally gave the script back to its owner and told him, "I give up." I think I'll stay out of vehicles and more safely in my own scripting element.  Thanks for all the help and suggestions. I really appreciate the availability and generosity of the people here! Baron
|