Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Prevent movement to origin after spawning #105

Merged
merged 3 commits into from
Apr 10, 2022

Conversation

skaldarnar
Copy link
Contributor

The MinionMoveComponent#goalPosition was initialized with the default vector (0,0,0), causing the stray behavior to target this position as the first movement target.

As this origin location is usually not reachable when an entity is spawned, we wasted a couple of seconds for computing a path until we finally aborted as "not reachable".

With these changes, we can now distinguish between "no goal position" (null) and "explicit goal position" (any vector). We only attempt to find a path for non-null targets.

The MinionMoveComponent#goalPosition was initialized with the default vector (0,0,0), causing the _stray_ behavior to target this position as the first movement target.

As this origin location is usually not reachable when an entity is spawned, we wasted a couple of seconds for computing a path until we finally aborted as "not reachable".

With these changes, we can now distinguish between "no goal position" (null) and "explicit goal position" (any vector). We only attempt to find a path for non-null targets.
@skaldarnar skaldarnar added Size: S Small effort likely only affecting a single area and requiring little to no research Topic: AI Requests, Issues and Changes related to pathfinding, behaviors, etc. Type: Bug Issues reporting and PRs fixing problems labels Apr 10, 2022
jdrueckert
jdrueckert previously approved these changes Apr 10, 2022
@jdrueckert jdrueckert dismissed their stale review April 10, 2022 16:52

Looks find code-wise, but tests fail

@jdrueckert jdrueckert merged commit cbff622 into develop Apr 10, 2022
@jdrueckert jdrueckert deleted the fix/do-not-move-to-origin branch April 10, 2022 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Size: S Small effort likely only affecting a single area and requiring little to no research Topic: AI Requests, Issues and Changes related to pathfinding, behaviors, etc. Type: Bug Issues reporting and PRs fixing problems
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants