Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes things being statistically weighted to drop in security #88788

Merged
merged 11 commits into from
Jan 7, 2025

Conversation

StrangeWeirdKitten
Copy link
Contributor

@StrangeWeirdKitten StrangeWeirdKitten commented Dec 29, 2024

About The Pull Request

Hey, fun fact, get_safe_random_station_turf() is not as random as it seems. The more areas a department has (blame security), there is a much bigger chance for it to land in that department.

Creates a get_safe_random_station_turf_equal_weight() which first picks a department, creates a list of areas from that department, to then pass into get_safe_random_station_turf()

Why It's Good For The Game

Here's get_safe_random_station_turf() ran 1000 times.

204 - Security
105 - Science
106 - Engineering
101 - Medical
61 - Cargo 
118 - Service
7 - Maintenance (This is only the xenobio cuck room, so it doesn't matter)
85 - Command
79 - Hallway
84 - AI Monitored (Vault, AI sat, etc)

As you can see, the probability for choosing a place like security is much higher. Yes, this is funny for things like the CRAB. But the probability for choosing anywhere else (like command) can be less then 10 percent.

Here's with this proc.

Security - 107
Science - 107
Engineering - 105
Hallway - 94
Command - 104
Medical - 109
Service - 106
Cargo - 105
AI_monitored - 127

Changelog

🆑
fix: Things that drop in random places are no longer statistically weighted to drop in security.
/:cl:

@tgstation-server tgstation-server added Fix Rewrites a bug so it appears in different circumstances Code Improvement Code is now easier to copy paste. labels Dec 29, 2024
@StrangeWeirdKitten
Copy link
Contributor Author

prob don't need the code changelog since it isn't player facing

@carlarctg
Copy link
Contributor

prob don't need the code changelog since it isn't player facing

it very much is wtf

@StrangeWeirdKitten
Copy link
Contributor Author

StrangeWeirdKitten commented Dec 30, 2024

it very much is wtf

Yes, that's why the fix changelog is there

I had a separate entry detailing the proc, which I removed

@SmArtKar SmArtKar enabled auto-merge (squash) January 7, 2025 19:59
@SmArtKar SmArtKar merged commit 7e20627 into tgstation:master Jan 7, 2025
22 checks passed
@StrangeWeirdKitten StrangeWeirdKitten deleted the testing-this-proc branch January 7, 2025 20:09
tgstation-ci bot added a commit that referenced this pull request Jan 7, 2025
github-actions bot added a commit that referenced this pull request Jan 7, 2025
Absolucy added a commit to Absolucy/Monkestation that referenced this pull request Jan 20, 2025
Absolucy added a commit to Absolucy/Monkestation that referenced this pull request Jan 20, 2025
Absolucy added a commit to Monkestation/Monkestation2.0 that referenced this pull request Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Improvement Code is now easier to copy paste. Fix Rewrites a bug so it appears in different circumstances
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants