Skip to content

Walking Indicator - #1831

Open
AdamTadeusz wants to merge 18 commits into
NeotokyoRebuild:masterfrom
AdamTadeusz:340_walkingIndicator
Open

AdamTadeusz wants to merge 18 commits into
NeotokyoRebuild:masterfrom
AdamTadeusz:340_walkingIndicator

Conversation

@AdamTadeusz

@AdamTadeusz AdamTadeusz commented Mar 13, 2026 •

Copy link
Copy Markdown
Contributor

Description

NeoAssets PR

Adds a walking indicator with an optional bar that indicates how close the player is to breaching the threshold above which the player will make noise regardless (mostly for debugging but some players may choose to use it in game i guess).

Also adds a command to set bot skin, since I forgot to remove it xP

Toolchain

  • Windows MSVC VS2022

@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 Mar 13, 2026
@AdamTadeusz
AdamTadeusz marked this pull request as draft April 4, 2026 09:31
@AdamTadeusz AdamTadeusz added the New Changes for Reviewers New changes has been made. This label is mostly to notify reviewers. label Jul 30, 2026
@AdamTadeusz
AdamTadeusz requested a review from a team July 30, 2026 17:19
@AdamTadeusz
AdamTadeusz marked this pull request as ready for review July 30, 2026 17:19
@DESTROYGIRL DESTROYGIRL added the UI/HUD Relates to the HUD, NeoUI, menus, etc label Aug 28, 2026
Comment thread game/neo/scripts/HudLayout.res Resolved
@Rainyan
Rainyan self-requested a review September 9, 2026 11:38
Rainyan
Rainyan previously approved these changes Sep 9, 2026
@AdamTadeusz AdamTadeusz added the Conflict conflicts with master label Oct 10, 2026
@AdamTadeusz AdamTadeusz removed Changes in neoAssets This PR depends on changes in the neoAssets repository. The relevant PR should be in the description Conflict conflicts with master New Changes for Reviewers New changes has been made. This label is mostly to notify reviewers. labels Oct 30, 2026
@AdamTadeusz
AdamTadeusz requested a review from Rainyan October 31, 2026 12:51

@Rainyan Rainyan left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, left some nits as per usual but I don't require any changes, as the PR has been in limbo for quite some time. Just mark as resolved if you'd rather not add more commits to this.


ConVar cl_neo_hud_rangefinder_enabled("cl_neo_hud_rangefinder_enabled", "1", FCVAR_ARCHIVE,
"Show the rangefinder", true, 0.0f, true, 1.0f);
wchar_t m_wszRangeFinder[11];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: not technically a member (m_...) of the object instance, so perhaps this should be caps-case instead, for readability. Not that it really matters too much.

Comment on lines +64 to +65
C_NEO_Player* pTargetPlayer = pLocalPlayer->IsObserver() && (pLocalPlayer->GetObserverMode() == OBS_MODE_IN_EYE || pLocalPlayer->GetObserverMode() == OBS_MODE_CHASE)
? static_cast<C_NEO_Player *>(pLocalPlayer->GetObserverTarget())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: If we ever add observer targets that are non-players (for example observing some kind of objective for a custom game mode like Jeff/Payload/etc, the static_cast<C_NEO_Player *>(pLocalPlayer->GetObserverTarget()) would be UB. I guess we'll hear from it if it happens but could be a place for some defensive if checks.

Perhaps grab a C_BaseEntity* instance first, then check ->IsPlayer, and if that passes, then we should be safe to static cast into C_NEO_Player* as long as it holds true that all players always are CNEOPlayers.

But I'm ok with merging this and fixing in the future if it breaks.

static float animWalkKeyPressed = 0.f;
const bool isWalking = pPlayer->IsWalking();
static float animIsMakingFootsteps = 0.f;
const bool isMakingFootsteps = pPlayer->IsMakingFootstepSounds() || !(pPlayer->GetFlags() & FL_ONGROUND);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: for isMakingFootsteps value, maybe flip the || around to check the simpler FL_ONGROUND case first, so for the lucky case we don't need to call the more complex IsMakingFootstepSounds at all.

Comment on lines +27 to +28

CPanelAnimationVarAliasType(int, m_iXpos, "xpos", "r203", "proportional_xpos");

@Rainyan Rainyan Nov 2, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is the value supposed to be "203" instead of "r203" here, or is that a typo?

Grepping around we also do it at https://github.com/NeotokyoRebuild/neo/blame/5cb282a7a0ea123a2b571c01c22e6f953aa69eb0/src/game/client/neo/ui/neo_hud_ammo.h#L40 but I was too lazy to expand the macros and figure out where this is parsed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

specifying proportional_xpos uses CProportionalIntWithScreenspacePropertyX, and in ExtractValue ComputePos checks whether the first character is an alignment character. The default value here should follow the default value in HudLayout.res where I actually use c30 and c40, meaning 30 pixels to the right and 40 pixels down from the center of the screen on 640x480, but actually once I remove the entry the text is nowhere near the center, so there must be some difference in how the value in hudlayout.res is handled compared to the default in this constructor 🤔

@Rainyan
Rainyan requested a review from a team November 2, 2026 12:08

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

LGTM

Funny enough, the following is not a problem because it ended up getting fixed by #2264... But without a fix that takes into account weapon speed ratio, walking when you do not have a weapon (such as in the tutorial) on the branch at time of writing showed "NOT WALKING" with any movement. But rebasing this branch on top of the current master will resolve this issue.

walking-indicator-bug-not-no-wep.mp4

If anything, this shows that this feature would have been handy for testing, like with this scenario.

(Added some nits in case you want to look into them after a rebase, but I'm fine with future PRs considering those nits as well.)

Comment on lines +36 to +37
int notWalkingTextWidth = 0;
int textHeight = 0;

@sunzenshen sunzenshen Nov 20, 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.

Nit: notWalkingTextWidth and textHeight are non-const file-scope globals, so they have external linkage. static (or making them members) would keep them private to this file. On the other hand, if that ever becomes a problem then the naming is more obvious within that future context.


ConVar cl_neo_hud_rangefinder_enabled("cl_neo_hud_rangefinder_enabled", "1", FCVAR_ARCHIVE,
"Show the rangefinder", true, 0.0f, true, 1.0f);
wchar_t m_wszRangeFinder[11];

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: The old wchar_t m_wszRangeFinder[11]; member in neo_hud_compass.h is unused now that the rangefinder lives here, so it could be removed. This file-scope buffer could also be static.

"In fractional to the total screen height, the y-axis position of the rangefinder.",
true, 0.0f, true, 1.0f);

ConVar cl_neo_ghost_callout_compass_time("cl_neo_ghost_callout_compass_time", "10.0", FCVAR_CHEAT,

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: Seems like this couples the position of the range finder with the walking indicator, and also resets customized positions of the range finder with the disappearance of these convars. I suppose I'm fine with it because one can disable the walking indicator as a new feature that previously didn't exist and just weak the new hud config, but maybe a future refinement is to allow a player to customize these two elements differently. (on the other hand I see how text alignment can be hard and this could be a pain to align separately)

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.

5 participants