Tabletop Simulator

Tabletop Simulator

View Stats:
Did dice rolling change?
In the last few weeks we noticed dice rolling has a new effect of doing a sort of immediate dice face change as the bounce starts. Confused us because we're used to clicking roll repeatedly while they're in the air and the result looked like a glitch. But we like the random face change now that we understand it.

Is that a TTS thing or just the Eldritch Horror mod? Or did we maybe change a setting somewhere?
< >
Showing 1-14 of 14 comments
Dunno.U can use dice tower or dice roller from workshop.
Baryonyx May 11 @ 4:24am 
I have observed this behavior you describe for a long while already. I think it's not new.
This behaviour has been around as long as I can remember, at least 7 years. It's the argument to players who don't like it when the die spins around an axis - it's already been randomised before the physics of spin (and lift) are applied.
To echo the others, this is the way the dice have always been. When you roll dice using the actual roll function in this game the result is pre-generated and so the animation has to move the dice to a start point that will allow it to reach the pre-generated end point. That's why the faces automatically change.

I don't know if the same dynamic is true when you manually roll the dice by picking them up. I suspect it is but I do not know.
Baryonyx May 12 @ 9:52am 
Originally posted by Gracey Face:
To echo the others, this is the way the dice have always been. When you roll dice using the actual roll function in this game the result is pre-generated and so the animation has to move the dice to a start point that will allow it to reach the pre-generated end point. That's why the faces automatically change.

I don't know if the same dynamic is true when you manually roll the dice by picking them up. I suspect it is but I do not know.

I think you are wrong here. The dice rolling is still physics based, even if you press R. What the game does is randomly rotate the die, then throw it up in the air. If it were a pregenerated animation, then the die would always land cleanly on a face, which it doesn't do. Also, it can be interrupted and disturbed, which wouldn't be possible if it were an animation.
Originally posted by Baryonyx:
I think you are wrong here.

I might be wrong but you can look at the dice when you R them. It pops up in the air without any rotation then gets a new set of xyz rotational coordinates applied to it and then a rotational velocity also applied to it so that it lands on a specific face. If it was purely "physical" it wouldn't need this, the force used to pop it up from the table could also apply rotational force.

This I suspect is also why you occasionally get chat results that are different from how the actual "physical" die rolled. The chat is reading out the pre-generated result but the physical die was upset by something on the table.

You're right that you can interrupt it though.
Last edited by Gracey Face; May 13 @ 8:42am
Bone White May 13 @ 10:25am 
Originally posted by Gracey Face:
Originally posted by Baryonyx:
I think you are wrong here.

I might be wrong but you can look at the dice when you R them. It pops up in the air without any rotation then gets a new set of xyz rotational coordinates applied to it and then a rotational velocity also applied to it so that it lands on a specific face. If it was purely "physical" it wouldn't need this, the force used to pop it up from the table could also apply rotational force.

This I suspect is also why you occasionally get chat results that are different from how the actual "physical" die rolled. The chat is reading out the pre-generated result but the physical die was upset by something on the table.

You're right that you can interrupt it though.

Chat doesn't print out the result unless scripting is involved, and at the point scripting is involved it could be affecting the dice roll. If you want to discuss scripted dice rolling then the process is completely dependent upon the scripting.

The standard dice rolling behaviour does what Baryonyx outlines. See my post from the Discord below:

Originally posted by "https://discord.com/channels/342471570955960324/368208369812504587/1280459773376073804":

in my mods I will often prevent players from pressing R more than once, randomization in TTS is better than you might first think, when you press R on a die the following things happen:

1) if the die was resting it is given some height above where it currently is (to allow for 2)
2) the die will be given a random rotation instantly
3) the die will be given a random (within limits) amount of vertical velocity and a random (within limits) amount of angular velocity (spin) around a random vector

physics will now apply to the die in future frames
so basically, it doesn't matter if you die gets no height, or spins around the same face due to gimbal lock - it has already been randomized

I and others have tested this thoroughly, and the resulting argument is always "how random is random enough" and for me the answer is "this is random enough"

the one thing that is not random, is players seeing how the die is spinning and then pressing R again to re-randomize the roll

this is far more of an issue than anything else, which is why I prevent players pressing R more than once

No proof for the above, but it is my opinion after thousands of thousands of hours of modding and scripting experience in TTS, including for payment for various companies. Feel free to experiment and test yourself.
Baryonyx May 13 @ 10:27am 
Originally posted by Gracey Face:
[...] so that it lands on a specific face. [...]

But the point is that it doesn't. I just went into the game to check it again and even did it in locked physics mode. The die sometimes lands cleanly on a face, but by far not every time. If the result were precalculated, then why would it not land cleanly on a face every time?

And another thing, how is it then that the die rises higher if you spam R several times? That would mean the game would now create a longer animation? It just makes little sense.

And finally, if it is not physics based, explain to me the behavior of the dice if you turn gravity off and press R.
Originally posted by Baryonyx:
Originally posted by Gracey Face:
[...] so that it lands on a specific face. [...]

But the point is that it doesn't. I just went into the game to check it again and even did it in locked physics mode. The die sometimes lands cleanly on a face, but by far not every time. If the result were precalculated, then why would it not land cleanly on a face every time?

It does land cleanly on a face every single time unless you interrupt it or do it on a non-flat surface. I am not sure what you are meaning when you say it doesn't. And if you know the height above ground, which is standard when you R, then you know how much spin you can impart from Face A to Face B.


Let's see if I can make this more clear, since I don't know why you're not understanding.

1) The game works by lifting the die off of the ground.
2) The die is then snapped to a specific facing.
3) A specific amount of rotational velocity is applied to the die.
4) The die then lands on the table face up.

If it was purely physically random there'd be no reason to do step 2. You could achieve randomisation by instead applying a random amount of rotational velocity (and also a random amount of air time would be good).

The only reason to do step 2 is so that you can apply a specific and known amount of rotation to get a specific result on step 4. If you know the dice is going to be in the air for 1 second, and you want it to display the side opposite the one that it has snapped to (for example) then you'd apply a ~180 degree per second amount of rotation to it (you'd actually need to apply more as the corners of the dice might hit the table first but you get the idea.)
Last edited by Gracey Face; May 14 @ 8:22am
Originally posted by Bone White:
Originally posted by Gracey Face:
It pops up in the air without any rotation then gets a new set of xyz rotational coordinates applied to it and then a rotational velocity also applied to it so that it lands on a specific face. If it was purely "physical" it wouldn't need this, the force used to pop it up from the table could also apply rotational force.

1) if the die was resting it is given some height above where it currently is (to allow for 2)
2) the die will be given a random rotation instantly
3) the die will be given a random (within limits) amount of vertical velocity and a random (within limits) amount of angular velocity (spin) around a random vector

Why did you copy and paste a reworded version of what I already typed? :D
Last edited by Gracey Face; May 14 @ 8:17am
Baryonyx May 14 @ 11:24am 
Originally posted by Gracey Face:
It does land cleanly on a face every single time unless you interrupt it or do it on a non-flat surface. I am not sure what you are meaning when you say it doesn't.

[...]

Let's see if I can make this more clear, since I don't know why you're not understanding.

1) The game works by lifting the die off of the ground.
2) The die is then snapped to a specific facing.
3) A specific amount of rotational velocity is applied to the die.
4) The die then lands on the table face up.

If it was purely physically random there'd be no reason to do step 2. You could achieve randomisation by instead applying a random amount of rotational velocity (and also a random amount of air time would be good).

[...]

We must be playing two different games then, because in my game, the dice don't land cleanly. Even on a standard flat table, without having messed with the physics.

Step 2 and 3 of your list are not really correct, because the amount is not "specific", but random.

I have just gone into the game, spawned a bunch of dice, lined them up neatly with gizmo and pressed R once. See these screenshots below of the results.
https://imgur.com/a/xtpoOVA

If the results were precalculated, why do the dice get messy and wander around?

And if you observe a bunch of dice in a line like this, you should observe that they in fact don't reach the same height every time. Because the height that they get thrown up is also random.

I will record a video if I must, because if you don't have the same observations, we don't play the same game.
I'm repeating myself at this point:

Originally posted by Bone White:
Chat doesn't print out the result unless scripting is involved, and at the point scripting is involved it could be affecting the dice roll. If you want to discuss scripted dice rolling then the process is completely dependent upon the scripting.
Originally posted by Baryonyx:
We must be playing two different games then, because in my game, the dice don't land cleanly. Even on a standard flat table, without having messed with the physics.

Describe what you are experiencing as I can't fathom how you could get ♥♥♥♥♥♥ dice on a flat surface.

Originally posted by Baryonyx:
If the results were precalculated, why do the dice get messy and wander around?

Ok. Say you had 4 dice. You set it up so that after popping up each one would go to 1 being the face up die, and you want them all to show 6 as the end result. Each die is going to have 1 second of air time. You will then need to impart ~180 degrees per second to each die. You rotate one die X+ at 180d/s, one X- 180d/s, one Y+ 180d/s, one Y- 180d/s. Each die will then, assuming they are actually physically simulated cubes and not point objects, move in 4 different directions because the dice doesn't immediately land perfectly flat. But you've still imparted enough rotation to guarantee they will land on the correct result on a flat surface.

Also they don't need to all go up the same height. All you need to do is have a table of desired results with specific lift heights, starting rotations, and rotational velocities. (You could also calculate it in real time but that would be pointless and costly.)



The only reason you would have the step 2 I mentioned earlier, where you have the die pop to a pre-set known starting position is so that you can then calculate how to get to a desired end position. The only other possibility is so that you can have minimal dice rotations to stop the dice from moving but as you have said yourself the dice move around, so this obviously isn't the intent. So either they did it for absolutely no reason, which is odd, or they did it so they could get to pre-generated results which is actually a reason and also allows you to have "better" RNG.
Last edited by Gracey Face; May 15 @ 8:38am
ulia  [developer] May 15 @ 9:41am 
Dice rolls are a combination of using a programatic random seed to snap to a rotation and additional random seeds to impart angular velocity which increases the entropy of the dice roll through physics. None of these interactions are pre-generated or animated - the random seed is created the moment you trigger the randomize function and is then applied to the randomization method as described above.
< >
Showing 1-14 of 14 comments
Per page: 1530 50