• All submissions to this site are governed by Second Life Project Contribution Agreement. By submitting patches and other information using this site, you acknowledge that you have read, understood, and agreed to those terms.
Issue Details (XML | Word | Printable)

Key: SVC-763
Type: Bug Bug
Status: Reopened Reopened
Priority: Major Major
Assignee: Andrew Linden
Reporter: Ryozu Kojima
Votes: 12
Watchers: 5
Operations

If you were logged in you would be able to see more operations.
2. Second Life Service - SVC

All scripted physics calls fail a "physics deactivated" avatar

Created: 03/Oct/07 04:38 PM   Updated: 06/Sep/08 07:52 AM
Return to search
Component/s: Physics
Affects Version/s: None
Fix Version/s: Havok4 Beta

Issue Links:
Duplicate
 
Relates

Linden Lab Issue ID: DEV-3901


 Description  « Hide
Not sure the proper terminology, but I should clarify what I mean by "physics deactivated."
As I understand it, a collection of physical objects, and/or an avatar, once they come to a rest, are "deactivated" so as to save the physics engine cycles. Once a physical interaction is due to happen, they are reactivated and processed.

From my testing, once an avatar comes to a rest and is deactivated, any scripted physics call on that avatar fails. Persistent physics effects such as llSetForce or llMoveToTarget take effect once the avatar is activated, such as by the user moving the avatar. One-off physics calls such as llApplyImpulse or llPushObject simply fail, as their effect happens on an avatar that is not in the active state.

This applies to:

llApplyImpulse
llPushObject
llSetForce
llMoveToTarget

All physics functions excluding llPushObject must be in an attachment, and thus "part of the avatar" to affect the avatar. llPushObject may be called from an inworld object. Even when not attached, it still fails.

I'm guessing there should be a code path that each physics call goes through that just needs to activate the avatar before taking effect.

SVC-734 Falls under this but, although it only specifically names llMoveToTarget,



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Ryozu Kojima added a comment - 03/Oct/07 04:41 PM
Whoops, meant SVC-734, not SVC-760

Ryozu Kojima made changes - 03/Oct/07 04:41 PM
Field Original Value New Value
Description Not sure the proper terminology, but I should clarify what I mean by "physics deactivated."
As I understand it, a collection of physical objects, and/or an avatar, once they come to a rest, are "deactivated" so as to save the physics engine cycles. Once a physical interaction is due to happen, they are reactivated and processed.

From my testing, once an avatar comes to a rest and is deactivated, any scripted physics call on that avatar fails. Persistent physics effects such as llSetForce or llMoveToTarget take effect once the avatar is activated, such as by the user moving the avatar. One-off physics calls such as llApplyImpulse or llPushObject simply fail, as their effect happens on an avatar that is not in the active state.

This applies to:

llApplyImpulse
llPushObject
llSetForce
llMoveToTarget

All physics functions excluding llPushObject must be in an attachment, and thus "part of the avatar" to affect the avatar. llPushObject may be called from an inworld object. Even when not attached, it still fails.

I'm guessing there should be a code path that each physics call goes through that just needs to activate the avatar before taking effect.

SVC-760 Falls under this but, although it only specifically names llMoveToTarget,
Not sure the proper terminology, but I should clarify what I mean by "physics deactivated."
As I understand it, a collection of physical objects, and/or an avatar, once they come to a rest, are "deactivated" so as to save the physics engine cycles. Once a physical interaction is due to happen, they are reactivated and processed.

From my testing, once an avatar comes to a rest and is deactivated, any scripted physics call on that avatar fails. Persistent physics effects such as llSetForce or llMoveToTarget take effect once the avatar is activated, such as by the user moving the avatar. One-off physics calls such as llApplyImpulse or llPushObject simply fail, as their effect happens on an avatar that is not in the active state.

This applies to:

llApplyImpulse
llPushObject
llSetForce
llMoveToTarget

All physics functions excluding llPushObject must be in an attachment, and thus "part of the avatar" to affect the avatar. llPushObject may be called from an inworld object. Even when not attached, it still fails.

I'm guessing there should be a code path that each physics call goes through that just needs to activate the avatar before taking effect.

SVC-734 Falls under this but, although it only specifically names llMoveToTarget,
Ryozu Kojima made changes - 03/Oct/07 08:28 PM
Link This issue is related to by SVC-737 [ SVC-737 ]
Andrew Linden made changes - 10/Oct/07 04:38 PM
Assignee Andrew Linden [ Andrew Linden ]
Andrew Linden added a comment - 10/Oct/07 04:42 PM
I think this is fixed.

I had a hack in the avatar controller where I was actually setting the avatar "keyframed" (much like typical static content in SL) to get it to actually stop when standing on a slope – otherwise it would slowly creep down the hill, even for very shallow slopes. I was finally able to get the avatar to stop on a hill without using the keyframe hack, so I pulled it out --> scripted pushes should now move the avatar when it has "stopped".


Andrew Linden made changes - 10/Oct/07 04:42 PM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed Internally [ 7 ]
Ryozu Kojima made changes - 10/Oct/07 09:51 PM
Resolution Fixed Internally [ 7 ]
Status Resolved [ 5 ] Reopened [ 4 ]
Ryozu Kojima added a comment - 10/Oct/07 09:52 PM
Verified fixed in current Second Life Server 1.18.2.71480 beta

Ryozu Kojima made changes - 10/Oct/07 09:52 PM
Resolution Fixed [ 1 ]
Status Reopened [ 4 ] Resolved [ 5 ]
Ryozu Kojima made changes - 10/Oct/07 09:56 PM
Status Resolved [ 5 ] Closed [ 6 ]
Ryozu Kojima made changes - 10/Oct/07 09:58 PM
Status Closed [ 6 ] Reopened [ 4 ]
Resolution Fixed [ 1 ]
Ryozu Kojima added a comment - 10/Oct/07 10:07 PM
Hmm, maybe spoke too soon.

There is one minor issue, a little less likely to occur than before.

1) Place the following script into a prim
/////////default
{
touch_end(integer total_number)

{ llSetColor(<0.0, 1.0, 0.0>, ALL_SIDES); llMoveToTarget(llGetPos() + <0.0, 0.0, 10.0>, 0.05); llSetTimerEvent(5.0); }

timer()

{ llSetColor(<1.0, 0.0, 0.0>, ALL_SIDES); llStopMoveToTarget(); }

}
/////////
2) Attach prim,
3) Touch prim, it will turn green, and you'll move 10m into the air
4) Wait 5 seconds, the prim will turn red
Observed: Avatar stays in the air
Expected: Avatar should fall when llStopMoveToTarget is called.

That's one issue. Related

1) Follow the previous repro, while standing on slopped ground
2) Once you get to stop 4, and you're suspended in air, tap the left arrow to rotate your avatar slightly.
3) Once rotated, you'll fall. A few moments after landing, touch the prim again
Observed: Avatar does not move
Expected: Avatar should again move 10m into the air


Andrew Linden added a comment - 11/Oct/07 07:27 PM
I've fixed this in the internal repository; it should be in the next update to the Havok4 preview.

The problem was that when LSL actions (hover, moveto, buoyancy, etc) were created/deleted the code was only trying to wake up the objects that owned the scripts, in this case attachments which were not in the physics engine. I had to add logic to detect and walk up to the avatars to which they were attached and activate its RigidBody. There was some oddities in how Havok4 would sometimes not wake up the body even though we had tried to set it active, but I already had some hackery for getting around that problem, so I invoked it in more places (around the avatar) and that seemed to solve that weirdness.


Andrew Linden made changes - 11/Oct/07 07:27 PM
Resolution Fixed Internally [ 7 ]
Status Reopened [ 4 ] Resolved [ 5 ]
dan linden made changes - 19/Oct/07 05:54 PM
Linden Lab Issue ID DEV-3901
Torley Linden made changes - 21/Dec/07 12:03 PM
Resolution Fixed Internally [ 7 ]
Status Resolved [ 5 ] Reopened [ 4 ]
Torley Linden added a comment - 21/Dec/07 12:03 PM
========-
Changed status to "Fixed" – I'm going through the Issue Tracker and updating issues that've been publicly fixed!
========-

Torley Linden made changes - 21/Dec/07 12:03 PM
Status Reopened [ 4 ] Closed [ 6 ]
Fix Version/s Havok4 Beta [ 10171 ]
Resolution Fixed [ 1 ]
Rob Linden made changes - 22/Dec/07 01:52 AM
Workflow jira [ 15717 ] jira-2007-12-21 [ 23462 ]
Rob Linden made changes - 23/Dec/07 12:34 AM
Workflow jira-2007-12-21 [ 23462 ] jira-2007-12-22a [ 49391 ]
Johan Durant made changes - 03/Apr/08 07:58 AM
Link This issue is duplicated by SVC-1994 [ SVC-1994 ]
Johan Durant added a comment - 03/Apr/08 08:01 AM
I made a new bug report about this issue before I realized I could reopen a closed report. As indicated on SVC-1994, I am encountering this issue with a swim attachment I made. llSetForce is not affecting the avatar while hovering, but does work if the avatar is moving when the force is applied.

Incidentally, note that llSetForce does work if the force is large (like 20 or so) but isn't working if the force is smaller (for my swim I was slow movement, with a force of 9.) Perhaps the reason you thought this bug was fixed was that you were only paying attention to large forces?


Johan Durant made changes - 03/Apr/08 08:01 AM
Resolution Fixed [ 1 ]
Status Closed [ 6 ] Reopened [ 4 ]
Sean Buridan made changes - 06/Apr/08 04:01 PM
Link This issue Relates to SVC-2098 [ SVC-2098 ]
Vandalite Defiant added a comment - 09/Apr/08 09:32 PM
I was performing some tests with my (now no longer working) flight assist and i have some extra detail about it.
Seems, any avatar with flight controls disabled (and processed by a script instead) are 'damped' down to no movement. Applying forces to an avatar while it's damped means it moves very little or none at all. It seems the threshold to 'breaking out' of this lock is to make the avatar move the next physics loop of around 20meters/second I had to use llSetForce(400,FALSE) just to do this!

My script 'ramps up' the force it applies over time, to simulate acceleration but the new havok means i sit still while the forces ramp up until i break out of the lock. Then i'm suddenly (VERY suddenly) accelerating to about 45 meters per second until i slow down.

physics behave normally again while i'm moving but if at any point my speed falls below about 20m/Second, the damper kicks back in and I can't move again until i really amp-up the force again.

Strangely enough, this damper works on UN-assisted flight. I can use my assist to go up to 2km, well over the flight limit and then stop. If I then take off my assist, i will NOT fall! This damper seems to override even gravity! If i use my movement controls, I will return to normal, losing altitude even if i try to go up, but the moment I stop using the controls, i stop falling! I would expect to fall to the flight limit and then hover there.

I know it's a damper of some sort because while my flight assist is ramping up the force, my avatar will make subtle movements in the desired direction, and then stop again.


Vandalite Defiant added a comment - 09/Apr/08 10:59 PM - edited
On sims with high lag, it takes even longer to break out of the damper which allows my flight assist to continue ramping up the force, but a constant force of 350 or so over a long enough period of time will break your avatar free and allow you to fly again.

Brandon Shinobu added a comment - 11/Apr/08 11:39 PM - edited
I could be wrong, but I'm afraid this isn't fixed. I recently encountered a situation where a small low-mass object was suffering these effects, like a buildup of friction. The object was to bob up and down 0.05m in either direction, slowly, so as to simulate a hover. I used almost the exact same script as a fully working object I had that was larger, and covered more distance, and the script worked in this small object too, for a matter of seconds. After a few bobs, without losing energy (it stays at a constant 1.0) the object simply stops moving altogether. It does not move at all unless somehow interacted with, such as a collision, a left click, a right click, or even a camera shift (which is very odd) and then it resumes bobbing for a few more seconds, only to stop bobbing again. I have llOwnerSay in the at_target event to notify me of when it reaches its "up" and "down" positions, "click" and "clack" respectively, and those activate when I interact with the object or walk around with my avatar shifting the camera (not colliding with the object). It doesn't do it in bursts either, as though it were "catching up". It just starts for a few seconds, and stops again.

(quote of my problem as described elsewhere)
"All right, I'm having an issue with a phantom physical object. It's supposed to be bobbing up and down about 0.05m in either direction at a slow pace. It works, except that it inexplicably stops after a few seconds. If you click it, or even right click it, however, it resumes for a few more seconds, and then stops again. I checked its energy levels, and it's remaining at a constant 1.0 – not only that, it never changes, and it's a small object anyway, so it shouldn't be using up much energy. I'm using practically the exact same script I have in a larger object which works just fine indefinitely."


Brandon Shinobu added a comment - 12/Apr/08 12:19 AM
Further comment – Andrew, if you would like I can provide you with the scripts I'm using for replication.

Brandon Shinobu added a comment - 12/Apr/08 01:55 AM - edited
I'd like to make note that, strangely, even right-clicking objects around the immobile physical object triggers it to bob a few times before stopping again. Something isn't right here. Btw,the physical object is using llMoveToTarget to effect the bobbing motion.

Johan Durant made changes - 19/Apr/08 07:35 AM
Priority Normal [ 4 ] Major [ 3 ]
Johan Durant made changes - 22/May/08 11:11 AM
Affects Version/s 1.21.0 Server [ 10310 ]
Johan Durant made changes - 22/May/08 11:12 AM
Affects Version/s 1.21.0 Server [ 10310 ]
Johan Durant added a comment - 22/May/08 11:15 AM - edited
So is this bug still on the todo list to fix? I really hope that after Torley closed the bug in December this issue didn't fall off the radar, because it definitely is not fixed. I mean, Andrew was quite helpful when the bug was first reported, but no Linden has been here since I reopened the issue.

Same offer as Brandon, if you need me to send you a copy of my swim attachment then let me know.


Zrephel Tokugawa added a comment - 05/Aug/08 12:53 PM
It seems that physics calls work on standing avs now, but if an an avatar comes to rest while flying it's still immobilized.

Johan Durant added a comment - 06/Sep/08 07:52 AM
Adding to Zrephel's comment, physics calls are working now on an avatar touching the ground, but not one hovering in midair. The subtle difference from what Zrephel reported is that the av doesn't need to be standing; in the testing I just did, an av that was flying but sunk to the ground will work. Hopefully that bit of knowledge will help to track down this bug.

Specifically, the testing I just did was to try to use my swim attachment. It works with avs in flying mode in order to float them to the surface of the water. I found that physics calls worked fine when swimming on the ground (ie. the flying character is sliding on the ground) but still don't work right when swimming in water (ie. hovering above ground at water level.)


Sue Linden made changes - 13/Nov/08 12:07 PM
Workflow jira-2007-12-22a [ 49391 ] jira-2008-11-14 [ 81622 ]
Sue Linden made changes - 13/Nov/08 04:35 PM
Workflow jira-2008-11-14 [ 81622 ] jira-2008-11-14a [ 88631 ]