Non-Player Character Generator

  • React
  • UI/UX
  • Netlify
  • APIs

A React application that uses the D&D 5e API to generate an NPC (non-player character) for Dungeons & Dragons 5th Edition.

Roll 4d6

The Origin

I built this for two reasons: The only framework I had experience with at the time was Angular so I wanted to explore other Javascript frameworks and because my buddy was constantly running into a situation where he needed a character generated on the fly.

The best way to see what this project is all about is to check out Roll4d6 live and to read through the code on Github. But if you want to see some highlights and my reflections on the building process feel free to continue below.

The Project

The Highlights

Users can choose how random the character should be plus generate a randomized plot hook to play with.

The app uses D&D 5e API to gather info. Most attributes have a uniform distribution other than the height, weight, and age which have a standard distribution.

The character biography is basically a MadLib. A series of random number generations are plugged into a skeleton paragraph to give us a unique biography.

The NPC’s stats start on a positively skewed standard distribution and will stay that way unless the user selects “distribute points intelligently”, in which case, it will apply points based on the class.

According to Google's PageSpeed Insights it's pretty speedy.

Closing Thoughts

I really enjoyed using React to bring a project to life. Coming from an Angular background, React felt much more customizable and let build the application in a way that I felt fit best for the project.

I've now used Github Pages and Netlify to push a product to production and I found Netlify's dashboard and plugins made launching a product and then iterating on it a breeze. Going forward, I'll likely use Netlify for anything I build that is supported.

There are still a few things I'd like to enhance the product with like: adding more pictures for each possible NPC combination (216 in total), allowing the user to print/save their NPC, and creating a database of NPCs that can be referenced later. I hope to get to those one day. If not, I hope that someone forks my branch and takes up the mantle. If not that, I just hope people have fun with Roll4d6.

Get In Touch

I'm not actively looking for new oppourtunities but I'm not a hermit. Reach out with questions, comments, or even just to say hey.

Say What's Up