Jump to content

Accounting for Time Dilation


Coffee Pancake
 Share

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

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

Recommended Posts

Playing with some script and needed to factor time dilation into a timeout .. this seems to do the job.. anyone got anything better?

float time_factor = llGetRegionTimeDilation();
time_factor = (-llLog(time_factor))*(1/time_factor)+1;

time dilation = time_factor
 1.000000 = 1.000000
 0.950000 = 1.053993
 0.900000 = 1.117067
 0.850000 = 1.191199
 0.800000 = 1.278929
 0.750000 = 1.383576
 0.700000 = 1.509536
 0.650000 = 1.662743
 0.600000 = 1.851376
 0.550000 = 2.086977
 0.500000 = 2.386295
 0.450000 = 2.774463
 0.400000 = 3.290729
 0.350000 = 3.999494
 0.300000 = 5.013247
 0.250000 = 6.545184
 0.200000 = 9.047200
 0.150000 = 13.647490

 

Link to comment
Share on other sites

I'm not sure how you're using that. It would help if you included some testing apperatus. For example, to have a timer last 10 seconds regardless of time dilation:

integer gTimeUnix;
float gTimeWantedTimer = 10;
default
{
    state_entry()
    {
        gTimeUnix = llGetUnixTime();
        llSetTimerEvent(10.0);
    }

    timer()
    {
        integer curTimeUnix = llGetUnixTime();
        llSay(0,(string)(curTimeUnix-gTimeUnix));
        gTimeUnix = curTimeUnix;
        
        // time dilation adjustment test //
        // float time_factor = llGetRegionTimeDilation();
        // time_factor = (-llLog(time_factor))*(1/time_factor)+1;
        // end time dilation adjustment //
        
        llSetTimerEvent(llGetRegionTimeDilation() * gTimeWantedTimer);
    }
}

I'm having trouble finding anywhere that has significant time dilation to test with though. Most time dilation I did see in a few random pops around zindra happened in very short bursts, with dilation remaining somewhat stable around 0.99 to maybe 0.95.

Link to comment
Share on other sites

My use case is a plugin based script doing a cold start with full reset of all scripts, and needing to extend a given time out based on a single sampling of time dilation (which may not be representative of average region performance). The time out triggers user feedback and is inconsequential from an operational perspective (any plugin taking longer will not break final operation).

I was really just curious if anyone had a tested more robust method :)

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1088 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...