How realistic would physics be on a modern high end dice simulation?
October 14, 2019 3:52 PM   Subscribe

Let's say that you had professional developers create a simulation of two six sided die impacting a specific material and being thrown in specific ways by an industrial robotic arm. How realistic could you make this given high end modern physics simulation software?

This came up from a conversation with some friends regarding whether or not shot style matters at all in Craps, and then about running a GAN to train a robotic arm to throw precise dice combinations. I read up a bit, and it seems like most training for robotic arms happens by creating a simulation of the arm in the environment first, and then passing the behavior data over to a real robot after you've perfected it. Assuming you get everything else to run smoothly (a big assumption) how difficult would the physics simulation part of the pipeline be?
posted by codacorolla to Technology (14 answers total) 3 users marked this as a favorite
 
I don't know for sure, but I'd imagine that to the extent that you have:
1) resources to throw at modelling it realistically
2) an accurate and complete understanding of the physics involved

You could get very realistic indeed.

But 2 is not a given, I don't think. Maybe people have done studies on how humidity, temperature affect the friction of the various materials the throwing surface is made of, but are there enough such studies with large enough sample size for you to be confident? Similarly with throwing style, consider not just the way in which the die is released from the arm, but also the potential for the movement of the arm to affect the flow of air. What about minute variance in effect of gravity due to the relative positions of the moon, planets etc. or altitude. There are all sorts of infinitesimal factors a model could account for if you know them with a degree of confidence, but you do need to know them.
posted by juv3nal at 4:52 PM on October 14, 2019 [1 favorite]


There are all sorts of infinitesimal factors a model could account for if you know them

Yup. But you don’t. And certainly not with enough accuracy. A thrown die with given initial velocity and rotation is a textbook example of a chaotic system, where tiny changes in initial conditions often lead to large changes in outcome, and computational prediction is notoriously difficult, no matter how good your conventional computer may be.
posted by SaltySalticid at 5:17 PM on October 14, 2019 [6 favorites]


On the other hand: it’s fairly easy to use computers to faithfully model the outcome of a handful of tossed dice. The hard problem in your question is the physics, not the probabilities and modeling throws.
posted by SaltySalticid at 5:21 PM on October 14, 2019 [2 favorites]


Some smart people have studied this. Here's a PDF. From the conclusion:
To summarize, the die throw is neither random nor chaotic. From the point of view of dynamical system theory, the result of the die throw is predictable. Practically, the predict-ability can be realized only when the die is thrown by a special device which allows to set very precisely the initial conditions. We show that the probability, that the die lands on the face which is the lowest, is larger than on any other face, i.e., the dice are not fair by the dynamics. It is not enough for a die which is fair by symmetry to be fair by dynamics. By mechanical experiments or simulations, one cannot construct the die which is fair by continuity. If an experienced player can reproduce the initial conditions with small finite uncertainty, there is a good chance that the desired final state will be obtained.
As the Mythbusters would say, PLAUSIBLE.
posted by RobotVoodooPower at 5:24 PM on October 14, 2019 [12 favorites]


I have some research-level experience of robotics, motion capture and physics simulation.

My gut feeling is that if you had:

- A precision machined die of very well characterised material
- A similarly precision machined, known environment to throw the die into
- A typical industrial robot arm to throw the die
- A custom motion capture system to precisely measure die position/rotation at high spatial/temporal resolution

...then, after running many thousands of test throws, and refining/tuning your simulations to match your observations, you would be able to predict the result of any individual throw very accurately once it had been let go and tracked for the first few centimetres.

I don't think you would be able to predict the result before commanding the arm to make the throw, just because the mechanisms in robot arms that can move at dice-throwing speeds are just not that repeatable.
posted by automatronic at 6:01 PM on October 14, 2019 [6 favorites]


I would imagine a robotic arm, like on a CNC machine could reproduce a dice throw nearly every time.

If you are capable of making the same movement to the 0.001", you can also arrange the dice perfectly and throw them the same way every time.
posted by sanka at 6:04 PM on October 14, 2019


An industrial robot arm, with a manipulator on the end of a jointed chain of arm segments, is a very different proposition in terms of repeatability compared to even a basic CNC machining setup.

If the "robot arm" is allowed to be a high end machining centre then you'd have the rigidity and repeatability to make this much more predictable.

But you'd need a 5-axis machine with some pretty high feed rates to throw the kinds of trajectories a human would.
posted by automatronic at 6:18 PM on October 14, 2019 [1 favorite]


And I'm just thinking, you might need measurement equipment like this. Or you do lots of experiments and analysis.
posted by RobotVoodooPower at 7:39 PM on October 14, 2019


I think you could probably make a robot arm that was precise enough and fast enough to repeatable roll dice. However, rather than developing an existing but currently-incapable technology to a high polish--which is definitely going to leave a mark on the budget--I'd look into the ancient art of loading dice and switching them in and out of the game.

Also, I'm reminded of the Fritz Leiber story Gonna Roll the Bones where we learn that Death has a ... unique style of throwing dice that would probably be a lot easier to model.
posted by Gilgamesh's Chauffeur at 8:47 PM on October 14, 2019 [1 favorite]


The paper RobotVoodooPower points to says "Our numerical simulations are in good agreement with the experimental observations using high-speed camera."
posted by at at 10:49 PM on October 14, 2019


I'm not an expert on the software but I recently began supervising VFX artists who are creating simulations of dust, water, etc. The thing I push is that implying small variation in materials is a big part of what makes a simulation look believable. I’m just saying that you could account for a lot of things but would still be left with some random factors that would come more and more into play as the throw got longer.

Most obvious I guess is that Injection moulded plastics can’t ever be perfectly homogenous in density or elasticity. If a human has ever picked up the dice, how will an uneven distribution of oil on the surface affect the friction? Can a green baize (a worsted wool) throwing surface ever be made uniform enough to catch the corner of a die exactly the same, and how is it changed by subsequent throws? ...after a thousand throws, it won’t be the same surface.
posted by bonobothegreat at 3:51 AM on October 15, 2019 [1 favorite]


An important consideration is how fast you want the simulation to be. If it must run in real time, then the maximum possible fidelity is lower than what you could achieve if you let the machine run for, say, 1 day for each roll.

Also, as noted above, capturing the precise initial condition is probably the most sensitive step in the chain. So the method by which the input is fed into the simulation matters quite a bit, but is technically not part of the simulation.
posted by dbx at 4:59 AM on October 15, 2019


In theory this is very simple. Just start with a perfectly spherical cow die.

Unfortunately, in practice you'll probably run into the problems that bonobothegreat describes so well. Inconsistencies in the materials won't let you model the behavior accurately enough.

On the other hand, I can report from personal experience that it's possible to flip a quarter to heads pretty regularly, even with a fast spin rate and a flip height of several feet. I can't get heads 100% of the time, but I can probably get it close to 75% of the time. But the motion and materials of flipping a coin are much different from throwing dice.
posted by Winnie the Proust at 6:07 AM on October 15, 2019


So, you probably already know this, but “robot can precisely throw dice to achieve desired result” is a plot point in the Star Trek: TNG episode “The Royale”, when Data does just that.
posted by Huffy Puffy at 6:17 AM on October 15, 2019


« Older Should I complain and how? And how to avoid--bad...   |   Pittsburgh reduce Newer »
This thread is closed to new comments.