For consideration: timer resolution under LSL-SLua
tracked
Frio Belmonte
If the idea is to remove LSL-Mono entirely and switch existing scripts seamlessly to run on LSL-SLua, the higher timer resolution could cause issues, as someone was surprised how overly fast a game of theirs was running after changing the compile target.
For demonstration,
integer ticks = 0;
default {
touch_start(integer _) {
llSetTimerEvent(0.01);
llResetTime();
}
timer() {
if(llGetTime() >= 1) {
llOwnerSay("I ticked "+ (string)ticks + " times");
llSetTimerEvent(0);
ticks = 0;
return;
}
++ticks;
}
}
LSLO and LSL-Mono will report ~22-23 ticks, but LSL-SLua will report 45, as expected, but it could potentially break something relying on their fast timers not suddenly speeding up two-fold. I've no particular opinion one way or the other, but just figured it should be brought up in case it's relevant to future plans.
Log In
Nexii Malthus
Note that wiki mentions 0.022s delay for timer events: https://wiki.secondlife.com/wiki/LSL_Delay
At least when measured/checked by the wiki editor in december 2012 it was that delay. I also remember timers going down to per frame. I'm not sure when or how timers might have been ticking slower than they should be since I was not around SL for a while.
Frio Belmonte
Nexii Malthus Good info, I also was always under the impression they were capable of 1/45 until during this transition process when it turned out not to be the case right now, and I never was really relying on how fast "as fast as possible" is, but apparently some people did... a bit of a hairy situation
H
Harold Linden
marked this post as
tracked
Thanks, we'll have a look at this!
The core scheduling logic shouldn't have changed at all, and Mono _should_ be able to tick that fast, 45fps with such a simple timer tick is nothing. Wonder if there's some deeper bad behavior at play in the scheduler.
Frio Belmonte
Harold Linden I can't really vouch for the max timer rate
always
having been 22.5 tps for LSL, but based on the anecdote above it sounds like it's been built around. Really just spitballing, maybe if/when the time comes to move Mono scripts to LSL-SLua, they should have a grandfathered flag on their bytecode that they can't use more than 22.5 timer resolution, but a fresh compile gets the full 45?