top of page

Random Name Generation

  • Writer: teejaydub
    teejaydub
  • Oct 5, 2017
  • 3 min read

Since this game is still very much in the documentation phase, I’m exploring different ideas on how to approach particular aspects of the game. One that fascinated me and warranted this blog post is name generation!


One thing that I’d like to bring attention to in this blog is the concept of resourcefulness. Never accept the long and tedious process of doing a particular process repeatedly. There will undoubtedly be a tool to help you. You just have to be willing to search for it.

The test that I want to run is to generate names for spaceships, with the format of “The” followed by an adjective, and then a noun. In my case, I thought it would be cool if the noun were different species of birds. So the first step: find some bird names. My first Google search is “list of bird names”. Lo and behold, there’s a wikipedia entry on exactly that. In another tab, I open up Google Drive and create an empty spreadsheet.

The Wikipedia list is tremendously long. Like, “takes several minutes to scroll through the page” long. Hitting ctrl-a and copying has the unfortunate effect of also copying images which is undesirable. But if we hit the “edit” button on the wiki page, we are presented with an editable text-only window of the entire contents of the page!


Now I ctrl-a the contents of the text and paste them into the spreadsheet.


It’s not too pretty. But there’s nothing to worry about yet. By hitting ctrl-h, I can find and replace characters within the spreadsheet. Not only do I want to get rid of the padding, I also want to get rid of any possible adjectives already attached to the word (think yellow-tailed oriole). To do that, I go the “find and replace” menu, and enable “regular expressions” which allows me to be more specific with the things that it finds (and eventually replaces).

It’s hard to tell in the photo, but there’s a space after the asterisk. That expression will find all characters behind a space and then replace it with nothing, in effect deleting it. So in the case of “yellow tailed oriole”, it will find “yellow tailed “ and delete it, leaving “oriole”. Perfect.


Next, I need to consolidate repeated terms, as now there are multiple cells with “oriole” in them since there was previously an entry for “yellow tailed oriole” and “blue tailed oriole”. To do this, I simply searched Google for an online tool to remove duplicates from pasted text. The specific search term was “remove duplicates online paste text”. Those words are deliberately chosen, as I don’t want to download a program, and would like the convenience of an online tool that doesn’t require much effort or time.

Super easy, and it just works. Now the list of birds is shorter without duplicates, but the last thing is capitalization. So, similarly, I quickly google “capitalize first letter online paste text” and the same website that had the tool above has a tool to capitalize the first letter!

The site is textfixer.com and I will most likely return to use their services.


Great, so now we have a list of several hundred birds to use as the noun. Up next are adjectives! A quick search later brings me to a list of about 1500 adjectives, of which I copy and format using similar steps and tools as for the bird names. The next step is to download these lists as .csv which is conveniently an option when you go to export the document.



Once the lists are downloaded, I drag them into the asset folder of the game project in Unity. We’re gonna make a quick script to randomly grab an element from each document to compose a name. So let’s create a new script.




And here’s the result!

Really digging the names. It works! I’ll be considering adding an even larger pool of names to choose from! Interesting luck that resulted in three instances of alliteration with “The Nutty Nunbird”, “The Grizzled Grassbird” and “The Perky Parrotfinch”

Comments


bottom of page