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
On-demand background navmesh generation #2353
Conversation
|
Impressive! Do we need the |
|
I have mixed feelings about “Put helpful info in bot pings” commit as some generic purpose or legacy tools (like XQF) detect bots by checking that player ping is zero. |
|
For bot info, if we don't have any bot skill level above |
This is a message sent to all clients, while the other ones are just normal logs in the server console.
That wasn't working anyway as the bot pings were previously random numbers from 50 to 99. I have vague recollections that a 0 ping supposedly triggers bugs... |
Ah… but what do you think about |
|
Nice will test later today! |
The ping is also a required field for every bot, and one that is already displayed to users. So to me it's nice to put something useful there without writing any new code to process it. |
|
Once this is merged, we can do: |
If the cvar g_bot_nav_onDemand is enabled, then the sgame will generate missing navmeshes when a bot is added. This will block the server main thread for however long it takes.
|
I tested it with all official maps and it works. LGTM if |
If g_bot_navgen_onDemand is 1 (the default), then the navmesh will start being generated in the background (a little bit each frame). Bots can join a team immediately, but do not spawn until the generation has completed. g_bot_navgen_msecPerFrame controls how much generation is done per frame, trading off faster generation vs. laggy server.
|
Removed the helpful bot pings commit and add the prefix |
|
One minor issue I noticed but I don't consider this blocking the merge, is that doing navedit enable before there is any navmesh will forbid to generate navmesh without reloading the map first: |
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.
LGTM.
Yeah that was by design. Although I guess we could make /navedit ignore the failure init status and retry since it is in response to (presumably) a human input. The main thing is not to reattempt initialization on every Technically you could still generate navmeshes with |
|
There is this warning: I think it would be good to handle it, but I'm not sure how. Maybe |
Stacked on #2352.
On-demand navmesh generation in the background in sgame is ready to test out. Just load a map and add a bot. Well also you need valid navmeshes to not already exist; you can delete them from
<homepath>/game/maps/if applicable, or editNAVMESHSET_VERSIONin the source to invalidate all existing meshes.