Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: initial genesys dice #1

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

arranf
Copy link

@arranf arranf commented Sep 11, 2022

This PR includes the blend file for a tweaked version of the Quest Portal initial dice.

It also includes a set of Babylon exports and a draft config file that can be used to roll Genesys dice using the current 1.0.5 dice-box repo.

As 1.0.5 does not support non "d" naming for dice so the dice all prefixed with d.

As you can see by the diff these exports are huge due to the strange geometry of the provided files. I intend to provide a better set of Gensys dice but I wanted to get this up quickly so 1) you wouldn't feel the need to do this for me (or others) 2) we can concretely work towards a better system for non-numeric dice.

This commit includes the blend file for a tweaked version of the Quest Portal initial dice. It also includes a set of Babylon exports and a draft config file that can be used to roll Genesys dice using the current 1.0.5 dice-box repo. 1.0.5 does not support non d naming hence the dice all prefixed with d. This commit does not include die face mapping.
This commit includes a dice face mapping using magic numbers for the included Genesys dice
@arranf
Copy link
Author

arranf commented Sep 12, 2022

@frankieali I think this is now ready for an initial review.

I've added a new set of more performant Genesys dice models.

@frankieali
Copy link
Contributor

I'll take a look as soon as I can. A quick look at the genesys.json file looks good. I have to ask if you created the models yourself, and if not, then are they models that can be freely redistributed by a third party? Models taken/purchased from online market places are usually "Royalty Free License" for personal use or single project use, but this project, I believe, would fall under "redistribution".

@arranf
Copy link
Author

arranf commented Sep 13, 2022

I had someone make them for me from scratch. They're good for redistribution 👍

@frankieali
Copy link
Contributor

I've also been working on a set of dice, but I'll take your PR over mine if it looks good. I had to make some minor changes to @3d-dice/dice-box in order to get through the dice parser validations. I think we both had a similar idea here. Did you have a PR for that as well? I'm sure we'll get something that works soon.
Screen Shot 2022-09-13 at 9 34 49 AM

@arranf
Copy link
Author

arranf commented Sep 13, 2022

I've also been working on a set of dice, but I'll take your PR over mine if it looks good. I had to make some minor changes to @3d-dice/dice-box in order to get through the dice parser validations. I think we both had a similar idea here. Did you have a PR for that as well? I'm sure we'll get something that works soon. Screen Shot 2022-09-13 at 9 34 49 AM

Are those the ones based on Quest Portal? I struggled to get good performance from a couple of those dice.

I haven't tweaked the dice parser yet - you'll see here I just prefixed the dice with d to make it work. Happy to iterate further here to make it work with all the modules, I just needed to get something working ASAP.

@frankieali
Copy link
Contributor

Your dice set looks good. I've adjusted the parser in @3d-dice/dice-box to take into account any dice listed under "diceAvailable" in the theme.config.json file. I may move the .blend file somewhere else in the project.

@arranf
Copy link
Author

arranf commented Sep 19, 2022 via email

@frankieali
Copy link
Contributor

frankieali commented Sep 19, 2022

I'm curious how the values add up for the symbols in Genesys. I see on your values map it can range from -7 to 7 in value. In the proof of concept I was working on, I just added up the symbol counts.

Edit: I should describe this in more detail. So, for the collider face map, I just return the face numbers. If the faces have been triangulated, like on a d12, then triangles on the same face should return the same number.

"colliderFaceMap": {
    "dability": {
        "0": 0,
        "1": 1,
        "2": 2,
        "3": 3,
        "4": 4,
        "5": 5,
        "6": 6,
        "7": 7
    },
}

Then, when displaying the actual results after the roll is complete, I map the number values to the symbol values like so:

"symbolMap": {
  "dability": {
      "0": ["s"],
      "1": ["s","s"],
      "2": [],
      "3": ["a"],
      "4": ["a","a"],
      "5": ["a"],
      "6": ["s"],
      "7": ["s","a"]
  },
}

Here, the letters represent the symbols found on the die faces. "a" = "advantage", "s" = "success"

So, if "2dability" results in a 1 and a 7 then the final result is "3s, 1a".

Why map the values twice? Well, the internals of the Dice Box wants to add together the totals for you before posting the results and it still expects numbers for that. This gets around triggering an error there. Perhaps in the future I can adjust that.

@frankieali frankieali self-requested a review September 20, 2022 13:35
@frankieali frankieali self-assigned this Sep 20, 2022
@frankieali frankieali added the enhancement New feature or request label Sep 20, 2022
@frankieali
Copy link
Contributor

I've made updates to Dice Box to allow for die names without the "d" prefix. In fact, the "d" prefix should only be used with numbered dice. Could you update the names here?

@arranf
Copy link
Author

arranf commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants