Skip to content

Limit all survivors to the same limit - #12980

Open
Drulikar wants to merge 2 commits into
cmss13-devs:masterfrom
Drulikar:dont_exceed_surv_limit
Open

Limit all survivors to the same limit#12980
Drulikar wants to merge 2 commits into
cmss13-devs:masterfrom
Drulikar:dont_exceed_surv_limit

Conversation

@Drulikar

@Drulikar Drulikar commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

About the pull request

This PR does a couple things:

  • Limits all survivors to the same limit (meaning CO & Synth survivors no longer can exceed normal count)
  • Cleans up some inconsistent return values for set_spawn_positions (it doesn't need a retval)

This means that

/datum/job/civilian/survivor/set_spawn_positions(count)
spawn_positions = clamp((floor(count * SURVIVOR_TO_TOTAL_SPAWN_RATIO)), 2, 8)

is respected for all survivors such that if the population only allows 3, its only 3 (rather than 3 + 0-2). No longer should it be possible to see 10 survivors in a single round.

Explain why it's good for the game

During lowpop previously survivors could nearly double their intended count which is undesired.

Testing Photographs and Procedure

Procedure1 normal + 1 synth (min 2) -> both spawned, one is synth
1 normal + 1 synth (min 1) -> only one spawned
2 normal (min 1) -> only one spawned
2 normal (min 2) -> both spawned
2 co (min 2) -> only one spawned
1 co + 1 synth (min 2) -> both spawned, one is synth
1 co + 1 synth (min 1) -> only one spawned

(When I say min 1 I mean changing spawn_positions = clamp((floor(count * SURVIVOR_TO_TOTAL_SPAWN_RATIO)), 2, 8) to spawn_positions = clamp((floor(count * SURVIVOR_TO_TOTAL_SPAWN_RATIO)), 1, 8))

Changelog

🆑 Drathek
balance: Synth and CO survivors now respect the normal survivor limit
/:cl:

@github-project-automation github-project-automation Bot moved this to Awaiting Review in Review Backlog Aug 21, 2026
@cmss13-ci cmss13-ci Bot added Balance You need to be a professional veteran game maintainer to comprehend what is being done here. size/S Denotes a PR that changes 19-49 lines, ignoring generated files. labels Aug 21, 2026

// Count all current_positions
var/exisiting_positions = 0
for(var/other_surv_type in typesof(/datum/job/civilian/survivor))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

other might be a misnomer if you re-count them all with typesof

Comment on lines +37 to +39
if(!base_job)
stack_trace("/datum/job/civilian/survivor is not present in GLOB.RoleAuthority.roles_by_path!")
return 0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

roles_by_path is built on typesof() so that pretty much can't happen. up to you, just my 2cents, but letting it crash on the line below is probably good enough

@github-project-automation github-project-automation Bot moved this from Awaiting Review to Partially Approved / Mergeable in Review Backlog Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Balance You need to be a professional veteran game maintainer to comprehend what is being done here. size/S Denotes a PR that changes 19-49 lines, ignoring generated files.

Projects

Status: Partially Approved / Mergeable

Development

Successfully merging this pull request may close these issues.

2 participants