PDA

View Full Version : How is the RNG seed established?



Keltyrr
August 9th, 2020, 04:32
Question in the title, any have ideas?

damned
August 9th, 2020, 04:37
Not enough information.

FGU or FGC?
Are you referring to the Lua math.random or the physical dice?

Keltyrr
August 9th, 2020, 04:44
FGC and FGU, as I used both.

But, I am asking how the seed is determined as for what the dice results are.

LordEntrails
August 9th, 2020, 05:08
Depends on how the dice are rolled. If you use the virtual dice that roll, then the seed is generated off of the mouse movement. And a random number generator is not sued, instead it is a physics simulation of rolling dice. If its a non-virtual die, or not generated with the virtual dice, then it comes out of the lua random number generator, don't know the seed.

Curiosity or do you think it matters?

Keltyrr
August 9th, 2020, 05:44
Little of both.

The conversation came up today about possibly resetting the seed if we get a particular case of what some of my players call dice violence. There are times where a game can go 10 minutes and not see a 2 digiti number come up at all, then there are times my players are screaming because I am landing nat20s back to back to back. One of my players (whom is familiar with IT on the corporate IT security level) suggested maybe see if there is a way to allow a player to blow an action point to make me refresh the seed, or if there even is a seed to refresh. Most rolls are done from the sheet via the shortcuts given we play D&D 3.5e.


Truth be told I only understand this stuff on a superficial level I am being given suggestions on what questions to ask.

Zacchaeus
August 9th, 2020, 08:52
This comes up every now and again; and the reason it comes up every now and again is that just like any probability you are just as likely to get 10 1's rolled back to back as you are to get 10 20's rolled back to back.

Someone somewhere did a test rolling thousands of dice and collating the results and found that each number on a d20 comes up approximately 5% of the time which is exactly what you would expect. I can't unfortunately find the post now. Everyone has a story about how the dice rolled low or high all night.

The clear an obvious answer here is that if your players have a problem with dice rolls then they should change their dice colour to fix the issue :)

damned
August 9th, 2020, 09:59
It is not inconceivable that the software might glitch at some point.
If you think that has happened. Kick everyone close FG and relaunch and have everyone try to connect again.

Valyar
August 9th, 2020, 13:30
“Dice violence”. I love this phrase. :D

SGL3386
August 9th, 2020, 13:53
Hello there, the referenced IT person here.

Given that a lot of pRNG ends up relying on using something like LUA's OS.Time function, if you play at the same time every day, and the program were to call math.randomseed when the session is created using system time, then you could get the same seed each time depending on how the creator is using the os.time function. Hence, it becomes a point of interest. I have not looked deeper into LUA's pRNG code to see how it compares to other languages in terms of distribution. Maybe its solid, maybe its not. Different programming languages have various libraries with different feels to their pRNG. Being a scripting language, LUA makes me wince at the idea of it being used, but then again I use python a lot so maybe I shouldn't comment.

My more favored pRNG for things has been sidekickbot for discord which seems to go through fits certainly, but those fits of low rolls tend to last a lot shorter time. This made me wonder about how often sidekick is being queried and how often it would need to change seeds, and by extension how FG handles it. Not sure if I would believe the physics simulator, but I am also a bit too lazy in this line of inquiry to pull out a macro recorder and do the testing myself.

damned
August 9th, 2020, 14:57
What would a Macro recorder tell you?
If you rolled 10million times and you got 3s 11% of the time you could argue that its obviously not random or there would be only 5%.
Or you could argue that 5% is obviously not random....

SGL3386
August 9th, 2020, 15:06
A Macro Recorder would question the idea of it being a physics simulator. By rolling the dice the same every time, you should get the same result IF the physics simulator is in play (haven't payed attention if the dice reset to a given number or go to previous rolled result or some random so maybe irrelevant).

Granamere
August 9th, 2020, 15:33
If you use discoed you might want to reach out to this thread.

https://www.fantasygrounds.com/forums/showthread.php?55918-Fantasy-Grounds-to-Discord-(Grognard-Bot)&highlight=dice+stats

It keeps track of all of the rolls and gives you what the average is. Personally after reading a bunch of these threads here I do not think there is anything wrong with the current system.

esmdev
August 9th, 2020, 15:48
I have the same experience in Fantasy Grounds as I do at the tabletop. When you roll the dice you sometimes get streaks of good luck or bad luck. Everyone notices these streaks but nobody pays any attention to the regular random rolls, so the streaks are more noticeable and more likely to be whined about.

SGL3386
August 9th, 2020, 16:13
Topic drift is occurring.

Claim is that mouse movement is either
1) Being used to do physics simulation (I am pressing X to doubt)
2) Used as input to generate a random seed (maybe/more likely)

Also suggested that the seed is determined in some unknown fashion if its not the emulated "virtual" dice.

I have issue with option 2 as an idea if you are using the ability to roll against an opponent (click-drag an attack onto a token) given you have no input into how the dice is rolled, unless its reading where you are dragging it from and onto token?

Point being however that apparently my theory that apparently at session creation the system creates a randomseed and runs till exhaustion isn't true based on what posters here are saying. I don't know yall so don't know if we had a dev chime in and confirm one way or another, or where the information is coming from, but given the amount of posts, ill take you at your word for the time being.

LordEntrails
August 9th, 2020, 17:38
The devs have chimed in on the past on this topic. They generally don't spend their time doing so any more. Rather they spend it developing the software.

If someone feels strongly enough that the dice are not rolling randomly, they can parse the chatlog.html and do a statistical analysis on it. This file is stored on the hosts computer inside the campaign folder. Their is a 'chatlog scrubber' you can find on the forums to start this process.

To the best of my knowledge, no one has ever posted an analysis of their actual die rolls that shows anything but an expected random distribution. BUT, I'm sure the devs would be very interested if someone did.

Until such a mathematical analysis shows a non-random distribution, I suggest anyone who thinks the die are not random should read up on the topic 'confirmation bias'. One place to start reading about this topic is here; https://en.wikipedia.org/wiki/Confirmation_bias#Biased_memory

Zacchaeus
August 9th, 2020, 17:43
https://www.fantasygrounds.com/forums/showthread.php?44440-Players-are-complaining-about-low-rolls-(they-think-it-s-a-FG-problem)&p=490361&viewfull=1#post490361

https://www.fantasygrounds.com/forums/showthread.php?37768-Campaign-Game-Statistics

BaneTBC
August 9th, 2020, 20:47
I just run with the very easy answer if any of my players feel that the "dice are out to get them", "rigged" or otherwise "just not right", I tell them to swap to manual and feel free to use their own dice. Frankly, we all have enough other things we have to do that wasting time on relieving people's perceived dice bias' just isn't worth it. One group, they just make it a running meme that the rogue is always going to roll bad rolls. Another group, they swear that the DM's rolls are weighted against them, even after getting to see a statistical analysis of how their rolls have been and that they are just looking at the high rolls and ignoring the dozens of other low rolls because it never impacted them.

damned
August 10th, 2020, 00:52
A Macro Recorder would question the idea of it being a physics simulator. By rolling the dice the same every time, you should get the same result IF the physics simulator is in play (haven't payed attention if the dice reset to a given number or go to previous rolled result or some random so maybe irrelevant).



Topic drift is occurring.

Claim is that mouse movement is either
1) Being used to do physics simulation (I am pressing X to doubt)
2) Used as input to generate a random seed (maybe/more likely)

Also suggested that the seed is determined in some unknown fashion if its not the emulated "virtual" dice.

I have issue with option 2 as an idea if you are using the ability to roll against an opponent (click-drag an attack onto a token) given you have no input into how the dice is rolled, unless its reading where you are dragging it from and onto token?

Point being however that apparently my theory that apparently at session creation the system creates a randomseed and runs till exhaustion isn't true based on what posters here are saying. I don't know yall so don't know if we had a dev chime in and confirm one way or another, or where the information is coming from, but given the amount of posts, ill take you at your word for the time being.

I havent used FGU much so my comments are FGC based
You can pick up the dice and you throw them and you can throw them fast or slow and you can throw them in different directions and from different positions.
You can also spin the d20 and for longer or shorter.
I dont know because I havent seen the code but it has been described by the devs as using a physics engine.
My anecdotal experience suggests that the randomness is pretty fair.

Neovirtus
August 10th, 2020, 02:30
I havent used FGU much so my comments are FGC based
You can pick up the dice and you throw them and you can throw them fast or slow and you can throw them in different directions and from different positions.
You can also spin the d20 and for longer or shorter.
I dont know because I havent seen the code but it has been described by the devs as using a physics engine.
My anecdotal experience suggests that the randomness is pretty fair.

In FGU the dice are thrown at max speed all the time, and are not controlled by mouse movement. This is a known bug I hope to see fixed soon. I don't normally question the randomness of the physical dice simulations, but I could envision in the current scenario, that if the dice are always being thrown at max speed and in the same direction randomness could be impaired.

edit: For clarity, I haven't seen any evidence of non-random dice behavior myself. Just hypothesizing. I recently rolled about 600 dice and parsed the chatlog myself and didn't see any abnormal results.