Skip to content

Add place names to player pings - #2189

Open
Rainyan wants to merge 32 commits into
NeotokyoRebuild:masterfrom
Rainyan:feat/ping-place-name
Open

Rainyan wants to merge 32 commits into
NeotokyoRebuild:masterfrom
Rainyan:feat/ping-place-name

Conversation

@Rainyan

@Rainyan Rainyan commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Description

When a player pings a location, instead of printing <playername> pinged a location, use the actual named place from the navmesh when available: <playername> pinged <placename>.

If the player ping doesn't accurately hit a named place, instead find the nearest named place within reason, and print: <playername> pinged near <placename>.

Finally, if no such named place was found, fall back to the current style: <playername> pinged a location.

Example:

ping_placenames

Toolchain

  • Windows MSVC VS2022
  • Linux Fedora 44 - GCC 16.2.1 20261029 (Red Hat 16.2.1-3)

Linked Issues

  • fixes #
  • related #

Calculating the place names can be expensive to perf, so offer cvar to disable it.
remove devmsg
remove std::function usage
format the "near" messages client side instead of server side
Add a "server" bool to the event for filtering the predicted events
(because they'd have a bad predicted placename). This way we can allow
printing self-pinged place names which can be useful for team practice,
or just verifying what place name your ping got associated with.
@Rainyan
Rainyan force-pushed the feat/ping-place-name branch from 89512cd to c397b5a Compare November 3, 2026 08:01
@Rainyan
Rainyan marked this pull request as ready for review November 3, 2026 09:20
@Rainyan Rainyan changed the title WIP: Add place names to player pings Add place names to player pings Nov 3, 2026
@Rainyan Rainyan added the UI/HUD Relates to the HUD, NeoUI, menus, etc label Nov 3, 2026
@Rainyan
Rainyan requested a review from a team November 3, 2026 09:21
@Rainyan

Rainyan commented Nov 3, 2026

Copy link
Copy Markdown
Member Author

This should be good for review now.

@sunmachine
sunmachine self-requested a review November 3, 2026 17:38

@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.

Found something that probably violates your own intent as written... gotta' step aside, still reading more.

@sunmachine
sunmachine requested a review from a team November 3, 2026 17:56
Rainyan and others added 11 commits November 4, 2026 12:20
…build

because it is needed for the release path, and would silently fail (because we don't typically assert for release)
do faster ops before the virtual indirection
Remove the incorrect assertion of the function predicate flow being mutually
exclusive with this code path (not true for teamplay maps with 0 named
navmesh places). This is handled gracefully so this assertion can be
removed.
Continuation of a64ece5 for removal of the incorrect & redundant
asserts.
As adapted from code review feedback:
NeotokyoRebuild#2189 (comment)

Co-authored-by: Dan Peavey <sunMachine@users.noreply.github.com>
@Rainyan
Rainyan requested a review from sunmachine November 4, 2026 12:25
Comment on lines +453 to +457
inline bool ArePingsAllowed()
{
// Only allow pings for game modes with friendlies, because it makes no sense to send pings to your enemies.
return IsTeamplay();
}

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.

Ah, so a second design question, maybe for you and @DESTROYGIRL to chat about from their contribution in #2032.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Addressed in 1d32565 - I think the behaviour introduced by #2032 is correct, so I've simply updated the condition to call the new ArePingsAllowed gamerules function to be consistent with changes made by this PR.

The commit 1d32565 is essentially a no-op at this moment (since it just inlines to what we already had), but it makes the intent more explicit in the spirit of a single source of truth.

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.

@Rainyan there might be a contradiction if I'm reading 1d32565 correctly. #2032's behaviour is that Deathmatch players still see their own pings, but ArePingsAllowed() returns false for everyone in Deathmatch, so CheckPingButton (neo_player_shared.cpp:153) never fires the event and the local player gets nothing.

@sunmachine sunmachine Nov 6, 2026 •

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.

(super-specifically DM-and-not-TDM so this likely doesn't matter?) I'm running a sanity check...

@Rainyan Rainyan Nov 8, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@Rainyan there might be a contradiction if I'm reading 1d32565 correctly. #2032's behaviour is that Deathmatch players still see their own pings, but ArePingsAllowed() returns false for everyone in Deathmatch, so CheckPingButton (neo_player_shared.cpp:153) never fires the event and the local player gets nothing.

Oh, I see what you mean now. But still, I assume we would still not want to print pings for non-collaborative modes, since if everyone is your enemy it just doesn't make very much sense as a mechanic to be sending pings in the first place(?)

@Rainyan Rainyan Nov 8, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Do I undestand it correctly you're requesting I preserve the ability for free-for-all DM players to be able to ping stuff just for themselves?

Not saying that as a rhetorical question, but just to make it clear what exactly is the behaviour you would hope I preserve here; this might be a stupid question. (Systematically I guess it would be cool if we had some kind of gamerules sanity checker for these kinds of situations, but anyways.)

@sunmachine sunmachine Nov 8, 2026 •

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.

Bingo! And that's per #2032 specifically, which is why I framed it up top as a contradiction I was observing.

Edit: Not a stupid question. 👍

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

You know what, at this point I just don't care anymore. Realistically, we're never going to release this game, nor am I never going to get hired anywhere, so none of this has any practical meaning besides some kind of ridiculous intellectual exercise that I'm too poor to play along with. Whatever edge case you wanted to change here, I'm sure you can throw at Claude and it'll come up with a solution faster and more correct than I ever could.

I don't think there's anything for me to do here anymore, in this PR, or in this repo, or in this ridiculous line of career where apparently human engineering is just not worthwhile anymore, and I'm tired to pretend otherwise. Godspeed to you guys, it was a good run.

@Rainyan Rainyan Nov 18, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

In case you're still willing to humour this PR after my meltdown, I have addressed the aforementioned in d598dbc. If that's still insufficient then I frankly don't know what we are even building here but hopefully you will have a better idea.

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 glad to see and read an update dude, hope you're well man. I'll give this proper thought again soon, this week is a life-heavy week!!

@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.

Your own pings no longer show on your screen by default when using cl_neo_player_pings_print_own 0.

But, your teammates still see them!! These three suggestions restore it and should be applied together.

Co-authored-by: Dan Peavey <sunMachine@users.noreply.github.com>
@Rainyan
Rainyan force-pushed the feat/ping-place-name branch from 9075847 to 1dc2eb0 Compare November 6, 2026 12:59
@Rainyan

Rainyan commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

@sunmachine Thanks, adapted your fix above to 1dc2eb0

@Rainyan
Rainyan requested a review from sunmachine November 6, 2026 13:08
Merging the ping behaviour behind `CNEORules::ArePingsAllowed` as part
of PR NeotokyoRebuild#2189.

This is a no-op at time of this commit, since we're
essentially just inlining the `IsTeamplay` call, but it makes the intent
more explicit and aligns with the PR changes.

@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.

One last thing to double-check, see my confusion here.

Comment on lines +153 to +157
if (!NEORules() || !NEORules()->ArePingsAllowed())
{
return;
}

@sunmachine sunmachine Nov 6, 2026 •

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.

This is the contradiction I was talking about. This will remove a DM players' own pings.

The other suggestions added in this review handle the code move and fix it.

Suggested change
if (!NEORules() || !NEORules()->ArePingsAllowed())
{
return;
}

@Rainyan Rainyan Nov 8, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sorry, I'm still not quite clear on why we would not want to check for this condition here. But I'll probably have to sit down and go through this all again properly from the beginning and pay more attention.

@sunmachine sunmachine Nov 8, 2026 •

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.

If you mean "why remove exactly this part and put it back in a different way elsewhere", it's because I'm removing the check from the player's CheckPingButton and making it happen at the HUD level instead where it has knowledge of isOwnPing.

Edit: And specifically if we block the event from sending here, you won't see your own event. Why keep it on the server at all then in this case? Demo recording and being consistent about its usability is all I can fathom, honestly.

Comment on lines +143 to +147
// This is already checked by the emitter side, but we check again because it could arrive late (dynamic custom rule change etc.)
if (!NEORules() || !NEORules()->ArePingsAllowed())
{
return;
}

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.

With the send-side check gone, only the null guard is needed here. Moving ArePingsAllowed to another area...

Suggested change
// This is already checked by the emitter side, but we check again because it could arrive late (dynamic custom rule change etc.)
if (!NEORules() || !NEORules()->ArePingsAllowed())
{
return;
}
if (!NEORules())
{
return;
}

const bool isOwnPing = (pingerIndex == localPlayer->entindex());
if (!isOwnPing)
{
if (pingerIndex == 0 || GetClientVoiceMgr()->IsPlayerBlocked(pingerIndex))

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.

Outside teamplay, only other players' pings get dropped, so your own still shows.

Suggested change
if (pingerIndex == 0 || GetClientVoiceMgr()->IsPlayerBlocked(pingerIndex))
// Pings can arrive late after a rule change, so filter other players' pings here.
if (pingerIndex == 0 || GetClientVoiceMgr()->IsPlayerBlocked(pingerIndex) || !NEORules()->ArePingsAllowed())

Comment thread .gitignore Resolved
@Rainyan

Rainyan commented Nov 8, 2026 •

Copy link
Copy Markdown
Member Author

Closing per #2189 (comment)

@Rainyan Rainyan closed this Nov 8, 2026
@Rainyan Rainyan reopened this Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

UI/HUD Relates to the HUD, NeoUI, menus, etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants