Coffee Pancake Posted October 3, 2021 Share Posted October 3, 2021 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 More sharing options...
Quistess Alpha Posted October 3, 2021 Share Posted October 3, 2021 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 More sharing options...
Lucia Nightfire Posted October 3, 2021 Share Posted October 3, 2021 Any exponential influence will do. You might also have to trend either TD or FPS over some time length as they can change sporadically for a multitude of reasons. There are also cases where lag is present and TD is normal, but FPS is low. Link to comment Share on other sites More sharing options...
Coffee Pancake Posted October 3, 2021 Author Share Posted October 3, 2021 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 More sharing options...
Jenna Huntsman Posted October 3, 2021 Share Posted October 3, 2021 (edited) Could you use some sort of Delta time calculation based on the reported time dilation? Edit: What @Quistess Alpha said is a pretty good way of applying Delta time for scripts. Edited October 3, 2021 by Jenna Huntsman Link to comment Share on other sites More sharing options...
Recommended Posts
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