Adventures in RNG

Creating a human-readable RNG seed generator has been an extremely interesting experience. It would be easy enough to just use a random 64-bit integer value for a whopping 264 (≈18.45 quintillion) possible seeds, but I just think there's something special and more imaginative about using language to represent seed values any time you intend to expose the seed system to players. However, coming up with something that even approaches that many meaningful arrangements of language components presents a bit of a challenge.

What should a readable seed look like?

Anyone who has played the .hack// games probably remembers that in order to gain access to field zones, you would need to provide a series of keywords that would set properties of that zone. A Greek alphabet character denotes the server, and three language components make up the actual seed for the zone. Each component exerts some level of influence over things such as environment, geography, monster and item spawns, and more.

.hack//Infection warp menu showing the three components of a zone phrase.
.hack//Infection warp menu showing the three components of a zone phrase.
(Image credit: @squee913)

So what is Δ Hideous Someone's Giant in this context? It's acting like a human-readable RNG seed! Regardless of whether the developers of those games ultimately used the strings for that purpose, it is absolutely a valid method we can leverage to represent a seed in a way that's significantly more semantically appealing than a long string of numbers. Our game engine will still need an integer to set the seed for the game session, but we can generate that by hashing the human-readable seed string we decide upon to its corresponding integer value .

Working from the .hack// keyword system as inspiration, I decided to expand on the idea for my own seed system. I settled on generating seeds that fit a specific grammatical format with four language components and one symbol component.

[Tetragram] Past Participle-Adjective-Adjective-Noun

In practice, this format generates seeds like these examples:

[𝍃] Forsaken-Radiant-Outstanding-Action
[𝌶] Acclaimed-Imaginative-Serendipitous-Euphoria
[𝍏] Scorched-Curious-Peerless-Nemesis

Why this format?

The tetragrams are a set of 81 Tai Xuan Jing symbols that exist in the Unicode text standard which each carry a particular meaning or interpretation. I'd considered using non-English alphabet characters the same way that .hack// has done, but the Tai Xuan Jing symbols also presented a unique opportunity to tie in to aspects of mythology that I'm drawing on for game themes. And what's more, the large number of these symbols carries a multiplicative impact on the rest of the possible seed component pairings.

As for the reasoning behind the particular grammar restrictions of the seed's language components, my primary goal is to ensure that each seed string contains strong and unambiguous language that always maintains a uniform cadence in speech. Basically, it's about facilitating combinations of words that are pleasing to the ear and evocative to the imagination.

When it comes to the specific types of words I'm including in the word bank, I do have to spend some time evaluating each one I want to include. English has a lot of scenarios where the spelling of a word's various grammatical forms can have some overlap with each other which causes an individual to need to rely on context or vocal inflection to intuit which grammatical form is actually being used. If I add a particular word that could be interpreted grammatically in a different form than the category I've included it in, I either rework the word to an unambiguous form or drop it from inclusion if that proves to be impossible.

This focus on unambiguous language also includes making sure that I don't accidentally include variations of a root word in more than one category when such a thing is possible. For my purposes, it wouldn't be acceptable to end up with a seed that reads something like Forsaken-Peerless-Radiant-Radiance. The result of this work should ideally be memorable seed names that serve to enhance the feeling of the game's setting, but unobtrusive in that they don't trip up the player or cause them to gloss over when they see it.

At this point in the project my selection of word components comes out to 102 past participles, 548 adjectives, and 219 nouns. Both adjective components select from the same pool, but the second adjective is not allowed to duplicate the first which removes one possibility on the second go-around. Combine all the possibilities together, and a bank of just 950 components produces ≈542.4 billion possible seeds.

It's not even close to being in the same ballpark as that 64-bit integer limit we discussed originally, but I'm also a long way away from exhausting strong words that might be a fit for my seed generator. I'm definitely not trying to get all the way to 18 quintillion possible combinations, but I am interested to see just how far this seed format will take me once I finish adding all the words that I'd like to use.

#gamedev #indiedev #rng

Image delcake
The number of video games is too dang high.
Federated: @[email protected]

⬆️ Return to the top