Ruby Dungeons and Dragons

James Wu
3 min readJul 27, 2020
credit to https://dnd.wizards.com/dungeons-and-dragons/what-dd/history/history-forty-years-adventure

Intro:

Dungeons and Dragons (D&D) was first published in 1974. This game has provided countless hours of fun in the minds of the players for years. Back in the darker ages, countless nerds, like myself, were beaten across playgrounds in the US for daring to imagine dragons. Bravely (or cowardly), the nerds took these punches to the body and attacks to the soul in exchange for a haven in the mind. On one hand, these books highlighted the need for bullies to come to beat the heck out of us. On the other hand, these books were a door to another playground and for some, a haven away from “real” life and the voices inside our head.

Meme

Over the years, the proliferation of D&D players brought the game to a relatively more mainstream audience. The mechanics of the game approached a tabletop space with a smaller barrier to entry for the lesser nerds. A level 45 Dungeon Master (DM) was no longer needed to play the game. We no longer had to go to Forbidden planet’s hidden mezzanine to ask Cameron to start a game based on the 2.0 system. All we needed was a higher nerd, like Ben, to get the ball rolling with the 3.0 system.

Level 45 Dungeon Master in Action!

Mechanics of D&D with Ruby and ActiveRecord:

There is no way for me to recreate the entire game without the books and with my current rudimentary understanding of Ruby. I can certainly take steps to recreate this game that once gave me so much pleasure. ActiveRecord will be used as my database to store my dungeon and monsters. My players will log on and explore a simple dungeon world.

A fantasy location is needed for our players to explore. A dungeon will have many rooms for our players to explore or lose themselves in. The dungeon should have many monsters for our players to interact with (or slay). A dungeon has many monsters through a room. Using the concept of Object Orientation, I can assign monsters and rooms to a dungeon.

Besides having monsters and rooms, dungeons’ will need to have a name, pressure, description, a general location, and an extra variable I am going to call wet for now which may or may not come into play when I build my Dungeon class out. I will correlate pressure to the number of monsters in the Dungeon. The location, des, and wet variables may come in as more relevant later.

That’s all I have for now. Cheers to my audience for sticking with me.

A special shout out to my classmates. I will be using the rest of my 5 mins to passionately about why version 3.0 is better than 4.0 and why Vin Diesel would make a horrible DM.

credit to https://www.comingsoon.net/extras/news/624089-watch-vin-diesel-play-dungeons-dragons

Much Love,

James Wu

--

--

James Wu

Full Stack Developer | Software Engineer | React | React Native | Expo | Ruby on Rails | AWS S3