Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

VEHICLE_BUOYANCY not working correctly

Rhombur Volos
King of Scripture & Kebab
Join date: 6 Oct 2004
Posts: 102
01-15-2005 18:33
I've been trying to find out what's wrong with this thing for nearly half a month now; i've given up.

The problem began when i decided to give my pod decoupled mouselook, for increased maneuverability and precision. That in itself worked fine, with some tinkering (there's always SL's built-in bugs on sim crossing, but i choose to ignore that due to the advantages decoupled mouselook gives).

I've managed to minimize the problem by changing values in the VEHICLE_LINEAR_FRICTION and VEHICLE_LINEAR_DEFECTION_* constants, but still the vehicle seems to lose altitude due to some kind of gliding motion.

Altitude gets transferred to forward/backward movement even though i've defined the vehicle as a balloon. None of the other constants seem to affect this problem.
I once fell for the temptation of using llSetBuoyancy(1.0), and ended up with choppy movement and _very_ buggy vehicle behaviour, especially when crossing sims.

Other problems include linear motion across the y and z axis being transferred into angular motion due to mouselook, llSetPos and llSetScale in child objects not working after the fourth or fifth call, despite working perfectly in debug when the physics are set to FALSE, and a few other minor problems that i can't remember right now.

Has anyone else had the same problem? Is there a solution?
Eggy Lippmann
Wiktator
Join date: 1 May 2003
Posts: 7,939
01-15-2005 18:42
Have you bug reported it?
Please do. There's definitely something broken on LL's side - who am I kidding - LOTS of stuff broken :)
If enough of us whine about it, they will have to investigate. My tour balloon (made by Hank Ramos) stopped working. I really miss it.
Faerell Stern
Retired nomad knight
Join date: 15 Oct 2004
Posts: 4
01-15-2005 18:47
mmm... ive been playing around with the script you gave me someday(so that i could try to find whats wrong with it), and if your prob is that the pod goes down, then the problem isnt that complex... i think theres still sth called HOVER_HEIGHT somewhere... and its set to 2... so that means your pod will hover down to 2 meters... dunno exactly how to fix it, but i think thats the prob...

(think...)

-Faerell Stern
(-Falky Silverheart)

*edit*
or maybe it actually IS that complex... but you should try to fix the HOVER_HEIGHT thing b4
Torley Linden
Enlightenment!
Join date: 15 Sep 2004
Posts: 16,530
01-15-2005 18:48
From: Eggy Lippmann
Have you bug reported it?
Please do. There's definitely something broken on LL's side - who am I kidding - LOTS of stuff broken :)
If enough of us whine about it, they will have to investigate. My tour balloon (made by Hank Ramos) stopped working. I really miss it.


Yeah. I remember that night.

I don't know what happened with the technical specifics but I do recall you, Eggmeister, trying to get the balloon working so dang hard. Ack... will it ever fly again? I hope so -- and then we can do our tour. :)
_____________________
Hank Ramos
Lifetime Scripter
Join date: 15 Nov 2003
Posts: 2,328
01-15-2005 19:43
I made my Touring Balloon open source in the hopes that someone more intelligent than me could make it work, and could bring about a better travelling experience with my balloon than I could ever have done. If others are having problems with buoyancy in their vehicles other than my pile of junk vehicle, then hopefully LL will investigage the problems with vehicle buoyancy.
Rhombur Volos
King of Scripture & Kebab
Join date: 6 Oct 2004
Posts: 102
Yes!
01-15-2005 22:56
From: Faerell Stern
mmm... ive been playing around with the script you gave me someday(so that i could try to find whats wrong with it), and if your prob is that the pod goes down, then the problem isnt that complex... i think theres still sth called HOVER_HEIGHT somewhere... and its set to 2... so that means your pod will hover down to 2 meters... dunno exactly how to fix it, but i think thats the prob...

(think...)

-Faerell Stern
(-Falky Silverheart)

*edit*
or maybe it actually IS that complex... but you should try to fix the HOVER_HEIGHT thing b4


You were actually onto something there :)
Although, from what i've learned, the HOVER_HEIGHT is a setting that defines the height where ground effect takes place (the effect seen in helicopters and hovercraft that enable them to hover close to the ground using less power than would be required at higher altitudes), using it as a variable instead of a constant actually gave results.
As you can imagine, setting HOVER_HEIGHT to say, 400 while at ground level would propel you upwards with the force determined in HOVER_EFFICIENCY.
But setting a new hover height whenever the script noticed that the vehicle was no longer moving, solved the problem quite brilliantly.
I also found it neccesary to set the script to set hover height back to 2 whenever the user presses the move down key, to avoid unneccesary force being applied upwards to a craft that only wants to go down.
At high altitudes, the pod still experiences the same problem, but to a much smaller degree than earlier. This most likely because of an upper limit for VEHICLE_HOVER_HEIGHT .

Here's the important part of the code i used:

currentpos = llGetPos();
llSetVehicleFloatParam( VEHICLE_HOVER_HEIGHT, currentpos.z );

This will work like a charm, provided that the VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT is set.

Thanks, Faerell :)
Dmitri Daguerre
Tortured Artist
Join date: 13 Mar 2004
Posts: 18
01-29-2005 16:06
For those of us who are "script-grok-challenged," would this apply to Hank Ramos' touring balloon? I miss mine terribly and most of my builds are centered around having a balloon ILS dock as the means of getting there (since my elevators keep losing their minds. =-)
Rhombur Volos
King of Scripture & Kebab
Join date: 6 Oct 2004
Posts: 102
01-31-2005 09:39
I imagine a balloon being able to achieve a stable hover with this solution, up to a height of 500m or so, as long as it is made of light materials. (i've noticed that buoyancy and hover height combined still isn't enough when your craft is large and made of metal)
Agatha Palmerstone
Space Girl
Join date: 23 Jan 2005
Posts: 185
02-01-2005 08:09
bump. Let's make some floaty stuff here, people. ;)
Reitsuki Kojima
Witchhunter
Join date: 27 Jan 2004
Posts: 5,328
02-01-2005 08:41
Trying to follow this thread, it seems disjointed, but a few comments.

HOVER_HEIGHT is junk. Unless your making a hoverboard or something, IE that just floats a few meters at most above the ground, resist the temptation to use this. It shouldn't even be in your script. And even if you /want/ to make one of those, there are other ways to do it. HOVER_HEIGHT can only be set to track ground, ground+water, or global... So the minute you go on a prim-based road, you have problems. About the only /good/ use of HOVER_HEIGHT is with boats.

For flying vehicles, HOVER_HEIGHT serves either no use or a bad one, depending on how you use it. If you use a linear motor on the Z axis to control altitude with a neutral-or-nearly-so vehicle, HOVER_HEIGHT serves no use.... It can actually produce drag downwards, in fact. Some old scripts used to use HOVER_HEIGHT as their method of altitude control, where pressing up or down would add or subtract from the HOVER_HEIGHT. This is a fundamentaly flawed method of flight, as it limits your vehicle to a max of ground + 100 meters of height.

llSetPos and llSetScale cannot be used on a physics-enabled object. llSetScale can /never/ be used, while llSetPos can only be used in child prims... I use llSetPos for landing gear. But your moving in relation to the root prim, of course.

As far as vehicles always seeming to sink or raise a little bit, it's an issue with BOUYANCY... Which isn't consistent at all altitudes. There are a couple of ways to get "Perfect hover" on a vehicle, but both ways require a bit of work.

The Z-axis = X-axis motion thing is a known problem. I've seen some people work around it, but I've never managed to completely thwart it.
Rhombur Volos
King of Scripture & Kebab
Join date: 6 Oct 2004
Posts: 102
02-05-2005 10:10
Righto.

As Grumpy pointed out, setting hover height does produce some friction to downward movement. This does not bother me, as it (to a certain extent) prevents people from running the vehicle into the ground.

For usage on balloons and hovering vehicles, like helicopters and decoupled mouselook vehicles, i see no reason why this simple solution should be avoided.

to Reitsuki Kojima: try to lighten your tone a bit.