Generator Random Seed | World Anvil

Remove these ads. Join the Worldbuilders Guild

Generator Random Seed

New Feature Addition · Articles & templates · Created by kailinprime
accepted
api random generator scripting
Random Generators are awesome, but they are missing one thing:   Deterministic Generation.   The randomness of generators is (I assume) base on some internal instance of rand() or some equivalent library. When I am building a complex library, I would like to be able to generate a random number, and then pass that seed into the generator as a parameter so that I can recreate the same data (assuming I did not change anything).   I propose a general parameter added to anything that uses randomization called   "seed"   Passing that parameter will initialize the random generator under the hood.   TMK, this is a non-breaking change to any features as it is an addition to the API/Scripting.

Follow up


Another thought. Typically, if you pass a seed into a library, then every time you go get a new number it get the next random number. If I were to have a chain of generators, and I were to pass the same 'seed' into the lib, it would produce the same number. I should be able to pass a 'next' number from that initial seeded random library into subsequent generators references from routers. In essence, I do not want to pass a seed and get '4' from every generator is a tree. I want to pass whatever random 'next' I have to the child libraries as their own 'seed'.   So passing a Seed value is the first thing:   I should be able to pass an actual value to the Randomization to actually 'pick' an option. (Typically, I might include something like12398798712331 to a list with 2 items of equal weight and get the option in the '1' position.   Passing that additional actual value in conjunction with the seed would all for something like this:   rand(SEED)   let val1 = rand.next() // 2553164546325325436 let val2 = rand.next() // 7654326437563464331   let result1 = generator_1({mod_value=rand1}) let result2 = generator_2({mod_value=rand2})   The randomized seed is used to create the parent generator at that seed. The mod_values and used to select the actual value from the generator or list and allow for a deterministic result without have the same random number passed to each randomized list.   This is important because the size of tables will likely not diverge greatly. So you will see the results of rolling the same ordinal position ('1','1','1') for each chained table/generator instead of just making the initial seed for randomization predictable. (i.e., do the size of your tables differ that much? I bet they are mostly less than 10 options in any given table. Do you want and roll of 1 to also always produce a result of 1 on it's children?)
Thank you!

The Team's Response

This had extremely low support, but we can see if this is something easy to achieve. If it is it will be actioned.
Current score

15/300 Votes · +2760 points

Votes Cast

  • +300

    by Guoccamolé
    on 2022-01-22 20:41
  • +300

    by Merel.xx
    on 2022-01-21 08:50
  • +100

    by Wanderspeak
    on 2022-01-19 14:41
  • +300

    by clonetone
    on 2022-01-13 07:31
  • +200

    by DMFW
    on 2022-01-10 18:39
    I can understand the use case for this and support it, even though I probably won't use it myself.
  • +100

    by Vantaj
    on 2022-01-08 17:19
    I use this feature in other random table sytems.
  • +300

    by SoaringMoon
    on 2022-01-07 23:08
  • +50

    by Adcheryl
    on 2022-01-07 07:16
  • +100

    by Buzzard
    on 2022-01-06 17:05
  • +50

    by joeygraceffa
    on 2022-01-06 10:46
  • +100

    by A Enfeebled Dwarf
    on 2022-01-05 21:01
  • +200

    by FenDawnchild
    on 2022-01-05 13:14
  • +10

    by AuraGuard
    on 2022-01-05 13:12
  • +50

    by torimiyaz
    on 2022-01-05 05:18
  • +300

    by SoulLink
    on 2022-01-04 18:58
  • +300

    by kailinprime
    on 2022-01-04 16:12