Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Joints - why they fail and what to avoid (bug report)

Scalar Tardis
SL Scientist/Engineer
Join date: 5 Nov 2005
Posts: 249
01-13-2006 21:53
I'm trying to decide if this is an appropriate topic to discuss, since it involves describing ways to potentially cause a sim to lag horribly or outright crash.

But I'm of the opinion that if the joint problems can be laid bare publicly, perhaps some coding effort will be done to fix the problems.


This discussion is rather long so I'm going to break this up into a series of posts. Also, there will be a large number of screenshots in this thread documenting these problems so people can clearly understand what I'm talking about.
Scalar Tardis
SL Scientist/Engineer
Join date: 5 Nov 2005
Posts: 249
01-13-2006 21:53
1. There's something odd about location 0,0,0 in a sim

In certain conditions, jointed objects have a tendency to erroneously jump to (or near) location 0,0,0 in a sim. Here is a screenshot of a jointed object jumping to (0,0,-1.696) in the Island Sandbox:



This location is not easily seen normally, because 0,0,0 is about 20 meters below "ground" level in the Island Sandbox. It's only visible here because this is a sandbox sim, and the camera is hanging out over the edge of the sim-world looking down.

For regular land where the border is continuous, you cannot see this bugged prim sitting near 0,0,0:



For a situation like this you need to use the debug menu (Ctrl-Alt-D) and at least turn off the surface patch (Ctrl-Shift-Alt-5) to see it. Here I've also turned off the Ground and Water rendering in Debug to show it clearly:



Since ground level here is 80 meters above 0,0,0 I can't directly edit the object -- it's out of normal editing range and there's no way for me to move closer. But I can at least right-click on it to show its coordinates (0, -12.344, 0) and edit, take, or delete it.



Note that it asks if I want to try sitting here. I haven't tried that, don't think it's a good idea.. :)
Scalar Tardis
SL Scientist/Engineer
Join date: 5 Nov 2005
Posts: 249
01-13-2006 22:34
2. Multiple joints jumping to same (0,0,0) spot

Here we have an array of 12 pairs of jointed spheres near the (0,0,20) edge of the Island Sandbox. Each pair is one joint.



As can bee seen here, these 12 hinge joints will all happily jump to the same exact spot at (0, 0, -3.375) if you move them incorrectly:



This has the potential to cause some serious sim Deep Think and lag, if you're not careful.
Scalar Tardis
SL Scientist/Engineer
Join date: 5 Nov 2005
Posts: 249
01-13-2006 23:11
3. Jointed objects can fly way off into the negative position

If you make a certain kind of mistake moving jointed objects, it's possible for the joints to completely screw themselves up and fly way off-sim, to negative positions far beyond anything that can be considered normal.



Yet this is still just Sandbox Island, and these objects are on this sim, even if they do happen to be positioned far beyond -40 on the y axis in these screenshots.



The furthst ones managed to fly out as far as (33.564, -133.885, -8.580) yet the sim is still happy and running smoothly, no hiccups..



Whoah.
Scalar Tardis
SL Scientist/Engineer
Join date: 5 Nov 2005
Posts: 249
01-13-2006 23:47
4. Why no joint fixes after all these revisions?

You might wonder how such problems could occur without being noticed. I think the main problem is a case of out of sight, out of mind.

Here is the normal view of the Sandbox Island. Nothing seems to be out of the ordinary, but if you look really hard you'll see those rogue spheres faintly, off in the distance. You really have to look for them, though.



These particular spheres, lurking way off-sim, only show up when I turn off the Water rendering in the debug menu, as shown here:

Scalar Tardis
SL Scientist/Engineer
Join date: 5 Nov 2005
Posts: 249
01-14-2006 00:13
(Time for some sleep. I'll post more on this topic later.)
AJ DaSilva
woz ere
Join date: 15 Jun 2005
Posts: 1,993
01-14-2006 01:33
Since I'm here...

I'd guess that joints will work when Havoc 2 is implimented, and for this reason they're being left as-is for now and we're told not to bother with them (although some people have found novel uses for them in spite of their great bugginess).

I'm of the opinion that Havoc 2 most likely will come with SL 2.0.

I've heard rumors that SL 2 is expected sometime in the first half of this year.

Not much, half speculation, and not really all that useful. But it's some stuff I had in my head that was relevant. :p
_____________________
Kairen Overdrive
Registered User
Join date: 12 Jul 2005
Posts: 38
01-14-2006 03:48
I have noticed that you should never move the child object of the jointed objects and there will be no problems.

Also the axis for hinges is mostly along the +X axis when linking with hinges.

Hinges can be used for rezzing and de-rezzing if you select both objects and take them into inventory correctly.

I have managed to make some nice theme park rides.
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
Is the problem in the joints, or the editor?
01-14-2006 07:46
I've had problems with prims in linksets jumping to ludicrous locations when editing, and whole objects jumping to <0,0,0>, without joints being involved. It's rare, though, and I haven't been able to reproduce it when I've tried... I think there's something funky in the editor and joints are just tickling the bug more reliably.
Scalar Tardis
SL Scientist/Engineer
Join date: 5 Nov 2005
Posts: 249
01-15-2006 11:05
5. Max editing distance is about 63 meters

This is an important detail to mention. The furthest distance you can be away from an object and still be able to edit it is very close to 63 meters.

Here's a jointed object that jumped to (0,0, -4.246). I can select it for editing if I stand at (0,53,26) but not if I stand at (0,54,26).

http://www.jpj.net/~scalar/sl/debug/joint-jumped13.jpg

Since I'm aligned on the x-axis with the object, I form a right-triangle with the object, and I can calculate the distance between me and the object using the usual a^2 + b^2 = c^2 formula.

In range: square root((55^2) + (30.246^2)) = 62.7679896

Too far: square root((56^2) + (30.246^2)) = 63.6460566

(There's a little slop in the distance because it only reports your avatar location down to the meter, but sub-meter differences can make it editable +/- 1 meter from about 64 meters.)
Keknehv Psaltery
Hacker
Join date: 11 Apr 2005
Posts: 1,185
01-15-2006 12:50
I believe the maximum editing distance is an intentional addition. Just as they don't let your camera move too far away, they don't let you edit things too far away. This might be related to convenience of editing-- you can not move the camera in a full rotation at that distance. The camera is most likely constrained to make spying more difficult.
Scalar Tardis
SL Scientist/Engineer
Join date: 5 Nov 2005
Posts: 249
01-15-2006 13:01
6. sitting on jumping-joints moves you below ground

Well, my curiosity got the best me. I sat on a joint I knew would jump if I moved it, and whaddaya know, I'm sitting below the world at (-4,-13,-10).

http://www.jpj.net/~scalar/sl/debug/joint-jumped14.jpg

Note, the sim itself does not care. No problems, no lag.


I was too afraid to try standing up, but teleporting home worked with no problems.
Scalar Tardis
SL Scientist/Engineer
Join date: 5 Nov 2005
Posts: 249
01-15-2006 13:09
7. physics-enabled child joints and joint-jumping

You probably know that physics turns off when you are editing an object. When you let go, physics turns back on and the object moves/falls.

The editing distance limit creates a problem here, because if you are further away from 0,0,0 than 63 meters and you accidently make the jointed physics object jump to (0,0,0), physics will turn on when the object appears at (0,0,0).

If it's just one jointed physics object, you see a bizarre fly-away, fly-back effect. The jointed child seems to fly away, then fly back to you. Why?:

1. The editor joint-movement bug makes the object fly to near 0,0,0

2. When it arrives at 0,0,0, editing mode turns off because you are too far away to edit it.

3. Physics on the object re-enables

4. The object flies back to the parent object, because of the springy tension of the joint yanks it back.


This flying around is really quick, so it's a bit hard to get screenshots of this. :)
Scalar Tardis
SL Scientist/Engineer
Join date: 5 Nov 2005
Posts: 249
01-15-2006 13:30
8. multiple physical child jumping-joints create sim lag

This is the important one, probably the biggest problem of them all.

Recall item #2 where multiple selected joints will all jump to the same spot? This is where the massive sim lag comes from if you are trying to move around several objects with physical joints.

1. When you move the multiple child jointed physical prims, they all move to the same exact spot near 0,0,0.

2. You are more than 63 meters away, so editing mode turns off, and physics turns back on.

3. This pile of objects near 0,0,0 are all sitting in the exact same spot and are centered perfectly on one another. The physics engine does not like this and starts thinking about it.

4. Before the objects manage to fly back to the parent objects, the overlapping-prim deep think sets in and starts trying to resolve the problem of multiple overlapping-physical prims.

5. If there are only a few objects (less than five) or so, the lag lasts only a second or less, and the objects will manage to separate and fly back to the parent objects.

6. If there are large numbers of these jointed physical prims (30+) the deep think gets really bad and can drag the sim down to a crawl because it cannot resolve so many objects occupying the same location.

7. If this goes on, the overlapping physical prims will separate, but will seem to orbit the sim in a manner that doesn't seem to help with the lag.


If you see this happen you must delete the parent objects ASAP, which will delete the child prims and clear the deep think. If you don't delete the parents right away, the deep think gets longer and longer and the sim quickly stops listening to clients because it's so intensely trying to resolve the overlap of 20+ objects. As it stops paying attention to clients, it misses keyboard/mouse events, including your attempt to delete the objects.


I'm not too keen on screenshotting me dragging the Sandbox Island sim to a crawl by demonstrating this problem..
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
01-15-2006 18:07
From: Scalar Tardis
6. sitting on jumping-joints moves you below ground
I got pushed below ground one time when I got tangled up with some irregular prim caverns too near the edge of the void. Similar view, except I wasn't sitting down.
Eggy Lippmann
Wiktator
Join date: 1 May 2003
Posts: 7,939
01-16-2006 05:28
We know joints are hopelessly broken. They're not going to fix them. It's probably just a Havok thing which will probably fix itself when they move to Havok 2.
They've been sort of trying to move to Havok 2 for A WHILE now :p
I'm told the code is a really old, spaghettified mess created by someone who isn't there anymore, so they are having trouble sorting it out.
Scalar Tardis
SL Scientist/Engineer
Join date: 5 Nov 2005
Posts: 249
01-16-2006 10:42
They are broken but not hopelessly. It's not the fault of the joint system that the editor makes objects fly off the world to 0,0,0. You just have to be very careful how you handle jointed objects, and they will work fine without any problems. I'm going to go into detail about that next, but it's been a very busy weekend so no time for it right now.

It looks a lot like it's just an editor bug, and something that may be easy to fix.

And really, the way joints are displayed in the UI could use some improvement to make it clearer how they work. I'm trying to figure out how to demonstrate it in-world. :)
AJ DaSilva
woz ere
Join date: 15 Jun 2005
Posts: 1,993
01-16-2006 10:45
IIRC joints are kinda prone to crashing sims though.

Anyone care to back me up or correct me?
_____________________
Beatfox Xevious
is THOUSANDS OF PEOPLE
Join date: 1 Jun 2004
Posts: 879
01-16-2006 11:10
From: AJ DaSilva
IIRC joints are kinda prone to crashing sims though.

Anyone care to back me up or correct me?

Crashing sims? I know they're buggy, but I can't say I've heard of a sim crashing because of joints. How would they need to be used in order to reproduce this?

I've sold hundreds of my jointed wind chimes, and never once have I received a complaint about them causing a sim crash. If someone here has seen this happen, by all means speak up!
_____________________
My Beatworks: Zephyr Chimes wind chimes, the KanaMaster Japanese kana tutor, and the FREE Invisibility Prim Public. Look for them at the Luskwood General Store in Lusk (144, 165).

"You have been frozen. You cannot move or chat. A pony will contact you via instant message (IM)."
- mysterious system message I received after making off with Pony Linden
AJ DaSilva
woz ere
Join date: 15 Jun 2005
Posts: 1,993
01-16-2006 11:18
From: Beatfox Xevious
Crashing sims? I know they're buggy, but I can't say I've heard of a sim crashing because of joints. How would they need to be used in order to reproduce this?

I've sold hundreds of my jointed wind chimes, and never once have I received a complaint about them causing a sim crash. If someone here has seen this happen, by all means speak up!
I've not seen anything first hand, or met anyone it's happened to. I just seem to remember reading threads in the forums where it was mentioned, maybe it's only under certain conditions or something. 'Course if you've used loads of them without any trouble chances are I'm remembering it wrong or read something incorrect.
_____________________