Garry's Mod

Garry's Mod

Not enough ratings
Ban Randomseed
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Tool
File Size
Posted
1.333 KB
28 Jun, 2020 @ 11:49am
1 Change Note ( view )

Subscribe to download
Ban Randomseed

In 1 collection by miniduikboot
KnighTTTs Server Pack
177 items
Description
Ban Randomseed prevent other addons from seeding the RNG used by Garry's Mod. The default RNG isn't very good, but one of the issues it has that makes it bad is that when seeds that are very close by are used, the nth item after reseeding is not sufficiently random, for all values of n up to 30 on Linux. This can lead to a relatively similar role distribution in TTT or to other issues, as often the RNG is regularly reseeded with a timestamp. See this post[gist.github.com] for more context.

This addon proposes the nuclear option to solve bad RNG issues by completely forbidding reseeding: seed the RNG, call it 30 times to warm it up properly, then override the math.randomseed[wiki.facepunch.com] function. Every time this function is then called the caller will be logged, so you can discover who is reseeding your RNG.

This addon may break certain addons that depend on a certain state of the RNG, for example the TTT awards screen. Please use with caution.

--
The picture of the dice used in the icon are from Wikipedia User PierreSelim and is used under CC BY 3.0: https://en.wikipedia.org/wiki/Diceware#/media/File:Dice_-_1-2-4-5-6.jpg

This addon is licensed under the Unlicense
6 Comments
dolpin 2.0 30 Jul, 2023 @ 1:38pm 
use a dedicated server
Ciel 20 Jul, 2023 @ 9:22pm 
It says "addon too new to use old API"; is there a way to fix this?
miniduikboot  [author] 29 Jun, 2020 @ 10:41am 
You can mess with math.random (and one way to do that is by seeding the RNG, which this addon blocks). If you really want to mess with math.random you can override that function in a similar to how I overrided the math.randomseed function, but that will break all users of the RNG in Gmod, so I'd highly recommend against that.
NextKurome76TheSoldier 29 Jun, 2020 @ 10:31am 
yeah, what i meant was math.random, but i guess this one can't be messed with
miniduikboot  [author] 29 Jun, 2020 @ 10:27am 
Probably not, this addon only changes the math.randomseed function and the item you were talking about doesn't use that function.
NextKurome76TheSoldier 29 Jun, 2020 @ 7:55am 
could this finally possibly break the qtg invincible npc?