Skip to content

NavMesh Place name support - #2092

Open
AdamTadeusz wants to merge 15 commits into
NeotokyoRebuild:masterfrom
AdamTadeusz:376_navPlaceNameHudSupport
Open

NavMesh Place name support#2092
AdamTadeusz wants to merge 15 commits into
NeotokyoRebuild:masterfrom
AdamTadeusz:376_navPlaceNameHudSupport

Conversation

@AdamTadeusz

@AdamTadeusz AdamTadeusz commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Description

NeoAssets PR NeotokyoRebuild/neoAssets#132

Adds a hud element that displays the name of the closest nav area's place name, if any. Intended for incorporating call-outs from callout maps into the navigation meshes.

Also adds a command for displaying all nearby place names

placeCallouts.mp4

Toolchain

  • Windows MSVC VS2022

@AdamTadeusz
AdamTadeusz marked this pull request as draft August 24, 2026 20:22
@nullsystem nullsystem added the Tournament Priority Issues to be prioritized for the upcoming NT;RE tournament label Aug 25, 2026
@DESTROYGIRL DESTROYGIRL added the UI/HUD Relates to the HUD, NeoUI, menus, etc label Aug 28, 2026
@AdamTadeusz AdamTadeusz added the Changes in neoAssets This PR depends on changes in the neoAssets repository. The relevant PR should be in the description label Aug 28, 2026
@AdamTadeusz
AdamTadeusz marked this pull request as ready for review August 28, 2026 19:50
@AdamTadeusz
AdamTadeusz requested review from a team and removed request for a team August 28, 2026 19:50
@AdamTadeusz
AdamTadeusz marked this pull request as draft August 28, 2026 19:52
@AdamTadeusz
AdamTadeusz marked this pull request as ready for review August 28, 2026 19:56
@AdamTadeusz
AdamTadeusz requested a review from a team August 28, 2026 19:56
@AdamTadeusz

Copy link
Copy Markdown
Contributor Author

I'm not happy with how client side the place names are loaded within the same function that reads the nav file, ideally that function should take a pointer to a CUtlVector and be moved to a separate file, with the original file calling it then going through all the place names and configuring how they look etc. but I'm tired.

@AdamTadeusz
AdamTadeusz marked this pull request as draft August 28, 2026 20:17
@AdamTadeusz
AdamTadeusz marked this pull request as ready for review August 28, 2026 20:37
@AdamTadeusz

Copy link
Copy Markdown
Contributor Author

Ok fixed some last minute issues and included a video showing the feature

@sunmachine sunmachine self-assigned this Aug 29, 2026
Comment thread src/game/client/neo/c_neo_point_world_text.cpp Outdated
Comment thread src/game/client/neo/ui/neo_hud_place_name.cpp
Comment thread src/game/server/nav_area.cpp Outdated
Comment thread src/game/server/neo/neo_player.cpp Outdated
Comment thread src/game/client/neo/c_neo_point_world_text.cpp Outdated

@sunmachine sunmachine left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick

Comment thread src/game/client/neo/c_neo_point_world_text.h
AdamTadeusz and others added 6 commits August 29, 2026 06:21
set text length after copy

Co-authored-by: Dan Peavey <sunMachine@users.noreply.github.com>
Update place nav area counts

Co-authored-by: Dan Peavey <sunMachine@users.noreply.github.com>
remove incrementreferencecount

Co-authored-by: Dan Peavey <sunMachine@users.noreply.github.com>
pragma once

Co-authored-by: Dan Peavey <sunMachine@users.noreply.github.com>
@sunmachine
sunmachine self-requested a review August 29, 2026 16:46

@sunmachine sunmachine left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BAM

@@ -0,0 +1,339 @@
#include "c_neo_point_world_text.h"
#include "view_scene.h"
#include "view.h"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: by any chance do we want to add

// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"

after these includes?


if (TheNavMesh)
{
const char* placeName = TheNavMesh->PlaceToName(TheNavMesh->GetPlace(GetAbsOrigin()));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could probably just use GetLastKnownArea() instead of neeting to query the NavMesh for GetPlace.

Something like:

const CNavArea* pArea = GetLastKnownArea();
const char* placeName = pArea ? TheNavMesh->PlaceToName(pArea->GetPlace()) : NULL;


CNEOHud_PlaceName::~CNEOHud_PlaceName()
{
if (g_PlaceName == this)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just before, should we also call

IGameSystem::Remove(this);

?

{
char name[MAX_PLACE_NAME_LENGTH];
int count;
Vector averageCenter;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be easier/safer to also set vec3_origin here?

Vector averageCenter = vec3_origin;

animationAlpha = shouldDrawPlaceNames ? min(1.0f, animationAlpha + (gpGlobals->frametime * ANIMATION_SPEED))
: max(0.0f, animationAlpha - (gpGlobals->frametime * ANIMATION_SPEED));

for (PlaceNameCallout place : places)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this could be a reference to avoid a copy?

for (PlaceNameCallout &place : places)

for( int i=0; i<placeCount; ++i )
{
len = fileBuffer.GetUnsignedShort();
fileBuffer.Get( placeName, MIN( sizeof( placeName ), len ) );

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point, might be a good idea to initalize all the placeName(s) to either have their placeName or to cap off the string with a null terminator like:

placeName[ MIN( sizeof( placeName ) - 1, len ) ] = '\0';

{
entry -= 1;
Vector newNavCenter = (nwCorner + seCorner) / 2.f;
places[entry].origin = ((places[entry].origin * places[entry].navAreaCount) + newNavCenter) / ++places[entry].navAreaCount;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

embedding the ++ preincrement might be kind of hard to reason about so it might be easier to evaluate that up front and change this line in response:

places[entry].navAreaCount++;
places[entry].origin = ((places[entry].origin * (places[entry].navAreaCount - 1)) + newNavCenter) / places[entry].navAreaCount;

also, might be undefined behavior when the preincrement is evaluated as an operand of /

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Changes in neoAssets This PR depends on changes in the neoAssets repository. The relevant PR should be in the description Tournament Priority Issues to be prioritized for the upcoming NT;RE tournament UI/HUD Relates to the HUD, NeoUI, menus, etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants