Skip to content

Fix zombies HUD and scoreboard for more than four players - #714

Open
maxis0191 wants to merge 2 commits into
auroramod:developfrom
maxis0191:fix/cp-players-beyond-four
Open

maxis0191 wants to merge 2 commits into
auroramod:developfrom
maxis0191:fix/cp-players-beyond-four

Conversation

@maxis0191

@maxis0191 maxis0191 commented Nov 2, 2026 •

Copy link
Copy Markdown

Problem

On a zombies server with more than four slots:

  • Any player in slot 4 or higher gets very low FPS that keeps dropping, then lag, rollbacks and finally a "server command overflow" kick. The stock CP data sources only build portrait and souvenir coin sources for clients 0-3, so the HUD fails to build for a higher slot and LUI retries it every frame until memory runs out.
  • Players 5-8 never show up on the scoreboard or in the teammate cash list. The zombies scoreboard data only has room for four players.
  • Their stats never add up either. The stock EoG stat update reads the running total back from that four-row table, and slot 4 also overwrites row 0.

Fix

  • ui_scripts/ZombiesPlayers builds the missing image, bigImage and coinImage sources for any client number.
  • With more than four slots, custom_scripts/cp/scoreboard.gsc keeps the totals of slot 4 and up on the player, and sends every player's stats to each client in the ui_cp_scoreboard dvar. It is only sent when it changes, at most once a second.
  • The HUD reads that dvar when a client number above 3 is in the game, lists up to seven teammates and shows eight scoreboard rows. The rows are packed a little tighter so eight fit above the sticker pack, and the mute hint is hidden while it would cover a row.
  • The client registers ui_cp_scoreboard so the value sent by the server can be read from Lua.

Servers with four slots or fewer behave as before, except for the slightly tighter scoreboard rows.

Testing

Private dedicated server with eight slots, one real client and seven bots, on cp_zmb and cp_rave:

Before After
Client in slot 4 3044 LUI errors, FPS falls to 13-19 0 errors, steady 31 FPS
Scoreboard rows 4 at most all 8, with the right values
Stats of slots 4-7 do not add up add up like the others

Large values (over a million cash, 70000 kills) come through unchanged. Row positions were checked in game: seven teammate rows fit above the player HUD and eight scoreboard rows end above the sticker pack.

Not covered

The end of game screen still lists four players, because its data table only has four rows.

The stock CP data sources only create portrait and souvenir sources for
clients 0-3. A player in a higher slot gets nil, the HUD fails to build
and LUI retries it every frame until it runs out of memory.
The zombies scoreboard data only has rows for four players, and the stock
EoG stat update reads its running total back from that table, so players in
slot 4 and up never added up (slot 4 also overwrote row 0).

With more than four slots, the server keeps those totals on the player and
sends every player's stats to each client in ui_cp_scoreboard. The HUD reads
them back, lists up to seven teammates and shows eight scoreboard rows.
@maxis0191 maxis0191 changed the title Fix zombies HUD for players in slots above 3 Fix zombies HUD and scoreboard for more than four players Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant