[Opensim-dev] How objects cross regions, at the message level. Questions.

John Nagle nagle at animats.com
Fri Nov 17 08:24:51 UTC 2023


I'm the guy coding the Sharpview viewer in Rust. The released demo
(at https://www.animats.com/sharpview, use username "devs", password 
"thread") only loads one region and you can't leave it or see others.
I'm working on supporting full grids. Current status is that I can
see neighboring regions come up, but can't cross into them.
So, some questions:

How linksets cross regions:

1. ObjectUpdate messages (compressed or not) contain the parent ID of
the parent ObjectUpdate. Parent IDs are region-local.  Each ObjectUpdate
also has a Object ID (a UUID) which is, I think, unique to that object
over the whole grid. Is that correct? Are there ever duplicate Object IDs?

2. When a linkset moves from one region to another, it is re-created
in the new region, with an object update for each prim.
This implicitly kills it in the old region. Sometimes a KillObject event 
is sent, and sometimes there is no KillObject event.

3. The object updates which create an object in the the new region
are not always in the same UDP message. So there are potentially
partially-created objects in the new region.

4. The obvious implementation is to just create the object in the new 
region, and kill it in the old region. But if you do that, it flickers
when crossing regions, because it's being completely rebuilt from
scratch. This looks bad. So the SL C++ viewer and the ones based on
it try to transfer the object tree (root and children) to the new
region when the object is re-created in the new region.

5. That may not work reliably. Transferring the object tree moves
it to a new region where the local IDs are all different. As the
object gets re-created in the new region, I think those bad values
get overwritten before they are ever used. Most of the time.
Whether this works may depend on object update order.
I'm not convinced that this is safe code. It may be the cause
of avatar attachments falling off at region crossings.
I am not sure about this. I don't see any code in the C++
viewers to fix parent IDs. Am I reading that correctly?

6. I'm thinking that the right way to do this is to
look up the Object ID for a parent ID and local ID as
soon as an object update is received, and index
everything viewer side by object ID. That way,
moving an object or object subtree to a new region
should be sound. Is that reasonable?

(OS and SL only allow a 3-level hierarchy now.
Worst case is vehicle/avatar/attachments. But
I code Sharpview assuming that a full hierarchy
is coming, because that is an accepted JIRA on the
Second Life side. When full glTF content loading
is added, that will probably go in, because glTF
has a full hierarchy, unlike COLLADA. So I want to get
the general case right.)


				John Nagle
				Joe Magarac (OSgrid)
				Animats Resident (SL)



More information about the Opensim-dev mailing list