Use a weighted pool system instead of hardcoded chances for each role#4
Open
cg-223 wants to merge 7 commits into
Open
Use a weighted pool system instead of hardcoded chances for each role#4cg-223 wants to merge 7 commits into
cg-223 wants to merge 7 commits into
Conversation
cg-223
force-pushed
the
random-randomness
branch
2 times, most recently
from
May 3, 2026 21:39
f512f47 to
e0aca66
Compare
cg-223
marked this pull request as ready for review
May 12, 2026 22:49
Member
Author
|
@SlejmUr don't have perms to add you as reviewer, but should be ready now |
cg-223
commented
May 12, 2026
SlejmUr
self-requested a review
May 13, 2026 05:50
SlejmUr
reviewed
May 13, 2026
SlejmUr
reviewed
May 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.