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

Changing agent maxSpeed #14

Open
180107072 opened this issue Apr 12, 2022 · 3 comments
Open

Changing agent maxSpeed #14

180107072 opened this issue Apr 12, 2022 · 3 comments

Comments

@180107072
Copy link

This happens when you change maxSpeed
do you know how to fix it?

2022-04-12.23-54-03_Trim.mp4
@ZAETLE
Copy link

ZAETLE commented Apr 15, 2022

I just met the same problem

@TheSHEEEP
Copy link
Owner

TheSHEEEP commented Apr 15, 2022

I have an idea about what could cause this. Likely around these parts in the code responsible for detecting when an agent has reached its goal:
https://github.com/TheSHEEEP/godotdetour/blob/master/src/detourcrowdagent.cpp#L268 (the < 0.01f could be too small for certain speeds and might need to be relative to max speed)
https://github.com/TheSHEEEP/godotdetour/blob/master/src/detourcrowdagent.cpp#L385 (same thing)

Feel free to change these values to something larger - or better, something depending on agent speed-, recompile and see if that helps.
I'll do the same once I have time for testing it properly, but that could be a while.

I have mostly moved on from Godot 3.X, though (too much other stuff going on right now, so my own project will most likely use Godot 4 or 4.1 once I have time for it again), so this repository does not have the highest priority for me right now.
In all likelihood, I'll put this repo up for adoption/maintainer-wanted in the near future.

Just to make one thing clear, though: That "agent has reached goal" code will never be totally perfect (can't cover all potential cases and only sees the navmesh data which isn't the "whole picture" of a game) and in an actual game, you should probably do your own checks regarding whether an agent has arrived at its target or not if you see the godotdetour functionality not being sufficient.

@ZAETLE
Copy link

ZAETLE commented Apr 16, 2022

Thanks for your quick answer. I tried to change these value larger, they are useful to prevent these thing happen, but these cause another problem. the agent end position is not equal to the next start position, which cause the agent translate to a wrong position at the first time.
image
I have done some tests. and maybe is because the agent position is not update to the current position . I don't know if godot can send the current position to C++ and how to do that.
Sorry for my English , it's not my native language, maybe it's a little hard to understand , sorry for that. And thank you making these pulgin , it's very powerful.

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

No branches or pull requests

3 participants