Skip to content

Proposal: Remove PlayerTracking Alpha Feature #4491

@markmandel

Description

@markmandel

Summary

The PlayerTracking feature has been at Alpha (disabled by default) since Agones 1.6.0.
CountsAndLists — a superset replacement — has been at Beta (enabled by default) since 1.41.0
and has been stable there for a significant period. The player-tracking docs already carry a
deprecation notice pointing users to CountsAndLists.

Given that CountsAndLists covers all PlayerTracking use cases and more, and that we are unlikely
to revert CountsAndLists, I'd like to propose that we remove PlayerTracking (and the companion
PlayerAllocationFilter Alpha feature, which depends on it) in the near future. That said,
looking for general consensus before moving forward.

Motivation

  • PlayerTracking (Alpha, disabled) has had no meaningful changes in years and predates the
    generalized CountsAndLists approach.
  • CountsAndLists (Beta, enabled) fully supersedes it: player IDs map to list values, player
    count/capacity map to counter count/capacity.
  • Keeping PlayerTracking adds maintenance burden across the codebase, SDK, docs, and tests
    with no benefit for new users.
  • The existing docs already direct users to migrate:

    "Counters and Lists replaces the Alpha functionality of Player Tracking, and Player Tracking
    will soon be removed from Agones."

Migration Path

Users would migrate to CountsAndLists. The mapping is straightforward:

PlayerTracking CountsAndLists equivalent
spec.players.initialCapacity spec.counters["players"].capacity
status.players.count status.counters["players"].count
status.players.capacity status.counters["players"].capacity
status.players.ids status.lists["players"].values
PlayerAllocationFilter (players selector in GameServerAllocation) counters/lists selectors in GameServerAllocation
SDK.Alpha().PlayerConnect(id) SDK.Beta().AppendListValue("players", id)
SDK.Alpha().PlayerDisconnect(id) SDK.Beta().DeleteListValue("players", id)
SDK.Alpha().SetPlayerCapacity(n) SDK.Beta().SetListCapacity("players", n)
SDK.Alpha().GetPlayerCapacity() SDK.Beta().GetListCapacity("players")
SDK.Alpha().GetPlayerCount() SDK.Beta().ListLength("players")
SDK.Alpha().IsPlayerConnected(id) check SDK.Beta().GetList("players").values
SDK.Alpha().GetConnectedPlayers() SDK.Beta().GetList("players").values

Scope (if we proceed)

Full list of changes required

Feature Gates

  • Remove FeaturePlayerTracking and FeaturePlayerAllocationFilter from pkg/util/runtime/features.go
  • Remove both from install/helm/agones/defaultfeaturegates.yaml
  • Remove both from build/Makefile (ALPHA_FEATURE_GATES)
  • Remove both from cloudbuild.yaml e2e test configuration

GameServer API / CRD

  • Remove PlayersSpec and PlayerStatus types from pkg/apis/agones/v1/gameserver.go
  • Remove players field from GameServer.Spec and GameServer.Status
  • Remove associated validation
  • Remove players field from CRD schema templates in install/helm/agones/templates/crds/

GameServerAllocation API / Proto

  • Remove PlayerSelector message and players field from proto/allocation/allocation.proto
  • Remove PlayerSelector type and Players field from pkg/apis/allocation/v1/gameserverallocation.go
  • Remove player filtering from GameServerSelector.Matches(), ApplyDefaults(), and Validate()
  • Remove proto ↔ k8s API conversion of PlayerSelector in pkg/allocation/converters/converter.go
  • Remove player capacity sort logic from pkg/gameserverallocations/allocation_cache.go

SDK (Alpha methods)

Remove from all SDK implementations (Go, C#, Node.js, Rust, Unity, Unreal):
PlayerConnect, PlayerDisconnect, SetPlayerCapacity, GetPlayerCapacity,
GetPlayerCount, IsPlayerConnected, GetConnectedPlayers, and corresponding RPC
definitions in proto/sdk/alpha/alpha.proto

Controller / SDK Server

  • Remove player tracking logic from pkg/sdkserver/
  • Remove player-tracking-specific metrics (agones_gameserver_player_connected_total,
    agones_gameserver_player_capacity_total)

Generated Code (regenerate after above changes)

  • pkg/apis/agones/v1/zz_generated.deepcopy.goPlayersSpec, PlayerStatus, AggregatedPlayerStatus
  • pkg/apis/allocation/v1/zz_generated.deepcopy.goPlayerSelector in GameServerSelector
  • pkg/allocation/go/allocation.pb.go — generated protobuf for allocation proto
  • pkg/client/applyconfiguration/agones/v1/playersspec.go, playerstatus.go, aggregatedplayerstatus.go

Tests

  • Remove e2e tests gated on FeaturePlayerTracking in test/e2e/gameserver_test.go and test/e2e/fleet_test.go
  • Remove e2e tests gated on FeaturePlayerAllocationFilter in test/e2e/gameserverallocation_test.go
  • Remove unit tests for PlayerSelector in pkg/apis/allocation/v1/gameserverallocation_test.go
  • Remove unit tests in pkg/gameserverallocations/ (allocation_cache_test.go, find_test.go, allocator_test.go)
  • Remove converter tests in pkg/allocation/converters/converter_test.go
  • Remove PlayerTracking and PlayerAllocationFilter from test/upgrade/versionMap.yaml

Documentation

  • Remove site/content/en/docs/Guides/player-tracking.md
  • Remove PlayerTracking and PlayerAllocationFilter rows from site/content/en/docs/Guides/feature-stages.md
  • Remove player-tracking metrics from site/content/en/docs/Guides/metrics.md
  • Remove/update site/content/en/docs/Integration Patterns/player-capacity.md (references both feature gates)
  • Remove Alpha player tracking methods from SDK reference docs (C#, REST, Node.js, Rust, _index.md)

Examples

  • Remove examples/gameserverallocation.yaml players selector block
  • Remove commented PlayerTracking example from examples/gameserver.yaml
  • Audit examples/autoscaler-wasm/model.go for any PlayerTracking dependency

Verify no missed items

  • Run a final grep for PlayerTracking, PlayerAllocationFilter, PlayersSpec, PlayerStatus,
    PlayerSelector, and AggregatedPlayerStatus across the repo to catch anything not listed above

Questions for the Community

  • Is anyone still actively using PlayerTracking who has not yet migrated?
  • Are there any gaps in the CountsAndLists migration path that would block removal?

Metadata

Metadata

Labels

area/user-experiencePertaining to developers trying to use Agones, e.g. SDK, installation, etckind/cleanupRefactoring code, fixing up documentation, etc

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions