Jump to content

Sim Crossing dead zone


Anna Nova
 Share

You are about to reply to a thread that has been inactive for 2216 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

When a boat or car or plane crosses a sim crossing there is a small, sometime not so small, time when control inputs are ignored.  I have a helicopter by Kelly Shergood that has a HUD with a light that is green when you can input and yellow when you will be ignored.  I wondered if it was possible to make such a HUD, and then the question:  how do you detect when you are in a sim crossing, so that you can change the color or HUD light?

 

Link to comment
Share on other sites

If you have just crossed a region boundary, of course, you can detect that with CHANGED_REGION in a changed event.  You might trigger a timer when that happens and turn on a yellow light for (arbitrarily) 5 seconds, and then turn it green again.  Or, I suppose, you could add a spatial test. If you are within 10m of the edge of the region (again, arbitrarily), assume that you are in the transition zone. 

Edited by Rolig Loon
  • Like 1
Link to comment
Share on other sites

10 hours ago, Rolig Loon said:

If you have just crossed a region boundary, of course, you can detect that with CHANGED_REGION in a changed event.  You might trigger a timer when that happens and turn on a yellow light for (arbitrarily) 5 seconds, and then turn it green again.  Or, I suppose, you could add a spatial test. If you are within 10m of the edge of the region (again, arbitrarily), assume that you are in the transition zone. 

Thinking of the  'spatial test',  the distance could be a function of speed and direction, I guess.

So your deduction is the same as mine, there is no way to know if the object that the HUD is associated with is in the dead zone, you have to infer it.

Link to comment
Share on other sites

2 hours ago, anna2358 said:

So your deduction is the same as mine, there is no way to know if the object that the HUD is associated with is in the dead zone, you have to infer it.

Correct. As far as I know the HUD's script will be paused. So, while you may be able to infer you were about to hit a crossing and do something in the last gasp, there is no way to actually do anything while it's paused. That all has to wait until the script is unpaused.

@animats is pretty much the expert on this topic now :D

  • Like 1
Link to comment
Share on other sites

Do we know why inputs are ignored in this "dead zone"? Or the logic of the green-light/yellow-light HUD? (Maybe that's what we're trying to figure out.)

A zero-th order guess might be that the HUD detects CHANGED_REGION and goes yellow until the associated vehicle is found to be in the same region. And maybe checks the avatar too (probably should, with @animats' findings). The problem with this is that the HUD may be the last of all those things to make it across the border, during which time the vehicle and the avatar may be on different sides of the border from each other.

On the other hand, I'm thinking control inputs can cross region borders anyway, so maybe it's only the vehicle script itself being paused that matters -- but still, how can that HUD reliably complete the crossing first to turn yellow?

Link to comment
Share on other sites

Kelly Shergood's HUD method is simple...

That indicator light is not an indicator that you are crossing a sim, it is an indicator that the HUD is connected to the vehicle

When crossing a sim border the sim you are leaving does a "hand-off" to the sim you are going into; the sim you are leaving now stops running your scripts and tracking your position, etc.. It passes all that information to the new sim. The new sim collects all that data then once ready implements it (that's why you "bounce back" to where you were at the crossing.)

When the old sim stops running script, the HUD loses connect with the vehicle = light goes yellow. When new sim implements everything and scripts are running again the HUD searches for vehicle and then reconnects = light goes green.

This also is why there is a slight delay from when everything is going again and the light turning green. I have even seen the HUD light blink yellow for a second then turn green again in the middle of a very laggy sim.

  • Thanks 1
Link to comment
Share on other sites

Interesting. That's a nice feature in a helicopter HUD. I haven't looked at HUD to vehicle connections. Vehicle to avatar connections definitely have a period of disconnection during sim crossings. A vehicle script can see three things changing during a region crossing:

  • During the region cross, the script may lose PERMISSION_TRIGGER_ANIMATION briefly. Trying to start or stop an animation during that period will cause a script permissions error.
  • The link from the vehicle to the avatar as a child prim remains valid throughout, but the link from the avatar back to the vehicle becomes NULL_KEY while the avatar is separated from the vehicle. Trying to start or stop an animation during that period will cause a "cannot find agent" script error.
  • The distance from the avatar to the sit position may briefly be large. This happens when the vehicle is moving and the avatar arrives in the new sim behind the vehicle. You sometimes see this in world as the avatar frantically zips to the sit position.

The CHANGED_REGION event for a vehicle means the vehicle has crossed. The avatars may still be catching up. When all three of the conditions above are satisfied for all avatars on the vehicle, the avatars are back in place and ready to go. The usual delay is about one ping round trip time (40ms US, 120ms Europe), but it can be much longer (seconds) if a message gets lost. Vehicle scripts see region cross failures as a CHANGED_REGION event where the avatars never catch up. Most of what we're doing to make region crossings work is to hold the vehicle locked stationary until the avatars catch up.

Let us know what you find out about HUDs and their connections. I haven't looked at the mechanics of HUDs at all. Do they run entirely in the viewer, or are they moved from sim to sim like avatars and vehicles? This might turn out to be related to the fragility of some clothing with HUDs at region crossings.

At a less technical level, it's useful to think of SL regions as islands. When you cross a sim boundary, you first go off the edge of the old region, and are then teleported to the new one. The illusion of a seamless world is created by the viewer, which talks to many sims at once.

  • Like 4
  • Thanks 1
Link to comment
Share on other sites

55 minutes ago, animats said:

During the region cross, the script may lose PERMISSION_TRIGGER_ANIMATION briefly. Trying to start or stop an animation during that period will cause a script permissions error.

For what it's worth, I have found that if I re-acquire PERMISSION_TRIGGER_ANIMATION (and any other permissions) and then re-animate and re-set camera params as I cross a region boundary, I get a much smoother crossing and no odd discontinuities in anims or camera params.  I have not tried this at extremely high velocities, but it works in land vehicles and in any aircraft I have used it in so far.

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

Yes, I reset camera params after a region crossing too. It gets the camera back on track.

It would be worth looking at the code in the viewer for camera control. It would work better if camera control was aware of region crossings. I think there's a bug where camera control briefly applies the position relative to one region to the location of a different region. That's when the camera suddenly gets hundreds of meters from the avatar, then zips back.

  • Like 2
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2216 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...