Back to console for me... at least for a little while. Anyway, does anyone have an open source random name generator i'm thinking of making one. Need some ideas.
Printable View
Back to console for me... at least for a little while. Anyway, does anyone have an open source random name generator i'm thinking of making one. Need some ideas.
how is that a random name generator? I mean something like:
A# Something that randomly creates elven names(for dungeons and dragons)
or
B# Something that randomly groups first names and last names.
Usually that is done using just a really long list of possible strings for first anmes, and for last names, and randomly selecting and combining them. You could even use an external text file for this purpose.
You could, I suppose, come up with an algo to generate a random name based on a set of phonetic elements, but a list is more reliable and usually simpler.
Perhaps something like:
Then in your game just instantiate a few engines like:Code:pseudo...
class nameengine {
public:
nameengine(char* fileName) {open filename, read the integer, .getline that many times and put in firstnames vector, then repeat for last names}
first() {return random element from firstNames}
last() {return random element from lsstNames}
full {return first()+' '+last()}
private:
vector<string> firstNames;
vector<string> lastNames;
};
Code:
nameengine ElvenNames("elfnames.txt");
nameengine HumanNames("mannames.txt");
string thisElfsName = ElvenNames.full();