nyuuzyou/wikis huggingface dataset:
Patch jpeglib

On windows, we discovered jpeglib played more nicely with the development environment with small patch to include windows headers.
diff -uw jpeg-orig/jmorecfg.h jpeg-new/jmorecfg.h
--- jpeg-orig/jmorecfg.h	2006-12-11 12:01:52.468750000 -0800
+++ jpeg-new/jmorecfg.h	2006-12-11 12:02:11.250000000 -0800
@@ -11,6 +11,12 @@
 */
 
 
+// Added by Linden Lab to get consistent definition of INT32
+#ifdef WIN32
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
 /*
 * Define BITS_IN_JSAMPLE as either
 * 8 for 8-bit sample values (the usual setting)
@@ -157,10 +163,17 @@
 
 /* INT32 must hold at least signed 32-bit values. */
 
-#ifndef XMD_H			/* X11/xmd.h correctly defines INT32 */
+// Original version
+//#ifndef XMD_H			/* X11/xmd.h correctly defines INT32 */
+//typedef long INT32;
+//#endif
+
+// Linden Lab version
+#if !defined( XMD_H ) && !defined( WIN32 )
 typedef long INT32;
 #endif
 
+
 /* Datatype used for image dimensions. The JPEG standard only supports
 * images up to 64K*64K due to 16-bit fields in SOF markers. Therefore
 * "unsigned int" is sufficient on all machines. However, if you need to
@@ -212,6 +225,7 @@
 #ifdef NEED_FAR_POINTERS
 #define FAR far
 #else
+#undef FAR // Added by Linden Lab to remove warnings
 #define FAR
 #endif
Save this patch as jpeglib.patch in the libraries/include/jpeglib directory and apply it from cygwin with the command:
$ patch -p1 < jpeglib.patch
Path update debugging

It require 4 objects to work with this script.
Name one prim "Red", another prim named "Green" and another as "Blue". These colored prim are used for tracking them.
One more prim named "hot" but is 2m x 2m x 0.1m cylinder to test it's avoiding range. place hot prim inside the a prim with the script, for rezzing.
It has listen command to do your bidding, useful for testing command conflicts.
<lsl>
key Green;
key Blue;
key Red;
vector PosTarget(key ID){
 return (llList2Vector(llGetObjectDetails(ID, [3]),0));
}
default
{
 state_entry(){
 llCreateCharacter([CHARACTER_DESIRED_SPEED, 5.0]);
 llListen( 0, "", "", "");
 llSensor("","",(PASSIVE | ACTIVE ),96,PI);
 }
 
 sensor(integer Num){
 integer aNum;
 for (aNum=0; aNum<Num; aNum++){
 string Tar = llDetectedName(aNum);
 if (Tar == "Green"){Green=llDetectedKey(aNum); llOwnerSay("Green found");}
 if (Tar == "Blue"){Blue=llDetectedKey(aNum); llOwnerSay("Blue found");}
 if (Tar == "Red"){Red=llDetectedKey(aNum); llOwnerSay("Red found");}
 }
 }
 listen( integer ch, string n, key id, string m ){
 if(m=="jump"){ llExecCharacterCmd( 1, [2.0] ); }
 else if(m=="stop"){ llExecCharacterCmd( 0, [] ); }
 else if(m=="wander"){ llWanderWithin( llGetPos(), 300.0, []); }
 else if(m=="evade"){ llEvade( Red, []); }
 else if(m=="chase"){ llPursue( Blue, []); }
 else if(m=="follow"){ llPursue( id, []); }
 else if(m=="hot"){ llFleeFrom( llGetPos(), 3, []); llRezObject( "hot", llGetPos(), <0,0,0>,<0,0,0,0>,0);}
 else if(m=="here"){ llNavigateTo( PosTarget(id), [FORCE_DIRECT_PATH, 0]); }
 else if(m=="now"){ llNavigateTo( PosTarget(id), [FORCE_DIRECT_PATH, 1]); }
 else if(m=="close"){ llGetClosestNavPoint( PosTarget(Green), []); }
 }
 path_update(integer typeUpdate, list reserved){
 if (typeUpdate == PU_SLOWDOWN_DISTANCE_REACHED ){ llOwnerSay("Slowdown: Near Goal"); }
 else if (typeUpdate == PU_GOAL_REACHED ){ llOwnerSay("Goal: Reached"); }
 else if (typeUpdate == PU_FAILURE_INVALID_START ){ llOwnerSay("Failure: Not connected to NavMesh"); }
 else if (typeUpdate == PU_FAILURE_INVALID_GOAL ){ llOwnerSay("Failure: Goal not on NavMesh"); }
 else if (typeUpdate == PU_FAILURE_UNREACHABLE ){ llOwnerSay("Failure: Unreachable"); }
 else if (typeUpdate == PU_FAILURE_TARGET_GONE ){ llOwnerSay("Failure: Target Missing"); }
 else if (typeUpdate == PU_FAILURE_NO_VALID_DESTINATION){ llOwnerSay("Failure: No Valid Destination"); }
 else if (typeUpdate == PU_EVADE_HIDDEN ){ llOwnerSay("Evade: Hidden"); }
 else if (typeUpdate == PU_EVADE_SPOTTED ){ llOwnerSay("Evade: Spotted"); }
 else if (typeUpdate == PU_FAILURE_NO_NAVMESH ){ llOwnerSay("Failure: No NavMesh"); }
 else if (typeUpdate == PU_FAILURE_OTHER ){ llOwnerSay("Failure: Other"); }
 else{ llOwnerSay("Unknown failure"); }
 }
}
Pathfinding/Alpha release notes

Welcome to the home page for the open alpha testing for Linden Lab's Pathfinding project! Thank you for your interest in pathfinding and for taking the time to help us test. 
== Restrictions ==
The initial release of the pathfinding LSL is available only on the Aditi test grid on the following regions:
* [secondlife://Aditi/secondlife/PathTest1/131/101/23 secondlife://Aditi/secondlife/PathTest1/131/101/23]
* [secondlife://Aditi/secondlife/PathTest2/100/170/26 secondlife://Aditi/secondlife/PathTest2/100/170/26]
* [secondlife://Aditi/secondlife/PathTest3/103/127/23 secondlife://Aditi/secondlife/PathTest3/103/127/23]
* [secondlife://Aditi/secondlife/PathTest4/127/194/29 secondlife://Aditi/secondlife/PathTest4/127/194/29]
== How to report bugs and suggest features ==
Use JIRA to report bugs and suggest features in the PATHBUG JIRA project: https://jira.secondlife.com/browse/PATHBUG
==Testing tips ==
The pathfinding project is still in alpha stage and subject to change. We are making the LSL calls public early to get feedback and pinpoint as many issues as possible before release. Expect some bugs and instability. 
The most helpful feedback at this stage are bug reports and specific suggestions regarding the API for the existing pathfinding functions. 
Because we want to get these features to Residents as soon as possible, it is not in scope to make major functionality changes before the product release (for example, adding volumetric pathfinding or the ability to pursue multiple avatars at once). That said, we may continue to add more pathfinding features in the future and welcome both near-term and long-term suggestions for improvement. 
Also:
* Be respectful of other residents while testing. 
* Have fun! 
=== Pathfinding-enabled objects ===
Pathfinding-enabled objects will not work (and may cause errors) if taken outside of the pathfinding test regions. 
We have set all objects to be returned after an hour to help maintain a cleaner testing environment for all.
Please do not rez more than 10 pathfinding enabled objects at a time, due to the heavy cost of scripts on a debug server build. Once pathfinding is released, you can expect to have a reasonably large number of pathfinding objects without impacting server performance (we've tested several hundred pathfinding enabled characters within a region with no noticeable slow down). 
=== Performance ===
To collect more valuable testing data, the pathfinding-enabled regions are running a debug server build. This will substantially impact server performance.
If you experience significant lag / FPS problems, try a different pathfinding test regions. 
=== Viewer tools ===
The Viewer pathfinding tools will greatly aid in visualizing the nav-mesh and debugging issues with pathfinding-enabled characters. A project viewer with these tools will be available soon. 
Because the Viewer tools are not yet available, Resident testers will not be able to regenerate the region nav-mesh for the time being. This means that if you place a staircase in world, for example, characters will view it as an obstacle rather than a pathable object.
Pathfinding Cookbook

UNDER DEVELOPMENT - INCOMPLETE
=Rezzer=
The code below is for a simple rezzer for the creatures. For a region scale rezzer system see Holistic_Pathfinding_Management
=Simple Creatures=
==Grazing Animal==
Wanders pauses and eat, wanders, repeat.
==Sentient Treasure Chest==
Treasure chest with legs. Sleeps, but runs and hides if anyone approaches.
==Fairy==
Wanders about (flying) looking for flowers, lingers by flowers, runs and hides from agents.
==Dragonfly==
Moves along designated path, lingers by designated waypoint and moves to next random waypoint.
==Snake==
Wanders about an area, includes special movement example.
==Treetop Birds==
Birds that move between treetops at random intervals.
 
==Vulture==
Birds that glide about on thermals
=Ecosystem Creatures=
==Hunting Animal==
Wanders looking for specific prey and pursues when prey is spotted.
==Grazing Prey Animal==
Wanders and pauses to eat, run a short distance when approached (skittish), runs further and hides from specific predator.
==Rat==
Wanders about a specified area, flees and hides if an agent approaches.
==Mount==
Build a character that can be ridden with race example.
==Dog==
Wanders about, chooses random agent, follows agent for a period, then wanders off, if no agents found sleeps.
==Cat==
Wanders about, chooses random agent, lingers by agent, then wanders again, if no agents found sleeps.
==Hopping Scarecrow==
Wanders about hopping and approaches random people, lingers and moves on.
----
Return to Good_Building_Practices
Pathfinding LSL functions

== LSL functions ==
* llCreateCharacter - Convert the current linkset to an AI character. By default, the character's shape will be an upright capsule approximately the size of the linkset, adjustable via the options list. The linkset must use mesh accounting.
* llDeleteCharacter - Convert the current linkset back to a standard object
* llEvade - Causes the character to keep away from the object or avatar identified by the key.
* llExecCharacterCmd - Send a command to the pathing system.
* llFleeFrom - Attempt to get at least 'distance' away from 'source' - provided in region-local coordinates.
* llGetClosestNavPoint - Accepts a point in region-local space and returns either an empty list or a list containing a single vector which is the closest point on the navmesh to the point provided. 
* llGetStaticPath - Request a path for an object other than a pathfinding character.
* llNavigateTo - Navigate to a destination provided in region coordinates. The destination may be in another region.
* llPatrolPoints - Patrol a provided set of points provided as vectors.
* llPursue - Causes the character to chase after the object or avatar identified by the key.
* llUpdateCharacter - Update character properties.
* llWanderWithin - Wander within an area approximately 'scale' in radius centered at 'origin'. Wandering means choosing a random point in the area and navigating to it. After arrival, a new random point will be chosen and navigated to.
== LSL events ==
* path_update - Informs the script of events that happen within the pathfinding system.
Pathfinding NavMesh

= Basic Overview = 
A look at the Navigation Mesh view of your region can quickly show you exactly how the navmesh system works and help troubleshoot potential problems.
This is the basic view:
File:Navmesh_001.jpg|Show Navmesh ticked on
File:Navmesh_002_002.jpg|Show Navmesh and Static Obstacles ticked on
File:Navmesh1_001.png|Navmesh, Static Obstacles, and Walkables on
File:Navmesh1_002.png|Navmesh, Static Obstacles, Walkables, and World on
The active Navmesh areas are in light grey, with the static obstacle areas outlined in red. The blank void spaces outlined in red are areas where your pathfinding creatures cannot go. These areas can be easily seen when you turn Static Obstacles on. 
File:Navmesh_002_003.jpg|Non navigable area in the navmesh
File:Navmesh_002_004.jpg|Non navigable area in the navmesh, static obstacles on
File:Navmesh_002_005.jpg|Non navigable area in the navmesh
File:Navmesh_002_006.jpg|Non navigable area in the navmesh, static obstacles on
In the Test tab of the Edit/Test pathfinding window you can test walkable pathways. Control-click to start your path (pink capsule). Shift-click and drag to see your path (orange capsule and pathway).
Pathfinding characters will calculate the fastest way to navigate from point A to point B in the navmesh. 
File:Navmesh1_004.png|Beginning point of path
File:Navmesh1_005.png|Shift-click and drag to see good pathways
Material Volumes will appear in the navmesh as opaque purple objects. These are phantom objects that can be set to change the walkability coefficients of an area of the navmesh. Walkability coefficients are multipliers that may be applied to the speed of a pathfinding character.
File:Material_volume_001.png|Purple Material Volume added to a walkable surface.
Exclusion Volumes show up as transparent yellow objects. These objects are phantom and pathfinding characters will not move in those area, yet avatars can.
File:Exclusion_001.png|Objects set to Exclusion Volume.
File:Exclusion_use_001.png|Used to keep pathfinding characters on the docks.
File:Exclusion_use_002.png|Used here to keep characters from getting stuck on rocks.
Walkable areas show up in green, and turning the world tick box off with walkables on will give you a good quick view all the walkable surfaces in the navigation mesh.
File:Walkable_001.png|Walkable areas only
File:Walkable_002.png|Walkable with navmesh and world turned on
= Other Notes = 
* A pathfinding region will share its nav mesh with its immediate neighbors, which allows cross-region pathfinding.
* The navmesh view that you see in the viewer is from when the simulator last baked the navmesh and only takes permanent objects into account. Movable obstacles, such as avatars or linksets set to "Movable Obstacle" can block characters' paths but are not visible in this navmesh view.
* The minimum size allowed for a nav mesh 'island' (such as an isolated walkable platform which is disconnected from the rest of the nav mesh) is approximately 100m^2.
Pathfinding Overview

Pathfinding is a method content creators can use to create moving and interactive characters within Second Life. Characters can use LSL functions to avoid obstacles, move around corners, climb inclines, and move across region boundaries: things that are very difficult or even impossible before. Pathfinding will also enable new gameplay mechanics, such as creating food that attracts monsters.
==Terminology==
*Character - an object that uses a Pathfinding LSL function.
*NavMesh - Short for Navigation Mesh. It's a map for characters.
==Functions==
*Evade - Run (and or hide) from a specified avatar or object.
*Flee - Move a specified distance from a specified location. 
*Navigate - Move to a specified location.
*Patrol - Move along a specified path specified by patrol points.
*Pursue - Follow specified avatar or object.
*Wander - Randomly wander a specified distance from a specified central point.
*Actions - Make the character jump or stop the current pathfinding behavior
*Update - Modify the pathfinding attributes of the character
*Get a Path - Request a path for an object other than a pathfinding character
==Best Practices==
*Try to limit walkable surfaces to those that characters should really walk, instead setting things like lamp poles, fences, statues, and trees to “static obstacle”. This will produce optimal pathfinding performance and results. Since walkability is a property of whole linksets and not individual prims, you can use exclusion volumes (similar to material phantoms described above) to enclose parts of a linkset that should not be traversed by any kind of character.
*Limit the number of “movable obstacles”. While we have limited the negative performance impact of these objects, the tradeoff is reduced pathfinding responsiveness. If you have too many movable obstacles, we may not update the navmesh to account for them each frame, meaning that characters could collide with, e.g., a vehicle that uses llSetPos() to move around.
*When making characters, you may wish to provide fallback navigation mechanisms. For example, if you get a behavior failure indicating that you are off the navmesh, you could use llGetClosestNavPoint() to find out where the nearest navigable area is and then try llNavigateTo() with DIRECT_PATH=TRUE to get there. If that fails, you could llSetPos() to that location. If the region wasn’t set up for pathfinding at all and llGetClosestNavPoint() returns an empty list, you could fall back on existing methods to navigate (e.g., by detecting obstacles with llCastRay() and moving with llSetKeyframedMotion()).
----
Return to Good_Building_Practices
Pathfinding Public Beta

== Overview ==
We are opening up the Pathfinding project to the public on the main grid AGNI. You can get involved and help us make this project better.
== What is Pathfinding ==
Pathfinding provides tools and functions to enable smoother and smarter movement behavior for non-avatar entities in Second Life (for example, monsters in a game, rats in a haunted house, wisps in a fantasy forest). We refer to these entities as characters; in gaming terminology, they are sometimes called NPCs (non-player characters) or mobs (mobile objects).
* Pathfinding_in_Second_Life
== Where can I test Pathfinding ==
We have 4 public sandbox testing regions on the main grid. You are welcome to use them to test the pathfinding features. The Snack regions are available to members of the group "Second Life Beta". Please join this group: http://world.secondlife.com/group/19657888-576f-83e9-2580-7c3da7c0e4ca . The other regions are open access.
# Snack Sandbox 1
#* http://slurl.com/secondlife/Snack%20Sandbox%201/128/128/25
# Snack Sandbox 2
#* http://slurl.com/secondlife/Snack%20Sandbox%202/128/128/25
# Snack Sandbox 3
#* http://slurl.com/secondlife/Snack%20Sandbox%203/128/128/25
# Snack Sandbox 4
#* http://slurl.com/secondlife/Snack%20Sandbox%204/128/128/25
#Limia
#* http://slurl.com/secondlife/Limia/128/128/25
#Arowana
#* http://slurl.com/secondlife/Arowana/128/128/25
#Sandbox Astutula
#* http://slurl.com/secondlife/Sandbox%20Astutula/128/128/25
#Sandbox Exemplar
#* http://slurl.com/secondlife/Sandbox%20Exemplar/128/128/25
#Sandbox Pristina
#* http://slurl.com/secondlife/Sandbox%20Pristina/128/128/25
#Sandbox Verenda
#* http://slurl.com/secondlife/Sandbox%20Verenda/128/128/25
#Fuchsia
#* http://slurl.com/secondlife/Fuchsia/128/128/25
#Pepin
#* http://slurl.com/secondlife/Pepin/128/128/25
#Lime
#* http://slurl.com/secondlife/Lime/128/128/25
#Plum
#* http://slurl.com/secondlife/Plum/128/128/25
#Harvey
#* http://slurl.com/secondlife/Harvey/128/128/25
== Viewer with Pathfinding Functionality ==
* Pathfinding functionality has been included in the Second Life Viewer Beta available under the "Other Viewers" section on Downloads page.
== How to report bugs and suggest features ==
Use JIRA to report bugs and suggest features in the PATHBUG JIRA project: https://jira.secondlife.com/browse/PATHBUG
== Additional Info ==
* Pathfinding_Tools_in_the_Second_Life_Viewer
* Pathfinding_LSL_functions
* Pathfinding/Alpha_release_notes
* Pathfinding User Group Details
== Can I get my own region on Pathfinding? ==
More than likely you can!
* If you have a full region that you own you can apply to have the region added to the public beta
* email pathfinding-beta@lindenlab.com
* Include your account name and region you want added to the beta.
* Please email from the email address on your account
* We will follow up with you in email.
Pathfinding Quick Start Guide

Begin by naming all objects in your region! A list of objects named "Object" is not helpful.
You will need to use the linkset tools to change the pathfinding attributes of the objects on your region to improve region-pathfinding performance! See a the Visual_Guide_to_Pathfinding for more help.
By default, all objects are set to Walkable (terrain), Movable Obstacle, or Movable Phantom (phantom objects). You will need to set walls, trees, fences, etc to Static Obstacle. Set floors and other areas that need to be walkable to Walkable.
Don't forget to click apply! Then FREEZE your changes for the navigation mesh to update.
*Terrain is always set to walkable. To prevent characters from entering areas of the terrain, use an Exclusion Volume
*All objects that you want pathfinding characters to walk upon will need to be set to walkable in the Linkset tools floater. Walkable objects are green in the navmesh view.
*You will need to Unfreeze before you can make any linkset changes to objects. Basic Setup > Unfreeze.
*Pathfinding Character orientation will always be positive X. 
*All objects that are NOT going to be set to walkable should be set according to need:
Walls, fences, trees, gates etc. - Static Obstacle. Static Obstacles are red in the navigation mesh view.
Movable doors, swinging gates, scripted moving objects that pathfinding characters cannot pass through - Movable Obstacle (not visible in the navigation mesh view).
Objects that you want ignored by the pathfinding characters - Movable Phantom (not visible in the navigation mesh view).
Avatars can move through or on, pathfinding characters cannot (this is also good for trouble spots where characters consistently get stuck) - Exclusion Volume seen as yellow opaque objects in the navigation mesh view.
*Remember to Apply your linkset object attributes, or the setting won't stick. 
*Freeze your changes (edit/test window) to queue the regeneration of the navmesh and "bake" in the changes you have made. The text will change to "Navmesh is up to date" when it's finished.
*Use the Show: navmesh tick box (and the world tickbox) to view the navigation mesh and see where you may need to make changes. 
For the beta you'll need to disable (or make phantom) objects that change scale, volume parameters, or positon/rotation of child prims to get acceptable sim performance.
For help tracking down problems use:
*Estate tools: Get top colliders and Get top scripts.
*Pathfinding Linkset tools: search for the name of the object and teleport to it, take, delete, take copy, or turn on a beacon.
----
Full Pathfinding tools information can be found here.
A quick guide to Good Building Practices can be found here.
Find helpful Pathfinding scripts here.
The Navigation Mesh explained here.