Xander Lopez Posted August 30, 2020 Posted August 30, 2020 Lets say you are scanning for list of avatar keys within 5 meters from you. Would llGetAngentList be better or llSensor would be better? lets assume the sim has 60 people. I know the fact that llGetAngentList scans for all avatars within the region and you can cherry pick those angels within 5 meters from you. when there are 60 people within the sim, wouldn't it be faster to just use llSensor?
Rolig Loon Posted August 30, 2020 Posted August 30, 2020 llGetAgentList isn't "scanning" anything. It's just returning a list of all people that the servers know to be in the region. You then need to filter that list with llGetObjectDetails and OBJECT POS to figure out which ones are within range. Again, no scanning involved. At worst, there's a small amount of script time in doing the filtering. There IS a limit to the number of avatars in the list, though. I believe it maxes out at 100. 2 1
Qie Niangao Posted August 30, 2020 Posted August 30, 2020 I think wading through the results of llGetAgentList will always win in performance. A couple of considerations, nonetheless: llSensor's detections will be sorted nearest-first, so the script could terminate processing when it gets to one that's further away than the radius of interest llSensor will only ever return 16 detections, if there are more than that in the radius of interest (a very real likelihood in the example of a 5m radius somewhere in a region crowded with 60 avatars), things get very complicated: to be sure the script hasn't missed anybody, it must divide up the sensing arc and repeat until it gets lucky enough that no more than 15 are detected in any of the arcs. This isn't impossible, but it's a pretty advanced algorithm that can involve an unbounded number of attempts. Although #1 may seem tempting, #2 falls off a cliff of complexity. 1
Wulfie Reanimator Posted August 30, 2020 Posted August 30, 2020 6 hours ago, Rolig Loon said: There IS a limit to the number of avatars in the list, though. I believe it maxes out at 100. The wiki agrees, but what I wonder is what happens when there are more than 100 avatars in a sim? (Since there's a "bonus capacity" for premium users.)
KT Kingsley Posted August 30, 2020 Posted August 30, 2020 Anyone with 110 alts able to test this? I wonder if the wiki caveat was written based on the old maximum region capacity, and not updated, or if it's a limit hard-coded into the function (in which case it could probably do with an update too).
Lucia Nightfire Posted September 1, 2020 Posted September 1, 2020 If it is a one-time use, you can check how many agents are in the sim with llGetRegionAgentCount() and if it is 17 (counting yourself) and under then llSensor() plus llDetectedPos() querying would be faster than looping through llGetAgentList() and querying each key with llGetObjectDetails() and OBJECT_POS. On 8/30/2020 at 1:01 AM, Wulfie Reanimator said: The wiki agrees, but what I wonder is what happens when there are more than 100 avatars in a sim? (Since there's a "bonus capacity" for premium users.) llGetAgentList() just caps at 100. Before skill gaming there used to be a casino with 100+ bots in it that had a 100k+ traffic rating everyday which was the best/only place to test. 1
Xavier Novelli Posted October 5, 2023 Posted October 5, 2023 GetAgentList allows for more avatars and more control over things like list sorting. In your case, A sensor would probably better since you're wanting to return such AVs in such a limited radius. Otherwise, with llGetAgentList you would have to filter results by distance to check if the AV was within 5 meters of you.
Rolig Loon Posted October 5, 2023 Posted October 5, 2023 24 minutes ago, Xavier Novelli said: In your case, A sensor would probably better since you're wanting to return such AVs in such a limited radius. That's not a good bet. You are trying to guess which of two limits is most likely to give you trouble here. On the one hand, llGetAgentList has a detection limit of 100 avatars. On the other hand, llSensor has a limit of 16. Most regions will never have anywhere near 100 avatars in them, but it's quite possible to have 50 or more, especially in a Linden-sponsored area like SLB or Stop and Shop. When you have that many people, llGetAgentList will still work, but chances are pretty high that there will be at least 16 people close enough to overwhelm llSensor. In general, llSensor is most appropriate for detecting people relatively nearby in a sparsely populated region. Otherwise, use llGetAgentList and filter the results. 2 1
Bleuhazenfurfle Posted October 8, 2023 Posted October 8, 2023 (edited) I mostly find llSensor good for "is there anyone nearby"… or when you're watching for one specific person. For much else, that limit it has is woeful. ( Also, good for, "is there NOT anyone nearby"… don't forget that handy no_sensor event…! ) Edited October 8, 2023 by Bleuhazenfurfle
Qie Niangao Posted October 8, 2023 Posted October 8, 2023 As I think about it, the setup for this thread (lo, three years ago!) was kind of perfect for making the solution not entirely obvious. Sixty avatars spread uniformly around a region would never approach sixteen within a five meter radius, so with that unrealistic assumption, llSensor would be the answer. On the other hand, sixty shopping avatars won't disperse themselves far / fast enough to not exceed sixteen within five meters of a sensor at the landing spot. I think a case could be made to just fire a five-meter sensor and see the num_detections in the event. If less than 16, stuff them into a list and we're done; if 16, just ignore the sensor results, instead call llGetAgentList and wade through the results. 2
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