Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/game/server/nav.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/

#ifdef NEO
const float GenerationStepSize = 20.0f; // NEO: some hallways/openings were missing connections with larger value
constexpr float GenerationStepSize = 20.0f; // NEO: some hallways/openings were missing connections with larger value
#else
const float GenerationStepSize = 25.0f; // (30) was 20, but bots can't fit always fit
#endif
Expand Down
35 changes: 35 additions & 0 deletions src/game/server/nav_generate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3425,12 +3425,30 @@ void CNavMesh::AddWalkableSeeds( void )
*/
void CNavMesh::BeginGeneration( bool incremental )
{
#ifdef NEO
if (nav_generate_debug_brushladders.GetBool())
{
if (!BuildBrushLaddersFromBsp())
{
Warning("Generating brush ladders...FAIL\n");
}
else
{
Msg( "Generating brush ladders...DONE\n" );
}
return;
}
#endif

IGameEvent *event = gameeventmanager->CreateEvent( "nav_generate" );
if ( event )
{
gameeventmanager->FireEvent( event );
}

#ifdef NEO
engine->ServerCommand( "neo_bot_kick all\n" );
#else
#ifdef TERROR
engine->ServerCommand( "director_stop\nnb_delete_all\n" );
if ( !incremental && !engine->IsDedicatedServer() )
Expand All @@ -3444,6 +3462,7 @@ void CNavMesh::BeginGeneration( bool incremental )
#else
engine->ServerCommand( "bot_kick\n" );
#endif
#endif // NEO

// Right now, incrementally-generated areas won't connect to existing areas automatically.
// Since this means hand-editing will be necessary, don't do a full analyze.
Expand Down Expand Up @@ -4018,6 +4037,22 @@ bool CNavMesh::UpdateGeneration( float maxTime )
m_isAnalyzed = true;
}

#ifdef NEO
// This runs earlier during the generation for the debug==true case, so skip here.
if (!nav_generate_debug_brushladders.GetBool())
{
// Post-gen because we want automatic merge with the final navmesh
if (!BuildBrushLaddersFromBsp())
{
Warning("Generating brush ladders...FAIL\n");
}
else
{
Msg( "Generating brush ladders...DONE\n" );
}
}
#endif

// generation complete!
float generationTime = Plat_FloatTime() - m_generationStartTime;
Msg( "Generation complete! %0.1f seconds elapsed.\n", generationTime );
Expand Down
Loading
Loading