Skip to content

Player spawn points should be uniformly distributed #1891

@Rainyan

Description

@Rainyan

Build Info

v28.4-alpha

Description

Currently, the spawn point choosing logic is using a random stride of 1-5:

pSpot = pLastSpawnPoint;
// Randomize the start spot
for (int i = random->RandomInt(1, 5); i > 0; i--)
pSpot = gEntList.FindEntityByClassname(pSpot, pSpawnpointName);

This can lead to strange patterns of repeat spawns which are not uniformly distributed, as reported in: https://discord.com/channels/1235346473827434517/1235349179296120946/1486408778357145710

To Reproduce

Observe the spawn points logic.

Expected behavior

Uniform distribution.

Actual behavior

Deterministic random stride of 1-5 + mod cycle.

Operating System

  • Windows
  • Linux

Version/Distro

11

Metadata

Metadata

Assignees

Labels

Bug ReportBug Reports made through the "Report Issue" interface in GitHub.GameplayStuff that isn't gamemode or weapon specific, such as spectating, audio, configs.

Type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions