Difference between revisions of "Pathfinding in Second Life"

From Second Life Wiki
Jump to navigation Jump to search
 
(28 intermediate revisions by 11 users not shown)
Line 1: Line 1:
{{Pathfinding alpha}}
{{Pathfinding Nav}}
__TOC__
__TOC__
{{Multi-lang}}
== Overview ==
At a high level, 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 alpha information ==
Up till now, content creators had to use resource-intensive scripting workarounds to emulate intelligent character movement.  With the addition of pathfinding, content creators will have a much easier and better performing way of creating characters that can move around in the world. Characters can use LSL functions to avoid obstacles, move around corners, climb inclines, and move across region boundaries: things that were very difficult or even impossible before. Pathfinding will also enable new gameplay mechanics, such as creating food that attracts monsters.
* [[Pathfinding alpha information]] - Information and tips on how to test the alpha version of Pathfinding on the Aditi test grid.
* [[Preview_Grid#How_do_I_log_in_to_Aditi.3F|How do I log into the Aditi test grid?]] This test is being run on the Aditi test grid; for more information, read this article about Aditi and how you can log in.


==Pathfinding API documentation==
{{KBnote|Pathfinding is not an animation system.  It does not provide a way to animate a biped or quadruped in conjunction with the new movement functionality.  You must use existing methods to animate characters. Nevertheless, pathfinding enables more dynamic movement and provides a better system for controlling character movement than was previously possible.  For more information on creating animations, see [[Animation]].}}


* [[Overview of pathfinding]] - Introduction and overview of pathfinding.
=== User group ===
* [[Pathfinding tutorial]] - Short "walkthrough" of setting up and using pathfinding.  TBD.
Please go to the simulator user group for questions related to pathfinding.  Andrew, Maestro, Falcon, or Stinson Linden should be able to help you with any technical questions.
* [[Pathfinding/Alpha release notes]] - Restrictions, known issues, and so on.


=== LSL reference ===
Transcripts:
==== Pathfinding functions ====
* [[Pathfinding_in_Second_Life/2012-06-07|2012-06-07]]
* [[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.
* [[Pathfinding_in_Second_Life/2012-05-31|2012-05-31]]
* [[llDeleteCharacter]] - Convert the current linkset back to a standard object
* [[Pathfinding_in_Second_Life/2012-05-17|2012-05-17]]
* [[llEvade]] - Causes the character to keep away from the object or avatar identified by the key.
* [[Pathfinding_in_Second_Life/2012-05-10|2012-05-10]]
* [[llExecPathingCmd]] - Send a command to the pathing system - currently only supports stopping pathing.
* [[Pathfinding_in_Second_Life/2012-05-03|2012-05-03]]
* [[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.
* [[Pathfinding_in_Second_Life/2012-04-19|2012-04-19]]
* [[llFleeFrom]] - Attempt to get at least 'distance' away from 'source' - provided in region-local coordinates.
* [[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.
==== Pathfinding events ====


* [[path_update]] - Informs the script of events that happen within the pathfinding system.
=== LSL functions ===
The pathfinding LSL functions enable you to create characters that dynamically avoid obstacles while performing typical behaviors you might want in a game or other virtual experience, including:
* '''Create''' - Initialize an object to prepare it for using pathfinding functions. [[LlCreateCharacter]]
* '''Delete''' - Stop the object from responding to pathfinding functions. [[LlDeleteCharacter]]
* '''Evade''' - Run away from a specified object or avatar.  See [[llEvade]].
* '''Flee''' - Attempt to get a specified distance from a specified location.  See [[llFleeFrom]].
* '''Navigate''' - Move to a specific location. See [[llNavigateTo]].
* '''Patrol''' - Move through a path defined by a set of "patrol points." See [[llPatrolPoints]].
* '''Pursue''' - Chase a specified object or avatar. See [[llPursue]].
* '''Update''' - Update or change the parameters associated with a character. See [[LlUpdateCharacter]].
* '''Wander''' - Randomly move around a specified distance from a specified central point.  See [[llWanderWithin]].
* '''ExecCharacterCmd''' - Miscellaneous character-related functions such as stopping and jumping. See [[llExecCharacterCmd]].
* '''GetStaticPath''' - The only function which can be used on '''non'''-characters and on regions with dynamic pathfinding disabled. Returns a path to the goal. See [[llGetStaticPath]]
 
For more details, see [[Pathfinding LSL Functions]].
 
=== LSL events ===
 
The following event is designed to react when the various pathfinding event are triggered for an active pathfinding character:
 
* [[path_update]] - Triggered when a pathfinding event occurs.

Latest revision as of 06:23, 15 July 2014


Overview

At a high level, 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).

Up till now, content creators had to use resource-intensive scripting workarounds to emulate intelligent character movement. With the addition of pathfinding, content creators will have a much easier and better performing way of creating characters that can move around in the world. Characters can use LSL functions to avoid obstacles, move around corners, climb inclines, and move across region boundaries: things that were very difficult or even impossible before. Pathfinding will also enable new gameplay mechanics, such as creating food that attracts monsters.

KBnote.png Note: Pathfinding is not an animation system. It does not provide a way to animate a biped or quadruped in conjunction with the new movement functionality. You must use existing methods to animate characters. Nevertheless, pathfinding enables more dynamic movement and provides a better system for controlling character movement than was previously possible. For more information on creating animations, see Animation.

User group

Please go to the simulator user group for questions related to pathfinding. Andrew, Maestro, Falcon, or Stinson Linden should be able to help you with any technical questions.

Transcripts:

LSL functions

The pathfinding LSL functions enable you to create characters that dynamically avoid obstacles while performing typical behaviors you might want in a game or other virtual experience, including:

  • Create - Initialize an object to prepare it for using pathfinding functions. LlCreateCharacter
  • Delete - Stop the object from responding to pathfinding functions. LlDeleteCharacter
  • Evade - Run away from a specified object or avatar. See llEvade.
  • Flee - Attempt to get a specified distance from a specified location. See llFleeFrom.
  • Navigate - Move to a specific location. See llNavigateTo.
  • Patrol - Move through a path defined by a set of "patrol points." See llPatrolPoints.
  • Pursue - Chase a specified object or avatar. See llPursue.
  • Update - Update or change the parameters associated with a character. See LlUpdateCharacter.
  • Wander - Randomly move around a specified distance from a specified central point. See llWanderWithin.
  • ExecCharacterCmd - Miscellaneous character-related functions such as stopping and jumping. See llExecCharacterCmd.
  • GetStaticPath - The only function which can be used on non-characters and on regions with dynamic pathfinding disabled. Returns a path to the goal. See llGetStaticPath

For more details, see Pathfinding LSL Functions.

LSL events

The following event is designed to react when the various pathfinding event are triggered for an active pathfinding character:

  • path_update - Triggered when a pathfinding event occurs.