Randomness Introduced

Creating games with many different kinds of heroes is at the heart of my vision for this game, and it began early. The first thing I gave custom randomness to was the hero.

Below is a gameplay video from Stories from Danger’s Den in October 2020, one month into development. The game is in color now. The hero’s appearance is randomly selected from a set of eight possible sprites: four male and four female. He has a gender-appropriate randomly generated name.

These changes may look simple, but there’s a lot going on behind them.

I knew I’d want to let players load stories from IDs eventually, so I built the game to generate randomness from a seed, courtesy of David Bau’s seedrandom library.

The hero’s name was randomly generated using a random selection pool loaded from a file. The file contains lists of text snippets that reference each other. A name is built from a name root followed by a gender-appropriate suffix, the name root is built from one or syllables, and the syllables are built from vowels and consonants. I knew I’d want a recursive text-building tool to name people, towns, dungeons, and special items, and even to give people things to say. So I made sure to build it flexible. I’ve since rewritten these generator template files in JSON to open them up for even more flexibility.

Leave a comment