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

Update unstick.bt #111

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

Conversation

superdupont-fr
Copy link

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.

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.
@slipher
Copy link
Contributor

slipher commented Jun 5, 2022

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?

@superdupont-fr
Copy link
Author

I'm wary of triggering it after so little time (3 seconds) as this will frequently happen when the bot is not really stuck.

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.

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 many case, moving for short time like 100ms or 200ms in diferent directions before trying to roam can unstick in many case.
Long sequence of walking in same direction is useless. I watched bots in Thunder stucked in large corridor ending to suicide because of long time in same direction.
Also, the mechanism that check if the bot is still stuck checking each seconds, that I think is too long. Many bots have time to come back at the almost same position in this time. My first BT with several small steps was already a good improvement.
My second update introduce a check if there is enemy nearby, and lets bots react if enemy appear in the sequence for unstick.
My third update is almost the same, but with include behavior to shorter files and improve readability. (I'm doing the third update now).

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.
@superdupont-fr
Copy link
Author

The 4th update will be without debug info.

bots/unstick.bt Outdated
Comment on lines 34 to 38
condition distanceTo( E_ENEMY ) <= 300
{
sequence
{
action resetStuckTime
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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.

Copy link
Author

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 ) ?

Copy link
Contributor

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

Copy link
Author

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).

Copy link
Author

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.
@superdupont-fr
Copy link
Author

I also removed the part specific for Humans, when stucked with the CT.

@illwieckz
Copy link
Member

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.

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.

4 participants