-
Notifications
You must be signed in to change notification settings - Fork 2
Description
the oneOf type table is very nice to create tables quickly. but often times you:
- dont want that list to be a normal distribution
- dont want to have to figure out a different distribution dice roll values
- 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:
-
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]or3d20kl1and that work is being tracked here: Add support for complex value generation rules Bernardo-MG/dice-notation-java#51 -
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
3d20kl1is easy to see the range is 1-20 but the logic starts to get a little more complex when its1d20-1d20+4that range is 4-23. and maybe we just wont support that type of logic.
open for discussion