05-07-2006 21:00
So anyway I've been playing in a sandbox on preview, and at first I was thinking... wow, did they finally implement Havok 3? Everything is so smooth and easy...

I have a huge chain-link set in my inventory. About 8 toruses (torii?) 10 meters long. Turn off physics on one in the sky, and let it ....swing...... back....... and ...... forth....... so so silky smooth, no Deep Thinks, none at all.

Okay, put that away, get out my 15-link rollerchain assembly, with real chain links, and let it hang freely, watch it dynamically swing around.

I then yank on the links and TRY to make it Deep Think, but it doesn't. I can yank so hard on it that I can visibly see the links pull out of alignment so they overlap, and still it keeps together, sim load only 26 ms or so per frame.



But then came the discovery, it's really just the same old physics engine.

It just worked so nicely because the sandbox is completely empty of anything else to process. If I put three or four chain link assemblies in the sim (60 physics objects) the sim starts to exhibit all the same bad old Deep Think habits. Exploding objects, chains that float apart and disintegrate..


And it appears there's a way to cause incredibly bad Deep Think that I didn't know about before. It's called Shift-drag duplicating.

If I select the entire chain and shift-drag off a copy, the sim locks HARD, sometimes for several minutes. The first time this happened I was certain the sim was a goner, but it did come back after two minutes.

For a moment the stats said the Sim physics time was 80,000 msec/frame. Ack!

It appears that this happens because the duplicated objects become immediately physical, when the original objects are still in the SAME LOCATION as the duplicates.

It takes a moment to drag the objects to the side, but before I can do that it's already trying to resolve physical objects precisely overlapping with non-physics selected objects, causing this incredibly deep think from hell.



Finally, with these Deep Thinks that can be controlled and triggered on demand (I'd NEVER try this in a live sim with people around), I've discovered that physics are somewhat interpolated on the client side.

When the server sets an object in motion, the client keeps that object moving in a straught line along that path, until it receives a course and position update from the sim.

So if you have an object following a curving path in the sim, and a Deep Think occurs, the object will just wander off in a straight line at the speed it was originally moving. The object keeps on going until another update arrives, at which point the object suddenly seems to jump back to the original path and keep moving that way.

The free-swinging chainlinks will just.... float away.. when a Deep Think occurs, like a slo-mo explosion, then suddenly the parts fly back when the sim resumes a few seconds later.


I've seen an effect similar to this when trying to access SL via Dial Up (masochistic, I know) but with editor objects instead. The object editor window is first and foremost a client-side interface, though it sends data to the server, and can be forced to certain settings by the server. When you edit an object the changes first occur in your client, and the changes are sent along to the server too.

So, rapidly move and object up and down in the object editor on dialup, and then set it to some position. Due to dialup lag, after you set the position of the object, a stream of delayed positions comes back to the client, and the object can be seen jumping around a few seconds AFTER you stopped editing it.



This will probably become a suggestion, but the shift-drag Deep Thinks can be prevented. Give the engine a way to detect when physical objects have just been duplicated by Shift-dragging, and delay turning on physics for the duped objects for about five seconds. That would give time for the originals to move away and clear the duplicate objects, so an instant Deep Think on Duplicate doesn't happen.