Qie Niangao Posted November 2, 2017 Share Posted November 2, 2017 (edited) 3 hours ago, Hadet Sonnenkern said: Any decent scripted would never script an NPC or Turret system using a sensor it is laggy, and in every way inferior to using AgentList for that sort of thing. Veering off-topic because it applies equally for Animesh and other scripted items: It's risky to say "never". Sensors are not inherently laggy, and can be more efficient than llGetAgentList() in a busy sim where most avatars spend most of their time outside the script's range of interest (unless that range can be made to correspond to a fixed parcel boundary). That's mostly because list operations are inherently slow in LSL, so there's real cost to stepping through a big list of agents checking their OBJECT_POS, especially if all of them end up irrelevant to the script. (Lists were way worse before Mono, but they're still painfully slow compared to native code.) It can also drive up dynamic memory use because it will return up to 100 avatar keys, whereas a sensor will always cap at the nearest 16 -- especially valuable if you're really just responding to the nearest one, and only if any at all are in range. Also, for NPCs and other systems that cross region borders, llGetAgentList() stops right at the line (in contrast to sensors that don't respect region boundaries, and llGetObjectDetails() that can see 34m into the next sim). It's certainly possible to share data between scripts across region borders, but that all adds complexity, too. It may help to realize that sensors and llGetAgentList have a lot in common behind the script library API, so efficiency inside the script drives most of the load. Edited November 2, 2017 by Qie Niangao 2 Link to comment Share on other sites More sharing options...
Innula Zenovka Posted November 4, 2017 Share Posted November 4, 2017 If I know I want my zombies to think about attacking only avatars within 20 metres or so, then I think under most circumstances I'd want to use llSensorRepeat on a slow timer to look for targets. While I can think of circumstances in which I'd rather use llGetAgentList, I don't think those would be particularly usual in that particular use case. Whichever way I do it, the simulator ends up doing the calculations, and I think usually it's almost certainly going to be more efficient to have the simulator filter out all avatars more than 20 metres away and then give me llDetectedPos(n) when I want it rather than to have the script tell the simulator to return llGetAgentList and then calculate the positions of everyone on the parcel, rejecting those more than 20 metres away. 2 Link to comment Share on other sites More sharing options...
Singerman Marquette Posted December 18, 2017 Share Posted December 18, 2017 Maybe 'Animesh' isn't a good name for this. There is, after all, a creator in Second Life who already uses that name for his brand of mesh items. Link to comment Share on other sites More sharing options...
Lucia Nightfire Posted December 18, 2017 Share Posted December 18, 2017 You mean the one that sells DBZ game rips? I think he's going to have to deal with it, heh. 1 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