Closed EntranceJew closed 5 months ago
Will be tackled around the same time as #18 -- actually sounds pretty easy to run an incremental generation if the optimizer addon is installed. Thank you for providing a snippet and some extra background, very helpful.
I'm thinking of having a feature like this be a cvar that is automatically enabled (e.g., "ttt_bot_nav_auto 1") and it will generate a navmesh for the map on the first load. Thoughts?
sounds good to me, I appreciate it :)
On Sat, Mar 23, 2024, 6:31 PM thebigsleepjoe @.***> wrote:
I'm thinking of having a feature like this be a cvar that is automatically enabled (e.g., "ttt_bot_nav_auto 1") and it will generate a navmesh for the map on the first load. Thoughts?
— Reply to this email directly, view it on GitHub https://github.com/thebigsleepjoe/TTT-Bots-2/issues/43#issuecomment-2016630868, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLSMTCVEFNVYHPVD2VXDPLYZYGF3AVCNFSM6AAAAABDYW4BZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJWGYZTAOBWHA . You are receiving this because you authored the thread.Message ID: @.***>
Since navmesh optimizer requires sv_cheats
to be 1
, which is a protected cvar. This is not possible to perform automatically.
Tried:
game.ConsoleCommand
Player:ConCommand
RunConsoleCommand
The worst part is that I only discovered this fact after writing 98% of the code.... haha....
In-progress, working on similar command which can be placed between sv_cheats, as such:
sv_cheats 1; ttt_bot_nav_gen; sv_cheats 0;
Unfortunately, I've discovered that even this ^ is impossible. Below is the only working method with the new concommand I'll be adding in v1.3:
sv_cheats 1
in the consolettt_bot_nav_gen
sv_cheats 0
We cannot run it synchronously, as N.O. (and nav_generate_incremental
, which it relies on) is asynchronous by design. Namely, N.O. uses timers and concommands heavily to generate its navmeshes. Running the above commands is an acceptable solution for small servers or servers of trusted friends, so I'm leaving it in.
If you wish to avoid the prep work, the only solution is to use find navmeshes on the workshop and limit your map pool to maps with navmeshes. I wish more mappers included navmeshes in them.
What is the new feature? (required)
when bots should spawn, attempt to run
nav_generate_cheap_expanded
from Navmesh Optimizer, because it's cheap and inoffensive enough that it's accurate like 99% of the timeif you do include any logic for that then you will get slightly better navmeshes if you provide player spawn positions as seeds as I have done in my side addon:
Purpose/motivation (required)
my server is a testing server largely, so not having any players on at all breaks things, including the ability to conduct a mapvote since a round never starts. this isn't the most intelligent way to handle things but even so, if a map doesn't have a nav it is still a better experience to try and make one for a player when one joins
How would you add this feature? (optional)
wherever that print about navmeshes happens, make it do this instead if navmesh optimizer exists
Context
navvmesh optimizer's incremental one might not be the perfect navmesh but it is surprisingly competent for someone like me who would never bother to go in and even begin authoring one for all the maps we have in rotation if it didn't cover 99% of the problem areas for me
and more importantly it doesn't require a map reload and a bunch of extra shit that could potentially disable a whole server as it generates