There are a number of sticking points that can keep new players away from complex tabletop games such as *Dungeons & Dragons*. Some people are intimidated by the math involved, and of course others just can’t find enough friends who are willing to sit down and play D&D with them in 2019. While this gadget created by [Caleb Everett] won’t help you get more open minded friends, it will take some of the mental gymnastics out of adding up dice rolls.

In its current form the device saves you from the hassle of not only having to roll various combinations of physical dice, but adding up all the faces after the fact as well. In the future [Caleb] plans on adding more advanced software features which will allow for tricks not possible with real dice, such as increasing the likelihood of rolling numbers which haven’t been seen in awhile. Now that the hardware is put together, he’s free to dig into the software side of things and really get creative.

Inside the 3D printed case of his calculator there’s a Adafruit Feather M0 Express, a 128 x 32 OLED display, and a 2200 mAh lithium ion battery that lets him go mobile. The keys, which are Cherry MX clones, are wired directly to the digital pins of the Feather board as [Caleb] found that easier to wrap his head around than doing a matrix. This ended up working out as he had enough pins, but does stifle future expansion a bit.

Even if you aren’t into the sort of tabletop gaming which would benefit from an automatic dice roller and tabulator, we think [Caleb] has come up with a very neat form factor for similar pocket sized gadgets. It reminds us of the Handlink from *Quantum Leap;* before the prop department swapped it out for a jumble of gummy bears later on in the series, anyway. Since he’s shared the link to the OnShape project, you can even tweak the design a bit without having to suffer through modifying the STLs.

Many of the electronic dice we’ve seen in the past have tried to emulate the size and appearance of traditional dice, so it’s interesting to see this approach which goes in the opposite direction entirely. Critics might say that at some point you’d be better off just using a software application for your smartphone, but we’re not in the business of complaining when people produce interesting pieces of hardware.

this is rust on hardware, one of the first ones as far as a complete project, with documentation/code. good work caleb.

I’m still wrapping my head around rust embedded. I got really lucky, the feather_m0 crate has an example using the ssd1306 crate. Without that example I couldn’t finish this project. I need to figure out how to read values from the real time clock but I can’t make heads or tails of the feather_m0 crate’s docs.

So I’m no Rust expert (I’m not sure I’ve ever seen actual Rust source before this, actually), but doesn’t the command “seed_from_u64(0)” mean you are seeding the RNG with a 0 every time the device is powered on? You need to seed the RNG with something dynamic to prevent repeat rolls.

I was lucky that the feather_m0 crate had example code for the ssd1306 display, I couldn’t have finished this without it. I still can’t make heads or tails of the docs to read the timers or real time counter to set the rand seed.

https://github.com/atsamd-rs/atsamd/blob/ae518a8c0e778440750679e21746cf6e47195222/boards/itsybitsy_m0/examples/spi_ssd1306.rs

This is awesome, I wrote the first version of that example as practice doing embedded Rust. It is super cool to see it being useful in an actual project!

I think HaD needs to start a Rust tag for projects. :)

“increasing the likelihood of rolling numbers which haven’t been seen in awhile”

Why would anyone want that? We use dice because they’re a good source of randomness.

Welcome to the difference between mathematical randomness and human perception of randomness. Because humans are rather greedy pattern-spotters, the chance that a true random sequence “follows a pattern” and therefore “doesn’t feel random” is actually fairly high. There are various tricks that can make a sequence of random numbers still have fairly high randomness while feeling more random to flawed human observers over small sample sizes.

Or the user is a gm / dm and just doesn’t want their NPCs to have any chance of critting the PCs several times in a row and perpetrating a total party kill :-)

If I was in a game, and found that the DM was using crooked dice, I would cry “foul!”

I really like the design, though.

Maybe have that behavior selectable, and only turn it on when every player agrees.

Those “tricks” amount to “making it not random.” Seriously, this is cheating, and I would not play a game with anyone who even thought it might be a good idea.

Making it slightly less random (small % less entropy) doesn’t make it nonrandom (predictable / low entropy). Nor does there need to be any change in long-term distribution of results (skew or reduced “fairness”).

Imagine a system where if I roll the same number twice in a row, I roll a spare die and if that spare die is even, I reroll the duplicate and accept the result. We can expect that getting the same number twice in a row is just over half as likely as a fair die – on every roll, there is a bias against the previous number. However the remaining probability is distributed evenly and so there is clearly no long-term preference against a particular number – the distribution of results is slightly different from roll to roll, but any given skew has no long-term persistence so over a large number of rolls no number is favoured. Randomness is reduced because some sequences are less likely, but the result can’t really be called “not random” and the reduction in randomness is fairly small.

In fact that system is pretty crude and a lot of refinements are possible – you can never have quite as high an entropy as a single fair die for the same range of output, but you can tweak in any number of ways to emphasise different factors you favour. Structured semi-randomness is a really handy tool for a games designer (think of how many games have draw-and-discard-card mechanisms) but not all games designers do their homework equally well and a lot of techniques that could be used to tame chance are a bit fiddly for pencil and paper play.

Have you ever played Settlers of Catan and seen a 4 come up twice as much as a 6? This mode would try to even it out. I’m not sure that it’s a good idea, but I want to try it.

A later die roll is independent from all die rolls before it. It’s always 1/6 on a 1d6

The probability curve only becomes “bell like” with totaling a Nd6 where N is 2 or more, which is because some totals can result from different individual dice results.

IE on 2d6 a 12 can only result from 6+6, but a 7 can result from 4+3, 3+4, 2+5, 5+2 etc, so has a higher chance in aggregate.

This matters when it comes down to the details. an 18 on 3d6 has different odds than three 6’s on three 1d6’s, 0.5% and 16.6% respectively.

Something to keep in mind before adding in fake-skew and bias to any results

Are you saying you think if you roll 1d6 sequentially your odds of rolling 3 6’s in a row are 16.6%? Try it.

Also catan is 2d6. And it’s not “bell like” at all.

No, I said rolling a 6 on a d6 always has 1/6th or 16.6% chance.

Roll one 6 times in a row, you should get a 6 in there showing the 1/6th chance. Now do it again 6 times and you should get a second 6, and so on. That isn’t sequential, it’s each roll has no bearing on the last.

OP said you’ll see one number come up more often on a single (one) die roll than others, but it’s really the same chances each.

For sequential, or 3d6, your odds of 3x sixes in a row I said was 0.5% (rounded)

With 2d6 (or any Nd6 where N isn’t 1), you have a 1/11th chance to roll a specific exact set of values, but it becomes a bell curve for rolling a total.

For example rolling first a 2 and second a 5 is the same odds as any other set of outcomes.

But rolling a 7 has the highest odds compared to rolling say a 2 or a 4.

That’s because only one set (1 and 1) results in a 2, aka 1/11th

But a 7 comes from 6 different sets, or 6/11ths (1+6,2+5,3+4,4+3,5+2, and 6+1)

Go to anydice.com and set it to 2d6 or 3d6, you’ll see the bell curve clearly for total/sequential rolls. In fact for 2d6 it backs up both my 2 and 7 examples above as the least and most likely respectively, although I didn’t intentionally pick 7 for that purpose.

If 4 comes up twice as often as 6 (rolling a single die), then there are two possibilities: 1) the dice roll on that game is rigged, and 2) that’s just how random numbers work, sometimes.

The fact (if true) that someone else rigs their dice is no excuse for you to do the same.

He’s talking about 4 coming up more as the sum on 2 dice than 6 as the sum on 2 dice. He’s talking about a specific game where this sort of thing “seems” to be the norm. and as someone who has played Setters of Catan extensively, this phenomenon is real. Consider it an inside joke you have to be familiar with the game to understand.

With 2d6, there are 3 ways to come up with four: 1+3, 2+2, 3+1. There are 5 ways to come up with 6: 1+5, 2+4, 3+3, 4+2, and 5+1. Again, if you’re getting 4s more often than 6s in the long term, the game is rigged.

The only problem with that idea is that in a typical game, your sample set is quite small (i.e. there are a fairly limited number of rolls made). You may see that effect in the course of a single game, but if you played 1000 games on the same dice, it would probably even out.