Skip to content

Use a weighted pool system instead of hardcoded chances for each role#4

Open
cg-223 wants to merge 7 commits into
KadavasKingdom:mainfrom
cg-223:random-randomness
Open

Use a weighted pool system instead of hardcoded chances for each role#4
cg-223 wants to merge 7 commits into
KadavasKingdom:mainfrom
cg-223:random-randomness

Conversation

@cg-223

@cg-223 cg-223 commented May 3, 2026

Copy link
Copy Markdown
Member

There are a few problems this solves.
One of them is that custom roles are chosen independently of actual player roles, which leads to needing to do weird things like reducing spawn rates when the player count is low (which has many problems, like just flat out making the SCP team much less likely to have custom roles).

It also would fix the issue with high spawn rate boosts leading to the exact same role being picked every time.

I also fix waves having the same roles in them every time with this.

Also, some things would be fixed that aren't very noticeable issues (if a godlike custom role spawns but no player is available to be replaced by that godlike, nothing happens. this wouldn't matter, but if this happens in a game it would mean that no other godlike role would ever even get a chance to roll to spawn).

I believe this approach has better performance as well, although I can't confirm this with benchmarks.

This would also be breaking, all roles have a different chance of spawning now (mostly because their spawn chances can't overlap anymore). Some adjustments might have to be made to individual role chances to make them feel the same as before.

Several new configs are added with this, to hopefully make fiddling with odds easier. It should be possible to do more things with modifying chances in SCR by simply editing the main config file (or the group config file) rather than every individual custom role file.

@cg-223
cg-223 force-pushed the random-randomness branch 2 times, most recently from f512f47 to e0aca66 Compare May 3, 2026 21:39
@cg-223
cg-223 force-pushed the random-randomness branch from 469b7df to c769216 Compare May 12, 2026 22:46
@cg-223
cg-223 force-pushed the random-randomness branch from c769216 to c341e70 Compare May 12, 2026 22:49
@cg-223
cg-223 marked this pull request as ready for review May 12, 2026 22:49
@cg-223

cg-223 commented May 12, 2026

Copy link
Copy Markdown
Member Author

@SlejmUr don't have perms to add you as reviewer, but should be ready now

Comment thread .github/CODEOWNERS
@SlejmUr
SlejmUr self-requested a review May 13, 2026 05:50
Comment thread SimpleCustomRoles/Pools/Pool.cs
Comment thread SimpleCustomRoles/Handler/ServerHandler.cs Outdated
Comment thread SimpleCustomRoles/Pools/Pool.cs Outdated
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.

2 participants