Showing posts with label indexing information. Show all posts
Showing posts with label indexing information. Show all posts

Tuesday, 15 May 2012

Simulating a dX

I've been thinking for a few months about how to best simulate rolling a dX, which is the same as indexing X entries randomly. It takes time to sort ideas and thoughts out; this is a starting point for collecting things together.

There are six standard polyhedral dice: d4, d6, d8, d10, d12 and d20. When using these we assume that the dice are fair - each side is equally likely to come up. If we were to create or simulate a die with X sides it would be best if it were fair. We cannot simulate a d11 using 2d6 directly - we get a range of 11 possible values, but there are different probabilities for each value. The simulated die would not be fair.

We can simulate a few dice with the six standard polyhedral dice through either re-rolling on the high value, or by "halving the die". It is not too difficult to introduce simple notation to account for both of these actions.

d6/2 gives a d3. We let d6r stand for the situation where we reroll the 6. We only want values 1-5 so d6r results in a fair d5. However, d10/2 also gives d5, and without the reroll. From the standard polyhedral dice we can simulate the following dice easily:

d2 = d4/2, d6/3, etc.
d3 = d6/2, d12/4.
d5 = d10/2, d20/4.
d7 = d8r.
d9 = d10r.
d11 = d12r.
d19 = d20r.


We could also simulate a fair d9 by rolling two d3s; these act as indexing nine entries in a table. We could denote this with d3 x d3 or (d3)^2.

d3 x d3 1 2 3
1 1 2 3
2 4 5 6
3 7 8 9

These various actions - re-rolling, halving and dividing across tables - allow us to build up a greater number of simulated fair dice. I'll go into more detail in future posts, and see if I can start to make sense about how we might simulate a dX for any positive integer X.

Friday, 23 March 2012

Getting Dice All Random

In my first post I mentioned that I had started to get interested in the maths of RPGs from the probabilities in Apocalypse World. There was something else that started me thinking, which is when one of the regulars in the gaming group I play with asked a question on his tabletop role-playing game blog, False Machine.

P was looking at randomly generating an island from a series of entries in a table. He had come up with a means to do that, but only on a computer, which meant while the island was randomly generated the setting would be determined ahead of his session. To him, the problem was, as he put it at the end of the post:
I need a dice method that can randomise 343 hexes
I've always had a strange little fascination with powers of numbers, so this jumped out at me as soon as I saw it. 343 is 7*7*7, which means that you could have seven tables, with seven rows and seven columns; you could then get any entry out of the 343 in your master list by rolling three d8s and re-rolling any 8s.

Problem solved! Until P realised later that there were actually 330 entries in the table for Isle of the Unknown. But this wasn't a problem either, if we imagined the entries arranged in ten tables, each with three columns and 11 rows. Roll a d10 for the table, a d3 (or d6/2 if you must be formal) and a d12 with re-rolls on the 12s. Again, problem solved!

Which got me thinking...

GMs who like to make things up through random tables could possibly have a large number of random encounters or random elements that they would like in tables. 330 or even 343 entries could be quite small. Is there, in general, a sensible schema that we can use for producing sets of random tables for game data, that we can index with dice? Let's assume d4, d6, d8, d10, d12 and d20s are available.

To put some bounds on this, let's assume, for now (although it may be easily extendable, who knows) that we want to consider for sets of random tables with up to 400 elements in total. I'm going to have a think about this and let you know what I think over the next week or so, as well as share a small random table of my own for In A Wicked Age.