Garry's Mod

Garry's Mod

评价数不足
Ban Randomseed
   
奖励
收藏
已收藏
取消收藏
素材类型: 插件
插件类型: 工具
文件大小
发表于
1.333 KB
2020 年 6 月 28 日 上午 11:49
1 项改动说明 ( 查看 )

订阅以下载
Ban Randomseed

在 miniduikboot 的 1 个合集中
KnighTTTs Server Pack
177 件物品
描述
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 条留言
dolpin 2.0 2023 年 7 月 30 日 下午 1:38 
use a dedicated server
Captain Bright Noa 2023 年 7 月 20 日 下午 9:22 
It says "addon too new to use old API"; is there a way to fix this?
miniduikboot  [作者] 2020 年 6 月 29 日 上午 10:41 
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 2020 年 6 月 29 日 上午 10:31 
yeah, what i meant was math.random, but i guess this one can't be messed with
miniduikboot  [作者] 2020 年 6 月 29 日 上午 10:27 
Probably not, this addon only changes the math.randomseed function and the item you were talking about doesn't use that function.
NextKurome76TheSoldier 2020 年 6 月 29 日 上午 7:55 
could this finally possibly break the qtg invincible npc?