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

add navgen option walkableRadiusFactor #2948

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sweet235
Copy link
Contributor

@sweet235 sweet235 commented Mar 6, 2024

There is a margin between the edge of a navmesh, and the actual geometry causing this edge. Look at the level4 navmesh on map antares for example:

unvanquished_2024-03-06_103603_000

Notice how these margins cause a gap in the navmesh, where the white circle is. The tyrant bots will not leave their base on this path, despite the fact that a tyrant fits in there.

This is very unfortunate, as there is a similar gap at the other exit as well. So tyrant bots cannot leave their base.

The margin is controlled by a value walkableRadius we tell recast to use. Add a navgen option walkableRadiusFactor, to tweak this value. For example, create a file game/maps/antares.navcfg:

walkableRadiusFactor 0.75

Restart, and look at the same navmesh:

unvanquished_2024-03-06_103634_000

There is one other important reason to keep the margins as small as we can: bots will only pick enemy buildings as targets if their origin is over the navmesh (with minor exceptions).

This is a very dangerous value to tweak. Make the margin too small, and bots might get stuck at little edges on the walls.

@DolceTriade
Copy link
Member

Should this be a per-class value?

@sweet235
Copy link
Contributor Author

sweet235 commented Mar 6, 2024

Should this be a per-class value?

Probably. Some navgen options should be. But we did not implement per-class configs yet.

@sweet235
Copy link
Contributor Author

sweet235 commented Mar 7, 2024

This is a very dangerous value to tweak.

Indeed. Setting it to 0.1, and generating navmeshes for map kaiji-starsidehotel crashes the server.

I'll try find out what a proper lower bound is.

@DolceTriade
Copy link
Member

Why did it crash? Can 0.1 be a valid value for some maps but cause others to crash?

@sweet235
Copy link
Contributor Author

sweet235 commented Apr 9, 2024

Why did it crash?

I suspect these narrow bridges:

unvanquished_2024-04-09_181016_000

I could not make any bot cross them yet.

Can 0.1 be a valid value for some maps but cause others to crash?

I'm not sure yet.

@sweet235
Copy link
Contributor Author

Note to self: it has been communicated to me in private that a minimum of 2 could be enough for both values.

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.

None yet

2 participants