Skip to content

Matchmode play time calculated differently#310

Open
darkshade9 wants to merge 1 commit intoaqtion-alphafrom
mm_connected_time
Open

Matchmode play time calculated differently#310
darkshade9 wants to merge 1 commit intoaqtion-alphafrom
mm_connected_time

Conversation

@darkshade9
Copy link

@darkshade9 darkshade9 commented Mar 24, 2026

Summary

  • Adds active_frames field to track actual match play time per player
  • In matchmode, FPM (Frags Per Minute) now uses active play time instead of total connected time
  • Only frames where a player is on a team and not a substitute count toward FPM
  • Connecting early during warmup, spectating, or being a sub no longer inflates the time denominator
  • Non-matchmode games are unaffected (falls back to connected time)
  • Ghost system preserves active play time across disconnect/reconnect

Files changed

  • g_local.h — Added active_frames to client_respawn_t and gghost_t structs
  • g_main.c — Increment active_frames each frame when player is actively on a team during a live match
  • tng_stats.c — FPM calculations prefer active_frames when available; ghost stats reconstruction updated
  • p_client.c — Save active_frames to ghost on disconnect
  • a_cmds.c — Restore active_frames from ghost on reconnect
  • doc/action.md — Documented the new FPM behavior in the Statistics section

Test plan

  • Connect to matchmode server early — FPM should stay 0 during warmup
  • Start match on a team — FPM accumulates based on active play time
  • Go spectator mid-match — FPM denominator freezes
  • Become a sub — FPM denominator freezes
  • Disconnect and ghost back — FPM preserved correctly
  • Non-matchmode game — FPM works as before
  • Verify external stats JSON ("f" field) reports correct FPM

🤖 Generated with Claude Code

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