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

Add Navigation Path filter with start position and radius for path searches #148

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

suedeworthey
Copy link

Added Nav Path Filter to verify path doesn't go outside boundary set by searchradius and searchstartpos.

@suedeworthey suedeworthey force-pushed the jimbob-nav-path-filter branch from ebcd462 to a206701 Compare May 29, 2024 18:53
@suedeworthey
Copy link
Author

Squashed commits.

Copy link
Owner

@brainiac brainiac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't look like the filter's params are being populated.

PluginAPI.h Outdated
@@ -49,6 +49,8 @@ struct NavigationOptions
bool paused = false; // pathing is paused
bool track = true; // if spawn is to be tracked
FacingType facing = FacingType::Forward; // Forward = normal, Backward = move along path facing backward.
int searchradius = 0; // the max search radius of the path
glm::vec3 searchstartpos; // the starting position of the search
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

searchStartPos

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or searchOrigin... (see below comment)

PluginAPI.h Outdated
@@ -49,6 +49,8 @@ struct NavigationOptions
bool paused = false; // pathing is paused
bool track = true; // if spawn is to be tracked
FacingType facing = FacingType::Forward; // Forward = normal, Backward = move along path facing backward.
int searchradius = 0; // the max search radius of the path
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

searchRadius

{
options.searchradius = GetIntFromString(value, 0);
}
else if (key == "searchstartpos")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking that "searchorigin" might be better.

Comment on lines 67 to 72
inline NavPathFilter() { };
inline virtual ~NavPathFilter() override { };
virtual bool passFilter(const dtPolyRef ref, const dtMeshTile* tile, const dtPoly* poly) const override;
inline void SetSearchRadius(int radius) { m_searchRadius = radius; }
inline int GetSearchRadius() const { return m_searchRadius; }
inline void SetStartPos(const glm::vec3& pos) { m_startPos = pos; }
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inline isn't necessary to specify on implementations in the class definition

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these options aren't being set anywhere.

Updated Nav path filter to check if path would go outside boundary set by camp radius to improve pulling.
Added start position for nav filter to ensure it doesn't follow the player.
@suedeworthey suedeworthey force-pushed the jimbob-nav-path-filter branch from f8a6fd0 to c42f6e7 Compare June 24, 2024 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants