Unvanquished
Unvanquished copied to clipboard
bots obstacle avoidance is broken
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
The original description happens because of several bugs:
- 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 ?
- 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.
- 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.
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.
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).
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.
For the record, several non-official tremulous maps have this problem, as @sweet235 will know.
You listed 3 reasons here,
- Is fixed by https://github.com/UnvanquishedAssets/map-perseus_src.dpkdir/pull/6
- Is tracked in https://github.com/UnvanquishedAssets/map-perseus_src.dpkdir/issues/5
- Is fixed by https://github.com/Unvanquished/Unvanquished/commit/4f806a2b95cfd31dcc305a92027d19131ddcdc1f
I think that means we can close the issue and track what's left in https://github.com/UnvanquishedAssets/map-perseus_src.dpkdir/issues/5