Steering tweaks (#14140)
- Fix the direct-path so NPCs. This is most noticeable when moving diagonally on planetmaps (given the current pathfinder is cardinal) - Reduce static collision avoidance weight and distance. This seems to reduce instances of getting stuck on railings.
This commit is contained in:
@@ -320,7 +320,7 @@ public sealed partial class NPCSteeringSystem
|
||||
EntityQuery<PhysicsComponent> bodyQuery,
|
||||
EntityQuery<TransformComponent> xformQuery)
|
||||
{
|
||||
var detectionRadius = MathF.Max(1.5f, agentRadius);
|
||||
var detectionRadius = MathF.Max(1f, agentRadius);
|
||||
|
||||
foreach (var ent in _lookup.GetEntitiesInRange(uid, detectionRadius, LookupFlags.Static))
|
||||
{
|
||||
@@ -364,7 +364,7 @@ public sealed partial class NPCSteeringSystem
|
||||
for (var i = 0; i < InterestDirections; i++)
|
||||
{
|
||||
var dot = Vector2.Dot(norm, Directions[i]);
|
||||
danger[i] = MathF.Max(dot * weight, danger[i]);
|
||||
danger[i] = MathF.Max(dot * weight * 0.9f, danger[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user