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

bots obstacle avoidance is broken #1493

Closed
ghost opened this issue Sep 8, 2021 · 6 comments
Closed

bots obstacle avoidance is broken #1493

ghost opened this issue Sep 8, 2021 · 6 comments
Labels
A-Bots S-DoneInFork This is done in a tagger's fork T-Bug

Comments

@ghost
Copy link

ghost commented Sep 8, 2021

Bots have a code to find path around obstacle when they are stuck ( https://github.com/Unvanquished/Unvanquished/blob/master/src/sgame/sg_bot_nav.cpp#L471). This code probably does not work, as can be seen by:

  • loading perseus
  • giving aliens max momentums
  • allow bots to cheat
  • write a BT for aliens which makes them 1: evolve with 1.5s and rush (nothing else)

This will trigger the following behavior:

Bot will evolve to tyrants, try to go to "Crusher" area by the alien base door, but will be stuck in the right hand side of the door.

I do not know the exact causes. This bug was somehow revealed by my rewrite of BotGetRushScore and my BTs.
Note that this is likely the most obvious failure.
Normally, stuck bots should, after some time, find a new target (https://github.com/UnvanquishedAssets/unvanquished_src.dpkdir/blob/c1dbbf36ec480c637a84c546c0fe6d345c0baedb/bots/unstick.bt#L34). This, also, seems to not work as expected.

Desired behaviors here are:

  • for a start, to never be stuck against walls. A correct use of navmesh should prevent this, at all times.
  • if stuck against a wall or a building and no steering path was found, define new target as a close, backpedaling direction
  • if stuck against another friendly player, backpedal and wait a random amount of time. Randomness here is important, because otherwise the block will happen infinitely when other side will also resume it's moves (that's what humans do in streets when such situation happens)

To check: are all entities placed on the navmesh? If no, there is no way the navmesh handling code can find correct pathfinding.
It might also be desirable to find a way to use DetourCrowd, but considering the use of various navmeshes this seems unlikely to be doable (amongst other problems that crowd would bring)

[edit]
french word sneaking in text + some precisions

@ghost ghost self-assigned this Sep 27, 2021
@ghost ghost added A-Bots T-Bug labels Sep 27, 2021
@ghost
Copy link
Author

ghost commented Jan 13, 2022

The original description happens because of several bugs:

  1. navmesh is not generated at door between "cooling" and "cell block bottom". Still no idea why, it might be either a bug in the navmesh generator, or a bug in Perseus' geometry, which I think is more probable, but I do not know enough on the topic, maybe you would know how to identify something blocking only bots there, @illwieckz , @Viech ?
  2. stair platform near door in "storage" is too tight, no navmesh is generated because of margins. Navmesh generator related, clearly. 2 possible fixes: enlarge the platforms, or find a way to reduce the margins.
  3. the slope on "green corridors" goes toward down, and is very tight for tyrants. Obstacle avoidance code only checks for either flat or upward STEPSIZE, and there we're in the only non-supported case.

This issue will only be fixed when either 1. or 2+3 will be fixed. Ideally, all problems should be fixed, of course.
For 1. and 2., there is a possible workaround: to manually place navcons. 3. definitely require a patch in code.

This was referenced Jan 13, 2022
@ghost ghost added this to the Beta 54 (v0.54.0) milestone Jul 5, 2022
@ghost
Copy link
Author

ghost commented Jul 5, 2022

Won't be trivial to fix, but this is an important one to get rid of, since this allows a lot of improvements with the current path-finding system we have.
Ideally, we should get rid of recast and aim for Q3's AAS instead, for many reasons I won't detail here, until asked for.
Still, I have clues that basic fixes can allow us to to have much better path-finding despite the pathfinding tool not being appropriate for our uses.

@ghost ghost added the S-DoneInFork This is done in a tagger's fork label Jul 6, 2022
@ghost ghost removed their assignment Jul 6, 2022
@Viech
Copy link
Member

Viech commented Sep 2, 2022

Sorry for not reacting to the ping. I don't have time to check the map geometry but I would also suspect this to be a factor; for instance it might be that the floor has holes where the generator traces down (I think this was a problem with stairs on parpax) or possibly that parts of the floor are considered nonsolid by the generator but not by the game (which would then be an inconsistency bug).

@ghost
Copy link
Author

ghost commented Sep 2, 2022

To be honest, that bug is rare enough so I don't consider it a blocker: it's easy to generate a .navcon file to work around it. And the 2nd problem about "Slopes of Hell" I have fixed, but since master does not have the changes yes, I've only created and used a tag, instead of closing the issue.

@ghost
Copy link
Author

ghost commented Sep 3, 2022

For the record, several non-official tremulous maps have this problem, as @sweet235 will know.

@necessarily-equal
Copy link
Contributor

You listed 3 reasons here,

  1. Is fixed by Fix the second passage to alien base's navmesh UnvanquishedAssets/map-perseus_src.dpkdir#6
  2. Is tracked in disconnected navmesh UnvanquishedAssets/map-perseus_src.dpkdir#5
  3. Is fixed by 4f806a2

I think that means we can close the issue and track what's left in UnvanquishedAssets/map-perseus_src.dpkdir#5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Bots S-DoneInFork This is done in a tagger's fork T-Bug
Projects
None yet
Development

No branches or pull requests

2 participants