Word rng (open source)

word rng open source.rbxl (1.6 MB)

I’m open sourcing the code as the original point of the game was suppose to be educational, so why not show how it works? May be some bad practices, not sure though, made most of the script logic in a week.

Now, the explanation part. How does the game have over 1 million definitions?

The first item you need is a big list of all the english words.
Oh look! How conveniently someone made a list of most if not all the words in english. GitHub - dwyl/english-words: 📝 A text file containing 479k English words for all your dictionary/word-based projects e.g: auto-completion / autosuggestion

Nice! Secondly, we need a way to find all the definitions of these words. Since there are over 479k words in our word list, we need to automate this, it’s not feasible to do manually. Now there is a TON of FREE dictionary api out there, however most are rate limited to only ~500 per day which is not feasible. Luckily, someone kind enough is hosting a dictionary api that is not only free but is not rate limited, so let’s just spam this one until either it stops working or we get definitions for all of our words.
https://dictionaryapi.dev/

Now we have our words and the definitions of words. The last and important step is to filter all the words and definitions using roblox’s own chat filter to make sure nothing bad is displayed in-game.

What about rarities? How did you assign those? Was it based on google’s ngram viewer based on the frequency on how often the word was used? Well… I can’t reveal all my secrets. I left only the words that start with X in-game. Since I gave you the layout, adding more words shouldn’t be an issue, good luck!

6 Likes

who is Cantaaloupe and why do you dislike them so much


also cool unused function

code:
super messy/10
:+1:

2 Likes

479k Words list? If i add to my RBX file, May be having an scale of 5MB or 100MB :tired_face:

1 Like

Hey brother! i hope you doing well!!
I am a big noobie in ROBLOX dev so can u teach me how to actually make this work
it will be appreciated a lot!

1 Like

Create module and publish it to Toolbox. And in game use it with InsertService, or require(ID)

1 Like

Looks like theres no Cantaloupe in the scripts. Do you mean the user @Cantaaloupe ?

Utf8.char gives me headache thinking what it does

1 Like

Unfortunately, if you don’t already know how to code, this will not be much use for you, this is mainly a proof of concept on how to create “word rng” and how it actually has 1m+ definitions, not really a tutorial on coding itself. Simply put, my explanation is how it would be possible to create it on roblox, and the game itself is the proof it’s possible.

A lot of RNG games require manual addition of “rarity” items, however, this isn’t feasible with a game centered about learning new words, especially since many words can have multiple definitions (some words are both verbs and nouns or have different meanings as a noun).

Also, the real game itself is less than 11 megabytes, even with 470k+ words and 1m+ definitions of said words. All the words and definitions are cached in module scripts, and any new word that does not have a definition is looked up in-game and cached with datastores.

1 Like