Simscan psedo-code
|
|
Aztral Aeon
Registered User
Join date: 22 Dec 2007
Posts: 34
|
12-24-2008 15:13
Hello Everyone, I've been away awhile and when coming back wanted to get my silly sim scanner working  I'm not looking for a whole working sim scan script here (if ya have one and wanna share great), just the basic idea of how I would accomplish this would be appreciated. First off heres what I done with limited success (and it works great in totally open sims), but I'm having difficulty in sims where there isn't full object entry permissions. Anywayz... Basic idea is I rez three "probes" from a main "scanner control" (so rez perms required here) and send them along paths (using a movepos type function) to cover the sim area (only up to 720m at this time tho...since I'm using movepos). I select a starting and ending x,y coord for each probe, and send them back forth moving up/down ~100 at each "waypoint." Then when a probe scans a new avatar it send a message back to the control object. Simple... However since the object entry permission flags for any various parcel may not allow object object entry, here's where it gets complicated...I had to create an A* path finding script to determine where the probes were allowed to move, and the paths they should take. Anyway, I'm sure what I've done is alot more complicated than it needs to be. I see sim scanner a) scanning up to 1000s of meters in a few seconds. So...anyone have any idea the best way to approach this? Since coming back I've noticed that the "placing a scanner at <0,0,0>" trick doesn't seem to work anymore. Also, since other scanners scan up to 1000s of meters the probe(s) aren't being moved with movepos. Basic question is (i suppose) how can I get an object to any point in a sim (no matter what the various parcel perms) and have it scan? Any help would be great! I've worked this awhile, but it time to get this silly thing working 
|
|
Klug Kuhn
Registered User
Join date: 7 Sep 2007
Posts: 126
|
12-24-2008 16:36
From what i've been known of, if there is restriction like object entry, obviously no other object (the scanner) can go inside and scan that area. Also if i remember correctly, there is no height limit for the object entry boundary too, i.e. if the area is blocked in a 100x100m, the whole height from 0m to 4096m will all be blocked. Beside the object entry limit, if the parcel is set to no script, then surely nothing can do too.
If you scanning an avatar and the restricted area is small enough, you could still be able to do the scan since the llSensor() has more than 96m for avatar.
However, though, there has been a slightly modded warpPos() or using posJump() in order to get around with the 1000m moving limit. You could move thru any distance now with only 1 function call.
|
|
Very Keynes
LSL is a Virus
Join date: 6 May 2006
Posts: 484
|
12-25-2008 00:45
Alternatively, why not just use: //Tell the owner how many avatars are in the region on touch default { touch_start(integer count) { llOwnerSay((string)llGetRegionAgentCount()); } }
|
|
Cypher Ragu
[Mad Scientist]
Join date: 6 Jul 2008
Posts: 174
|
12-27-2008 19:28
Because the radar would probably need to display the locations of those avatars.
_____________________
Life is a highway... And I just missed my exit.
|
|
Ollj Oh
Registered User
Join date: 28 Aug 2007
Posts: 522
|
12-27-2008 22:14
There are SOME pahfinding scripts for sl, but the only usable one uses a notecard database of regions for one mainland continent, and only works there, barely.
If anyone finds a pathfinding script that: - can follow a linden road - can navigate around noentry/noscript parcels that would be great.
till then, google for pathfinding algorythms. Even the most basic pathfinding needs too much memory, even with mono. so it needs an experienced coder to optimize for that limit or a large external database that knows all distances from all relevant points of a region.
|
|
Aztral Aeon
Registered User
Join date: 22 Dec 2007
Posts: 34
|
12-28-2008 12:04
From: Ollj Oh There are SOME pahfinding scripts for sl, but the only usable one uses a notecard database of regions for one mainland continent, and only works there, barely.
If anyone finds a pathfinding script that: - can follow a linden road - can navigate around noentry/noscript parcels that would be great.
till then, google for pathfinding algorythms. Even the most basic pathfinding needs too much memory, even with mono. so it needs an experienced coder to optimize for that limit or a large external database that knows all distances from all relevant points of a region. That's kinda how what I have now that works. The code (way to ugly to post) is a modified A* path finding and works under LSL. When it's cleaned up I can post it  Trick to conserving memory is to break a sim up into a grid of 10x10 squares instead of testing every possible 2x2 square (pretty sure 2x2 is the smallest land unit). Then instead of using float coords....assign each grid a "code." (I used a base-32 numbering system so i can designate a square like "1G"...which would be point <5,70>  . Anywayz, I do actually have my current sim scanner up and running using the pathing code I have (it's been working quite a while). BUT...I'd like to make it faster and more reliable. For example...I have the secret-agent hud and it scans a whole sim in seconds (my pathing scripts may find paths in seconds, but then the probes still have to move...and it only work up to 700m). There has to be a trick! Now I remember one trick used to be getting a sensor near <0,0,0>. It would return (up to it's limit) all the AV in zone. But I tested this the other day and it does'nt seem to working now. Guess I'm still not familiar enough with all the details LSL to figure my way outta this 
|
|
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
|
12-28-2008 12:40
I believe the smallest parcel size is 4 m x 4 m.
Would you really need to divide the sim into units as small as 10 x 10?
_____________________
-
So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.
I can be found on the web by searching for "SuezanneC Baskerville", or go to
http://www.google.com/profiles/suezanne
-
http://lindenlab.tribe.net/ created on 11/19/03.
Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard, Robin, and Ryan
-
|
|
Aztral Aeon
Registered User
Join date: 22 Dec 2007
Posts: 34
|
12-28-2008 19:52
From: SuezanneC Baskerville I believe the smallest parcel size is 4 m x 4 m.
Would you really need to divide the sim into units as small as 10 x 10? Ideally, if you want a 100% chance of finding a path "if one exists" you would use the smallest divisible unit (2x2,4x4, whichever ). I used 10x10 because I wanted a "good" chance (although it's not 100%) at succeeding to find a path if one exists. 10x10 also allowed me to use a 2 digit base-32 number to represent a grid unit which saves alot memory over saving float coords for the A* But ya, you could totally use larger grid units...sacrificing accuracy for processing speed and memory use 
|