Skip to main content

· 3 min read
Frank Ali

Big announcement. Version 1.0 has been released! The "last few things" took longer than expected. I really wanted to rework how themes were handled internally so different dice models could be used. I dug into supporting "levels of detail", "HD textures", "mobile textures" and many other things involved with over-engineering an idea. I'm happy with what I settled on which accomplishes the original goal of supporting different dice models.

Now, @3d-dice/dice-box only ships with the 'default' dice theme. All other themes I've develop have been moved into their own project at @3d-dice/dice-themes. This way, users can grab the themes they want and simply drop them into their themes folder. I even made a few custom color themes that really utilize the alpha channel in the diffuse texture. I was able to crete both color configurable textures that had a gritty overlay with the numbers. Check out the Rust and Rock themes if you're interested.

One of the hangups in my "last few things" was discovering that the dice models I had purchased from Sketchfab and CG Trader had royalty free licenses, but redistribution was not allowed. Finding good license free game dice was a problem. Thankfully, I had been collaborating with the dev team at Quest Portal. They recently implemented dice-box into their virtual table top platform. This was a great experience and helped to really test the project's overall viability and production readiness. More on that in another post. Anyway, the team at Quest Portal was kind enough to help me out with procuring some license free game dice models. They are now the 'default' set. The default set will soon have a couple of bonus dice, including a d2 a fate die and a d6 with pips. However, while I was waiting on those dice to be produced, I decided to learn how to make my own dice set as well. I really wanted to show off the ability to use wildly different dice models in the project.

Dice models in Blender

I learned soo much about Blender. Thank goodness for YouTube. While it was a struggle, I was finally able to create two sets of 3D dice models. One is the "smooth" set and the other is the "gemstone" set. Carving the numbers out of the faces and then generating proper normal maps was a real struggle. After that the struggle continued as I attempted to create smooth low-poly assets, but I finally made it across the finish line. What we have now are two CC0 dice model assets.

Gemstone models in Blender

Some other great features in 1.0

  • New config option for illumination level
  • New config option for shadow transparency
  • A truly random auto-generated fallback for non-standard/unsupported dice such as d5
  • New config option to suspend the 3D animation and just get the random numbers (using the new random auto-generated fallback)
  • Support for fate dice
  • Improved error catching and error messages
  • Multiple other bug fixes

In order to avoid a wall of text, I'm going to wrap up here. There are many other new features that came with version 1.0. BabylonJS finally did hit version 5.0. Yay! So this release will benefit from all the performance improvements in Babylon as well. I hope other devs find this project useful and that I'm able to continue to developing useful features.

· 3 min read
Frank Ali

This is kind of like my own feature request post. There are a bunch of things that I still want to accomplish with this "side project" of mine. I'm going to leave some of those ideas here for future me.

  1. I just discovered This is a new physics engine built using Rust (and also documented using Docusaurus which this site uses as well). This looks like an amazing physics engine and something I certainly want to try. AmmoJS has been great, but development on the Bullet physics engine has slowed down and I think Rapier will be a quality successor. Check out this comparison on YouTube. Right now, the only bottleneck I get during playback is from the Bullet physics simulation at around 400 dice which still isn't bad.

  2. I would love to implement the sounds of dice rolling. I've been looking at other projects such as Dice So Nice and BabylonJS's own physics imposter implementation to see how I could implement the onCollideEvent to trigger sounds. Then there might even be different sound packages similar to Dice So Nice

  3. Special Effects. The great thing about having a 3D engine and digital dice is that the sky is the limit when it comes to effects. I would love to see exploding dice actually explode. I would like to see some sort of effect when critical roles are triggered. I'd also like to try to implement animated materials, such as water, or even animated dice, like clockwork steampunk dice with moving gears. Take a look at the Pride dice set from D&D Beyond. They get the idea.

  4. An easy one to do would be to implement some simple post-processing in BabylonJS, such as motion blur, anti-aliasing, or other fun effects

  5. On the "very near future" list is creating the Genesys Dice set. The new theme system in version 1.0 allows for rolling and identifying dice beyond their number type. So creating the Genesys set should be a good test for the theme system's flexibility. It will probably involve creating a new parser that I'm hoping to do as a true "plug-in". Soon to be followed by Legend of the Five Rings which I also enjoy playing.

  6. Also on the "very near future" list is an "additional dice" theme. I've got a set in the works that includes d2, d14, d16, d18, d20, d24, and d30. The modeling is almost complete. I still have to UV map everything which will be tricky. I really need to write a tutorial on how I make my themes from scratch.

  7. I'd like to make a few more UI modules as well, such as:

    • last "x" rolls - records the last few notations
    • theme picker - an easy interface for switching up themes and theme color
    • quick dice picker - similar to the dice table on Roll20
    • die roll distribution - roll results are saved to the browsers IndexedDB and processed to produce distribution graphs
    • favorite rolls - save a few frequently used notations
    • notation builder - a simple touch based ui to build complex notation

Well, that's it for now. Wish me luck.

· One min read
Frank Ali

It's been almost 2 years since I started digging into what it would take to build a fantastic dice roller that anyone could use in their own JavaScript projects. I've spend many hours optimizing this project so it would be both flexible and performant. I'm hopeful that it will gain traction and live up to expectations.

I have some more exciting features in que before hitting the version 1.0 switch. I'm also waiting on BabylonJS to hit version 5 this Spring.

This site will continue to be updated along the way.