Skip to content

New spectate commands#1611

Merged
AdamTadeusz merged 10 commits intoNeotokyoRebuild:masterfrom
AdamTadeusz:315_spectatePlayerAtCenterOfScreen
Mar 10, 2026
Merged

New spectate commands#1611
AdamTadeusz merged 10 commits intoNeotokyoRebuild:masterfrom
AdamTadeusz:315_spectatePlayerAtCenterOfScreen

Conversation

@AdamTadeusz
Copy link
Copy Markdown
Contributor

@AdamTadeusz AdamTadeusz commented Jan 15, 2026

Description

This PR now adds commands for spectating a player based on their position in the new top hud, as well as spectating a player closest to the center of the screen and spectating the fastest player.

The following commands require the new squad hud to work reliably/at all

spec_player_by_hud_position works similar to sm_spec_slot, except theres no guarantee that the first 5 numbers will correspond to jinrai entirely, or that the next 5 numbers will correspond to nsf entirely. In a 3v3 scenario, spec_player_by_hud_position 0-2 will return jinrai players, and spec_player_by_hud_position 3-5 will return nsf players. In a 10v10 scenario spec_player_by_hud_position 0-9 will return jinrai players, and 10-19 will return nsf players. This makes the same binds work for any tournament format, though in games with more than 10 players you are likely to run out of binds.

select_next/previous_alive_player_in_hud change which player in the top hud is selected, without changing the observer mode to that player. Everytime the selection changes that player will flash with an orange colour for one second. The command spectate_player_selected_in_hud can then be used to change the spectate target to the currently selected one.

spec_next/previous_entity_in_hud works similar to select, except the spectate target is changed immediately. The next and previous targets are determined by the current target, not where the selection is.

The following commands will work regardless of the new squad hud being enabled

spec_player_under_mouse will change the spectate target to whoever's center of mass is closes to the center of the spectator's screen

spec_fastest_player will change the spectate target to whoever is currently moving the fastest.

I have included an example config to try out the new commands. I recommend backing up your current config/controls beforehand

(Edit)

I have also added
sm_spec_last_hurt — Target on the last player who was damaged.
sm_spec_last_shooter — Target on the last player who fired their weapon.
sm_spec_last_event — Target on the latest event of any kind from the list below:
sm_spec_last_attacker — Target on the last player who did damage.
sm_spec_last_killer — Target on the last player who got a kill.
sm_spec_last_ghoster — Target on the last ghost carrier.

In the form of
spec_last_hurt
spec_last_shooter
spec_last_event
spec_last_attacker
spec_last_killer
spec_last_ghoster

(Edit 2)

I have also added a command to automatically spectate the killer of the current spectate target

-fixes #1647

@AdamTadeusz
Copy link
Copy Markdown
Contributor Author

One issue I've found using this so far is that it's difficult to know exactly who is closest to the center of the screen without a crosshair

@AdamTadeusz
Copy link
Copy Markdown
Contributor Author

AdamTadeusz commented Jan 15, 2026

Now I'm wondering if it would be better to workout the player closest to the center client side and have a command sent to the server to spectate a specific player instead, that way there wouldn't be any issues with prediction and you could also use this for binds to spectate specific players without looking at them

@Subvoltic4
Copy link
Copy Markdown

I can test this out later today. I do have a suggestion, though not sure how much of a lift it is on your end. Would it be better to draw a camera icon or the players name above their head when they are the one closest to the clients screen center?

@AdamTadeusz AdamTadeusz marked this pull request as draft January 16, 2026 10:39
@Agiel Agiel added the Tournament Priority Issues to be prioritized for the upcoming NT;RE tournament label Feb 8, 2026
Copy link
Copy Markdown
Contributor

@Agiel Agiel left a comment

Choose a reason for hiding this comment

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

What's the status of this PR? I think it's fine to merge as is. If we want more explicit feedback before switching to the new target we can add that later.

Comment thread src/game/client/clientmode_shared.cpp Outdated
@AdamTadeusz
Copy link
Copy Markdown
Contributor Author

What's the status of this PR? I think it's fine to merge as is. If we want more explicit feedback before switching to the new target we can add that later.

yeah i started messing around with a clean spectator ui in this pr ill have to move that stuff to a separate branch when i can be bothered

@AdamTadeusz
Copy link
Copy Markdown
Contributor Author

the naming of some of the functions is still a mess, but technically it works

@AdamTadeusz AdamTadeusz marked this pull request as ready for review March 8, 2026 13:31
@AdamTadeusz AdamTadeusz requested review from a team and Agiel March 8, 2026 13:31
@AdamTadeusz AdamTadeusz changed the title Spectate player at center of screen New spectate commands Mar 8, 2026
…for recent commands if player not in a observer mode that follows the player
Comment thread src/game/client/neo/ui/neo_hud_round_state.cpp Outdated
…ommands, this config is meant to be copied and changed
@Agiel Agiel requested a review from a team March 9, 2026 20:34
@Agiel
Copy link
Copy Markdown
Contributor

Agiel commented Mar 9, 2026

This should close #1647

@AdamTadeusz AdamTadeusz merged commit 537e7c5 into NeotokyoRebuild:master Mar 10, 2026
7 checks passed
@AdamTadeusz AdamTadeusz deleted the 315_spectatePlayerAtCenterOfScreen branch March 10, 2026 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Tournament Priority Issues to be prioritized for the upcoming NT;RE tournament

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Spectator binds for observing matches

4 participants