-
Notifications
You must be signed in to change notification settings - Fork 9
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
Update unstick.bt #111
base: master
Are you sure you want to change the base?
Update unstick.bt #111
Conversation
Extented with a second part, from 3 to 5 seconds without suicide. The first part, was modified a few, and apply for 7 to 15 second and end with suicide in case still stuck.
Still need tests, but better than previous. Bots try to fight when stucked near enemy or if one approach. Keep suicide at the last issue.
I'm wary of triggering it after so little time (3 seconds) as this will frequently happen when the bot is not really stuck. Can you give some qualitative explanation of how this improves the unsticking performance? Why is it good to move in a direction for only 100 ms and then change direction? |
In fact, I tried with time at 1 seconds to ensure quicker unstuck. Worked fine, but not easy to debug for the moment, so, I keep the 3 seconds time.
In many case, moving for short time like 100ms or 200ms in diferent directions before trying to roam can unstick in many case. |
This BT is included in unstick.bt by behavior. It check if there is enemy nearby, and select action to heal, fight or roam, in case the unstuck was successful.
The 4th update will be without debug info. |
indent and remove debug info
bots/unstick.bt
Outdated
condition distanceTo( E_ENEMY ) <= 300 | ||
{ | ||
sequence | ||
{ | ||
action resetStuckTime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
condition distanceTo( E_ENEMY ) <= 300 | |
{ | |
sequence | |
{ | |
action resetStuckTime | |
condition ( alertedToEnemy && distanceTo( E_ENEMY ) <= 300 ) | |
{ | |
sequence | |
{ | |
action resetStuckTime |
I think you are calling resetStuckTime
accidentally if you don't check there is an enemy. Otherwise, if I'm reading correctly, the distance to E_ENEMY is 0 if there is no enemy in sight.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always need alertedToEnemy with distanceTo( E_ENEMY ) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah basically, otherwise you'll read a distance of 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But, it's worked in my tests. (of course, without debug commands, I can't be sure that it's works really).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I more understood some BT parts. I rewrote some parts. Will test more before update.
Since I more understand what is BT
Changed small step by 200ms instead of 100ms. Almost the same. Too much in some case.
I also removed the part specific for Humans, when stucked with the CT. |
This repository has no longer use as it is not a submodule anymore: If there is still something to merge from it, this PR should be redone on https://github.com/Unvanquished/Unvanquished instead. I let this PR open so the one redoing the PR on the other repo can close it when it's redone if it has to be redone, so we know what PR is redone or not yet. |
Extented with a second part, from 3 to 5 seconds without suicide.
The first part, was modified a few, and apply for 7 to 15 second and end with suicide in case still stuck.