Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

There's a famous quote that goes, "There are only two hard things in Computer Science: cache invalidation and naming things." Of course, the real problem is naming things sensibly. With that restriction lifted, naming something becomes one of the easiest projects you can do! It really only requires that you know how to do three basic things: how to choose a random element from a list, how to concatenate strings, and how to print strings. That's the bare minimum to get something up and running. Anything you add on from there, like turning it into a logo or reading from an external list of words, is just gravy.

A name generator is also very well-suited to command line programs or twitter bots.

Genre and specificity is definitely your friend when it comes to picking a concept for your name generators. A movie title generator is probably too general to be very interesting. Limiting your scope to pulp adventure movies is better, but a bot that makes up names for Indiana Jones sequels immediately suggests a few specific forms and word types: Indiana Jones and the {noun} of {noun}. Indiana Jones and the {adjective} {noun}. Nouns: temple, doom, crusade, skull, cathedral, city, death, bones, gold, silver, ruby, emerald magic. Adjectives: lost, last, spooky, crystal, deserted, magic, golden.

Thanks! A name generator could certainly be a good fall back as it doesn't require any art. I've never done anything like that before. Would you pull names from an online resource, or just hard code arrays of (copy and pasted) categorised words and chose them randomly?

That's pretty much up to you! Writing out arrays of words directly into your source file is the least difficult thing to do, but it's also not very flexible. Creating and then reading from .json files is only barely more difficult, at least in python.

If you have a file like birds_north_america.json, you could load its list of birds in python 2.7 with the following:

import json

#assumes birds_north_america.json is in the same directory as your script
bird_json = json.load(open("birds_north_america.json))

#this will print "Birds of North America, grouped by family"
print(bird_json["description"])

#this gets the list of bird families
families = bird_json["birds"]

#this gets the first bird family from the list
ducks = birds[0]

#this prints the first member of the duck/geese/swam family
#which is "Black-bellied Whistling-Duck".
print(ducks["members"][0])

"ducks = birds[0]" should actually read "ducks = families[0]". I'd edit the post directly but itch.io's post edit feature messes up code pretty badly

Thanks for the tips! I think for now I'll stick to doing things the nasty way as I don't want to introduce too many ways to fail when I'm already going to be struggling! That could be a refactor later. :)