Facepunch / garrysmod-requests

Feature requests for Garry's Mod
86 stars 24 forks source link

Add convar that directly skips the "Finding hiding spots", etc parts of navmesh generation #2205

Closed StrawWagen closed 1 year ago

StrawWagen commented 1 year ago

Why?

This would only really be for incremental navmesh generation. As it is right now, every "nav_generate_incremental" rebuilds "hiding" spots, "encounter" spots, "sniper" spots, and visibility data, from scratch, for every seed you generate. On very large maps this wastes time, and computing power. I'm proposing a command that would let advanced users entirely skip these steps.

Something like "nav_generate_onlyareas"

How?

I looked through the SDK and I'm probably wrong in some trivial way, but....

I suggest for the implementation, adding 1 function that's used on the line linked below.

If the convar is the default, 0, return "FIND_HIDING_SPOTS" The navmesh generation will proceed as normal.

If the var is 1, return "SAVE_NAV_MESH" If I'm correct, this would skip every non-essential step.

The modified line of code would probably look like this m_generationState = PlaceholderFunctionName();

Here's the line of code in the SDK https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/game/server/nav_generate.cpp#L3699C4-L3699C4

I really hope something like this is doable, would save a lot of time on oversized maps. Thanks!

robotboy655 commented 1 year ago

You can set nav_quicksave to 2 to skip the visibility computation which is the actually slow part of the process.

nav_quicksave 1 (the default setting) already skips the sniper spots and stuff.