Random Number Generator
Добавить в игру через Steam
Нажмите «Подписаться»
На странице Steam войдите в аккаунт, если потребуется.
Подписаться
О материале
«Random Number Generator» — материал мастерской Barotrauma. Моды, подлодки, предметы и новые задания для экипажа. Данные Steam, описание автора и ссылка для установки через подписку. Совместимость редакцией не проверена.
Описание автора
This primitive psuedo-random number generator uses the equation $X_{n+1} = (aX_{n}+b) mod m$ to generate a random number. By default, it is between 0 and 100. This can be changed by tweaking m (the maximum number generated is m-1). The initial values of a and b can also be changed to change the initial number, and how they cycle - the order will always be the same.
This has some pretty major limitations:
- The adder and multiplier components are both clamped between ±999999, meaning any number bigger than 999999 becomes 999999 (and similar for -999999) so the system has to not create numbers larger than that. This reduces the quality of the random sequence. If you want to tweak the range of the generated number, I recommend highly that you adjust all of a, b, and m to get the best results.
- The initial value will always be the same. It will also always follow the same order. To get different numbers each time, selecting numbers based on a variable time is easier than selecting the 1st, then 2nd etc. number.
- Given initial conditions may not be capable of generating every number in the range. If this happens, tweak a or b slightly and try again.
Some tricks on selecting values for a and b: The clamps are at roughly 1000000 = 10^6. So we can work with numbers up to that big. The first number to consider is m. Try and select a such that a * m is roughly 10^5. Then select b anywhere up to the order 10^5. This maximises the quality generated.
Hopefully this will be obsolete soon - a random number component should be coming soon (TM).
Как установить и запустить
Откройте оригинальную страницу в Steam Workshop, проверьте версию игры, зависимости и порядок загрузки в описании автора. Нажмите «Подписаться» и дождитесь загрузки Steam. Включите материал в меню модификаций или контента игры, если это требуется. Совместимость и запуск редакцией не проверены.