Results 1 to 9 of 9

Thread: Personal names of creatures

  
  1. #1
    KeeperFX Author mefistotelis's Avatar
    Join Date
    Sep 2009
    Location
    Poland
    Posts
    1,242

    Default Personal names of creatures

    DK has a neat algorithm of making creature names.

    It uses 3 lists:
    Code:
    const char *name_starts[] = {
        "B", "C", "D", "F",
        "G", "H", "J", "K",
        "L", "M", "N", "P",
        "R", "S", "T", "V",
        "Y", "Z", "Ch",
        "Sh", "Al", "Th",
    };
    
    const char *name_vowels[] = {
        "a",  "e",  "i", "o",
        "u",  "ee", "oo",
        "oa", "ai", "ea",
    };
    
    
    const char *name_consonants[] = {
        "b", "c", "d", "f",
        "g", "h", "j", "k",
        "l", "m", "n", "p",
        "r", "s", "t", "v",
        "y", "z", "ch", "sh"
    };
    First a char is selected from name_starts, then repeatedly one of name_vowels and name_consonants are appended at the end, until the amount of appended elements reaches a random limit (up to 8).
    There is an exception for AVATAR - his name is always "Avatar".

    Here's the C code which does that:
    https://code.google.com/p/keeperfx/s...04&r=1104#1490

    This generates nice unique names for creatures.
    But:
    - I'm not sure if the names match to heroes
    - The names definitely don't match female creatures
    - Insects could have different, more buzzing names

    Can anyone recommend an algorithm to create female/insect/hero names?

  2. #2
    Elite Dragon Mothrayas's Avatar
    Join Date
    Nov 2009
    Location
    The Netherlands
    Posts
    1,635

    Default Re: Personal names of creatures

    The game uses this algorithm to generate (give or take one) 256 different names, right?

    Could you post the array of names generated by the game? I looked at the source function, but I don't know how the game's randomness works/is implemented, so my quick attempt to copy it (using different methods for randomness) lead to different results.

    The Awakening


  3. #3
    KeeperFX Author mefistotelis's Avatar
    Join Date
    Sep 2009
    Location
    Poland
    Posts
    1,242

    Default Re: Personal names of creatures

    Quote Originally Posted by Mothrayas View Post
    The game uses this algorithm to generate (give or take one) 256 different names, right?
    No, it doesn't really work like that.
    There is now 2^32 possible seeds.

    Originally, some offset in memory was used as seed, so the amount of names was limited to 256; I changed the seed to be creature index + creature birth turn.

    And besides seeds, there is also a relation to "randomisor" array, which is filled by another pseudo-random generator.

  4. #4
    Elite Dragon Mothrayas's Avatar
    Join Date
    Nov 2009
    Location
    The Netherlands
    Posts
    1,635

    Default Re: Personal names of creatures

    Ah, I see. I guess the method for randomness won't matter so much if there are now up to 2^32 possibilities anyway.

    I'll look into this.

    The Awakening


  5. #5
    Elite Dragon Mothrayas's Avatar
    Join Date
    Nov 2009
    Location
    The Netherlands
    Posts
    1,635

    Default Re: Personal names of creatures

    I've had a go at changing the character arrays and name algorithm a bit to lean more towards hero/female/insect-esque names.

    First off, in order to generate better name ends, I figured to add two more tables, both only used for the end of a name. One where otherwise consonants would be placed, and one where otherwise vowels need to be placed. Using these tables in the code is, of course, trivial:

    Code:
    if(i == name_len - 1) {
    	if(i & 1) part = name_end_consonants[randN % (sizeof(name_end_consonants)/sizeof(name_end_consonants[0]))];
    	else part = name_end_vowels[randN % (sizeof(name_end_vowels)/sizeof(name_end_vowels[0]))];
    } else if (i & 1) {
        part = name_consonants[randN % (sizeof(name_consonants)/sizeof(name_consonants[0]))];
    } else {
        part = name_vowels[randN % (sizeof(name_vowels)/sizeof(name_vowels[0]))];
    }
    These are the tables I came up with:

    Creatures

    Code:
    const char *name_starts[] = {
        "B", "C", "D", "F",
        "G", "H", "J", "K",
        "L", "M", "N", "P",
        "R", "S", "T", "V",
        "Y", "Z", "Ch",
        "Sh", "Al", "Th",
    };
    
    const char *name_vowels[] = {
        "a",  "e",  "i", "o",
        "u",  "ee", "oo",
        "oa", "ai", "ea",
    };
    
    
    const char *name_consonants[] = {
        "b", "c", "d", "f",
        "g", "h", "j", "k",
        "l", "m", "n", "p",
        "r", "s", "t", "v",
        "y", "z", "ch", "sh"
    };
    
    const char *name_end_consonants[] = {
        "b", "c", "d", "f",
        "g", "h", "j", "k",
        "l", "m", "n", "p",
        "r", "s", "t", "v",
        "y", "z", "ch", "sh"
    };
    
    const char *name_end_vowels[] = {
        "a",  "e",  "i", "o",
        "u",  "ee", "oo",
        "oa", "ai", "ea",
    };
    Unchanged from the current KeeperFX source. The end tables are also identical to the regular consonant/vowel tables.

    Heroes

    Code:
    const char *name_starts[] = {
        "B", "C", "D", "F",
        "K", "L", "M", "N", 
    	"P", "R", "S", "T", 
    	"V", "X", "Z", "Ch",
        "Al", "Th",
    };
    
    const char *name_vowels[] = {
        "a",  "e",  "i", "o",
        "u",  "ia", "ea"
    };
    
    
    const char *name_consonants[] = {
        "b", "c", "d", "f",
        "k", "l", "m", "n", 
    	"p", "r", "s", "t",
    	"v", "z"
    };
    
    const char *name_end_consonants[] = {
    	"s", "n", "c", "x", "ck"
    };
    
    const char *name_end_vowels[] = {
        "us", "os", "as", "on"
    };
    I used more Latin/Greek-ish inspired names for the Heroes, which makes them sound a bit more classy than the creatures. I think it works well enough here.

    Insects

    Code:
    const char *name_starts[] = {
        "B", "C", "D", "F",
        "G", "H", "J", "K",
        "L", "M", "N", "P",
        "R", "S", "T", "V",
    	"W", "Y", "Z", "Ch",
        "Sh", "Al", "Th", "B"
    };
    
    const char *name_vowels[] = {
        "a", "e", "i", "o",
        "u", "o", "u", "e",
    	"y"
    };
    
    
    const char *name_consonants[] = {
        "b", "c", "d", "f",
        "g", "h", "j", "k",
        "l", "m", "n", "p",
        "r", "s", "t", "v",
        "z", "ch", "ck", "s",
    	"zz", "zs", "sz", "z",
    	"b", "th",
    };
    
    const char *name_end_consonants[] = {
        "z", "zz", "t", "s",
    	"z", "l", "ll", "m"
    };
    
    
    const char *name_end_vowels[] = {
        "e", "er", "i", "uz", "on",
    	"os", "oz", "us"
    };
    This is a bit weird. "Buzzing" names is also a bit weirdly defined. It's somewhat similar to creatures, but with greater emphasis on s's and z's, and different suffixes. I didn't exclude a lot of possibilities for other letters, though, so sometimes names can be much like regular creature names. Still not too bad I think.

    By the way, if you notice I have some duplicate letters in the table, it's just a simple attempt to steer randomness a bit more towards that direction.

    Also, for the insects, you may want to reduce the maximum name length (to e.g. 4 or 5). Long insect names sound weird.

    Females

    Code:
    const char *name_starts[] = {
        "B", "C", "D", "F",
        "G", "H", "J", "K",
        "L", "M", "N", "P",
        "R", "S", "V", "Y",
    	"Z", "Ch", "An",
        "Sh", "Al", "Th",
    };
    
    const char *name_vowels[] = {
        "a",  "e",  "i", "o", "a",
        "u",  "oa", "ia", "ea",
    };
    
    
    const char *name_consonants[] = {
        "b", "c", "d", "f",
        "g", "h", "k", "l",
    	"m", "n", "p", "r",
    	"s", "t", "v", "x",
    	"z", "ch", "sh", "th",
    };
    
    const char *name_end_consonants[] = {
    	"sa", "na", "s", "n", "x", "tha"
    };
    
    const char *name_end_vowels[] = {
        "as", "a", "i", "is", "ia"
    };
    A bit in between the creature and hero names, a bit more pronounced on 'feminine' vowels like a and i, and appropriate suffixes. Still does not quite go too far from creature names I think.



    I generated 1000 random names with each set of tables:

    Creatures
    Heroes
    Insects (max length reduced to 4)
    Females

    If it's not different enough, I guess we could just go further with the same concept.
    Last edited by Mothrayas; March 16th, 2014 at 14:32.

    The Awakening


  6. #6
    Warlock
    Join Date
    Sep 2012
    Posts
    411

    Default Re: Personal names of creatures

    I always laugh at the named "Fap" looking at a in the torture chamber.

  7. #7
    Awakening Game Master Metal Gear Rex's Avatar
    Join Date
    Sep 2009
    Posts
    5,689

    Default Re: Personal names of creatures

    <3

    It's funny because I was just thinking about the names between DK1 and DK2 a few days ago.
    Dungeon Keeper 2 Patch: With More Balance and Pie [Hiatus]
    Forever Hiatus. Probably. Latest Version: 3.5 w/Levels 1-11 Revised.

    The Awakening: GM Powers Activate!
    Tesonu is napping!

  8. #8
    KeeperFX Author mefistotelis's Avatar
    Join Date
    Sep 2009
    Location
    Poland
    Posts
    1,242

    Default Re: Personal names of creatures

    Separating the last nucleus (I'm not sure it it's the correct term to call such part-of-syllabe) does sound like a good idea.
    I will start with that.

    I'm not sure if Boris is a good female name though (#6 on the list). This may be hard to fine-tune without overcomplicating.
    But maybe it's not that bad - if I ever found a fairy named Boris, I'd consider that quite funny.

  9. #9
    Elite Dragon Mothrayas's Avatar
    Join Date
    Nov 2009
    Location
    The Netherlands
    Posts
    1,635

    Default Re: Personal names of creatures

    Yeah, it's one of the disadvantages with such a random name system. If you want to prevent hitting such a name, you'd have to remove one of the letters to prevent the combination. There are thousands of male names you could try to eliminate this way, and by the end of it, you won't have much room for combinations left.

    But then again, Dungeon Keeper has always had the humor of randomly having creatures like Bob the Witch. We may not even have to remove such instances.

    Also, "Boris" is of course just one possibility out of tens of thousands of random possible combinations. The chance of the name system randomly generating "Boris" with that system is roughly 1 in 79200. It just happened to end up on the list there.

    The Awakening


Similar Threads

  1. Title Names
    By dk2player in forum General Discussion
    Replies: 13
    Last Post: March 31st, 2012, 21:11
  2. Steam names
    By Necror in forum Off Topic
    Replies: 7
    Last Post: September 13th, 2010, 15:57

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •