Skip to content

add ability to apply distribution to a oneOf list #3

@danlangford

Description

@danlangford

the oneOf type table is very nice to create tables quickly. but often times you:

  1. dont want that list to be a normal distribution
  2. dont want to have to figure out a different distribution dice roll values
  3. if you do figure out all the dice roll values adding something to the list messes that all up

so there was an idea floated that we could have a oneOf style table with a roll property that describes the distribution. so if you wanted this list of items to have a bell curve type distribution the roll property could be 3d6. the code would need to determine the possible low value and the possible high value of a roll, make the roll, and map the return value to the list of items.

building on the above example if i happened to have 13 things in my list then it would be similar to the arduino map() function:

itemIdx = map(rollResult, 3, 18, 1, 13);

a couple of things though:

  1. our current dice parser does not yet support the kinds of expressions that would allow us to get more creative in our distribution shapes. for example if you want to express something like rarity you want the front of the list very common and the end of the list very rare. that is something like [lowest 1 of 3d20] or 3d20kl1 and that work is being tracked here: Add support for complex value generation rules Bernardo-MG/dice-notation-java#51

  2. i think we would need to determine the possible high and low of the roll. so we would either need to parse the expression or look to see if getting that data our of our current dice library is possible. something like 3d20kl1 is easy to see the range is 1-20 but the logic starts to get a little more complex when its 1d20-1d20+4 that range is 4-23. and maybe we just wont support that type of logic.

open for discussion

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions