Difference between revisions of "Walkability Coefficients"

From Second Life Wiki
Jump to navigation Jump to search
m
m
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
*Walkable objects can take advantage of coefficients in the [[Pathfinding_NavMesh|navigation mesh]].
Walkability Coefficients: What the heck are you talking about?
*Walkability coefficients are multipliers that may be applied to the speed of a pathfinding character.
*Some examples of use would be: Hard road switching to gravel, terrain switching to sandy ruts, deep snow areas, etc.
*You can have four different coefficients per region, controlling character type A, B, C, or D.
*Coefficients can be mixed with [[Material_Volumes|Material Volumes]] to further control character speed and behavior.


[[File:Coefficients_2.png|none|800x322px]]
Ever notice how things tend to travel slower on some surfaces and faster on others? Or even refuse to try to navigate over surfaces or enter areas something else is fine with? Pathfinding has tools for managing this built into it.


*Example: You have a tar pit that character type A can navigate freely, but character type B cannot navigate at all. The tar pit objects would be set to coefficient 100% for type A and 0% for type B.
Some examples: tarmac, gravel, sand pits, snowdrifts, oil slicks
 
----
 
PF enabled characters are one of five Character Types. "None" is the default type. If your character has one of the other types ( A, B, C, D ) it can be affected by the walkability coefficients of the environment.
 
[[CHARACTER_TYPE|Character type]] is set in the PF character's script, and can be changed on the fly. You have to open up the script to see what kind of PF character type something is. There is a pathfinding characters window, but it doesn't tell you character type.
 
----
 
Objects in the [[Pathfinding_NavMesh|navigation mesh]] have a walkability coefficient. Default terrain is always 100%. By default, things on a navmesh are set to 100% WC for all four types.
 
For a PF enabled character of character type default, everything is treated as 100%. How fast the character goes is controlled by the character's script and not affected by the environment.
 
If the character is of type A, B, C, D, their speed can be affected by the walkability coefficients of things in their environment.
 
Rez a prim. Right click on the prim, choose "Show in linksets" and you will see the pathfinding linksets window appear. There are four columns on the far right of the window named A%, B%, C%, D%. Those show you the walkability coefficients.
 
PF LINKSET WINDOW PICTURES - AND MAYBE LINK TO A GUIDE FOR IT?
 
You can change the walkability coefficients in this window. The highlighted item is your prim. At the bottom of this window are some controls and an [Apply changes] button. Change each of the four 100s to 50, then press [Apply changes]. Now when PF enabled creatures of types A, B, C, and D travel on your prim, they'll do so at half their usual speed.
 
----
 
But I want them to go faster! Not slower!
 
When you've got a PF enabled character that isn't character type none, you can take advantage of [[TRAVERSAL_TYPE|TRAVERSAL_TYPE]]. This determines whether those walkability percent numbers make your creature slow down or speed up.
 
Like character type, traversal type is set in the PF character's script. The default for traversal type is slow.
 
----
 
How do walkability coefficients work with [[Material_Volumes|material volumes]]?
 
Material volumes also have coefficients. Instead of determining how fast a PF character moves across the surface of an object, they determine how fast it moves through the object.
 
If you have a walkable surface with a material volume overlapping... well, we're still trying to puzzle that out. So far it looks like exclusions take priority...
 
----
 
still todo:
Code samples, pictures, the racing example
 
----
 
<gallery>
File:Coefficients_2.png|Coefficients are found in the Linkset floater
File:Coefficients3_001.png|Different speed coefficients mixed with a material volume
</gallery>


----
----
Return to [[Good_Building_Practices]]
Return to [[Good_Building_Practices]]

Latest revision as of 09:18, 14 December 2012

Walkability Coefficients: What the heck are you talking about?

Ever notice how things tend to travel slower on some surfaces and faster on others? Or even refuse to try to navigate over surfaces or enter areas something else is fine with? Pathfinding has tools for managing this built into it.

Some examples: tarmac, gravel, sand pits, snowdrifts, oil slicks


PF enabled characters are one of five Character Types. "None" is the default type. If your character has one of the other types ( A, B, C, D ) it can be affected by the walkability coefficients of the environment.

Character type is set in the PF character's script, and can be changed on the fly. You have to open up the script to see what kind of PF character type something is. There is a pathfinding characters window, but it doesn't tell you character type.


Objects in the navigation mesh have a walkability coefficient. Default terrain is always 100%. By default, things on a navmesh are set to 100% WC for all four types.

For a PF enabled character of character type default, everything is treated as 100%. How fast the character goes is controlled by the character's script and not affected by the environment.

If the character is of type A, B, C, D, their speed can be affected by the walkability coefficients of things in their environment.

Rez a prim. Right click on the prim, choose "Show in linksets" and you will see the pathfinding linksets window appear. There are four columns on the far right of the window named A%, B%, C%, D%. Those show you the walkability coefficients.

PF LINKSET WINDOW PICTURES - AND MAYBE LINK TO A GUIDE FOR IT?

You can change the walkability coefficients in this window. The highlighted item is your prim. At the bottom of this window are some controls and an [Apply changes] button. Change each of the four 100s to 50, then press [Apply changes]. Now when PF enabled creatures of types A, B, C, and D travel on your prim, they'll do so at half their usual speed.


But I want them to go faster! Not slower!

When you've got a PF enabled character that isn't character type none, you can take advantage of TRAVERSAL_TYPE. This determines whether those walkability percent numbers make your creature slow down or speed up.

Like character type, traversal type is set in the PF character's script. The default for traversal type is slow.


How do walkability coefficients work with material volumes?

Material volumes also have coefficients. Instead of determining how fast a PF character moves across the surface of an object, they determine how fast it moves through the object.

If you have a walkable surface with a material volume overlapping... well, we're still trying to puzzle that out. So far it looks like exclusions take priority...


still todo: Code samples, pictures, the racing example



Return to Good_Building_Practices