'Names' file edits

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fbas
    Apprentice
    • Oct 2010
    • 59

    'Names' file edits

    Angband Vanilla 3.1.2v2 (angband-3.1.2v2-win.zip 1,636,853 bytes February 14, 2010)

    Wanted to edit the names file ({ANGBAND}/lib/edit/names.txt), which says don't edit unless you know exactly what you're doing else you will cause crashes.

    Sure enough, it causes crashes, so what do I need to know?

    I did not change the number of names just edited in place, then sorted them alphabetically (case-insensitive, though.. I notice the originals were all lowercase).

    Are there case limitations? length limitations? must be sorted in a particular way?

    Thanks for any input.
  • Derakon
    Prophet
    • Dec 2009
    • 9022

    #2
    Without looking at the code, I'd say either you screwed up the formatting of the file (e.g. merged the two lists of names) or the names need to be all lowercase. You should be able to determine if the latter is problematic with a trivial experiment: start with a clean file, capitalize one name, and see if it breaks.

    Comment

    • Magnate
      Angband Devteam member
      • May 2007
      • 5110

      #3
      AFAICR it's not a case issue, but I can't be certain of that. It shouldn't matter if you increase or decrease the number of names in a section, or even add a whole new section of names, as long as you preserve the file syntax.

      Best bet is to post your edited file in this thread and we can try and get it working ourselves.
      "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

      Comment

      • fbas
        Apprentice
        • Oct 2010
        • 59

        #4
        experimented

        it's not case, and can accept name lengths up to 30 chars (possibly more, haven't tested further)

        I had to remove non alpha characters (numbers, hyphen, underscore, apostrophe, etc).

        Still can't get my list to work, but will use binary method to find what is offending.

        Thanks for the tip about the number of items. I saw in some ini files about array sizes dimensioned there, so was nervous about changing numbers of elements in lists.

        Comment

        • Magnate
          Angband Devteam member
          • May 2007
          • 5110

          #5
          Originally posted by fbas
          Thanks for the tip about the number of items. I saw in some ini files about array sizes dimensioned there, so was nervous about changing numbers of elements in lists.
          The names parser is one of the few places in the game that can cope with changing numbers of elements: it does two passes through the file - the first to count the number of sections and number of names in each section (at which point it dimensions the arrays properly), and the second to get the names.
          "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

          Comment

          • fbas
            Apprentice
            • Oct 2010
            • 59

            #6
            this is totally lame. I finally got it to stop crashing (had a few numeric digits still in there) and the program doesn't even use the list. I don't know where it's getting the names from now, since the ones coming up are not in the file.

            Comment

            • camlost
              Sangband 1.x Maintainer
              • Apr 2007
              • 523

              #7
              Originally posted by fbas
              this is totally lame. I finally got it to stop crashing (had a few numeric digits still in there) and the program doesn't even use the list. I don't know where it's getting the names from now, since the ones coming up are not in the file.
              Try deleting the .raw?
              a chunk of Bronze {These look tastier than they are. !E}
              3 blank Parchments (Vellum) {No french novels please.}

              Comment

              • Magnate
                Angband Devteam member
                • May 2007
                • 5110

                #8
                Originally posted by camlost
                Try deleting the .raw?
                fbas, what version are you using??
                "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

                Comment

                • fbas
                  Apprentice
                  • Oct 2010
                  • 59

                  #9
                  Originally posted by Magnate
                  fbas, what version are you using??
                  3.1.2v2

                  don't worry about it, this is not a big deal. just wondering why it won't work, especially if it crashes when I put bad characters in the file.

                  Comment

                  • Dean Anderson
                    Adept
                    • Nov 2009
                    • 193

                    #10
                    Originally posted by fbas
                    this is totally lame. I finally got it to stop crashing (had a few numeric digits still in there) and the program doesn't even use the list. I don't know where it's getting the names from now, since the ones coming up are not in the file.
                    It probably is using the list, but not the way you might have imagined.

                    The code doesn't pick a name randomly from the list.

                    What it does is build up a set of probabilities based on the list.

                    For example, if your list has...

                    aaron
                    alice
                    bob
                    fred

                    The code will read this and decide that the start letter is:

                    A (50% chance)
                    B (25% chance)
                    F (25% chance)

                    It will also determine that an 'a' has a 33% chance of being followed by another 'a' (as in "aaron"), a 33% chance of being followed by an 'r' (as in "aaron", and a 33% chance of being followed by an "l" (as in "alice")

                    A 'b' has a 50% chance of being followed by an "o" (as in "bob") and a 50% chance of ending the word (as in "bob").

                    A 'c' is always followed by an 'e' (as in "alice").

                    And so forth...

                    So when it wants to produce a random name, it starts by picking a random starting letter from its list (based on their chances), and then keeps adding another random letter based on the chances of the current last letter until it gets to a word end.

                    With just a few words, it's rubbish. With that short list of four names it would always follow an 'l' with an 'i' and an 'i' with a 'c' and a 'c' with an 'e', for example. But with lots of words to use as a basis for its probabilities - particularly since those words will show various common letter patterns (i.e. syllables), it's remarkably good at coming up with words that look as though they should be real words in the language that the list was written in.

                    For example, the main list in the file is a list of names of Tolkien characters. Based on these, the code comes up with random names that also sound plausibly Tolkien-ish.

                    If you put in a big list of English boys names, it would come up with random names that sound like they could be English boys names. If you put in Latin words, it would come up with words that sound Latin (as it does when choosing the text for scrolls).

                    So it does work, and is based on the names you give it. It just isn't as crude as picking a random one from the list. It's far less repetitive than that.

                    Comment

                    • Derakon
                      Prophet
                      • Dec 2009
                      • 9022

                      #11
                      I move that Dean's explanation of how names work be added to the documentation at the top of the file.

                      Comment

                      • buzzkill
                        Prophet
                        • May 2008
                        • 2939

                        #12
                        That's very cool, and also what Derakon said.
                        www.mediafire.com/buzzkill - Get your 32x32 tiles here. UT32 now compatible Ironband and Quickband 9/6/2012.
                        My banding life on Buzzkill's ladder.

                        Comment

                        • fbas
                          Apprentice
                          • Oct 2010
                          • 59

                          #13
                          I'm a little confused by this, and will probably have to re-read it a few times.

                          What shocks me is that none of the suggested names are from my list. I took out all the Tolkein names and replaced them with mine.

                          Are you saying it's using my list to figure out how those names are constructed and creating a new one with similar probable combinations?

                          Interesting if true.

                          Originally posted by Dean Anderson
                          It probably is using the list, but not the way you might have imagined.

                          The code doesn't pick a name randomly from the list.

                          What it does is build up a set of probabilities based on the list.

                          For example, if your list has...

                          aaron
                          alice
                          bob
                          fred

                          The code will read this and decide that the start letter is:

                          A (50% chance)
                          B (25% chance)
                          F (25% chance)

                          It will also determine that an 'a' has a 33% chance of being followed by another 'a' (as in "aaron"), a 33% chance of being followed by an 'r' (as in "aaron", and a 33% chance of being followed by an "l" (as in "alice")

                          A 'b' has a 50% chance of being followed by an "o" (as in "bob") and a 50% chance of ending the word (as in "bob").

                          A 'c' is always followed by an 'e' (as in "alice").

                          And so forth...

                          So when it wants to produce a random name, it starts by picking a random starting letter from its list (based on their chances), and then keeps adding another random letter based on the chances of the current last letter until it gets to a word end.

                          With just a few words, it's rubbish. With that short list of four names it would always follow an 'l' with an 'i' and an 'i' with a 'c' and a 'c' with an 'e', for example. But with lots of words to use as a basis for its probabilities - particularly since those words will show various common letter patterns (i.e. syllables), it's remarkably good at coming up with words that look as though they should be real words in the language that the list was written in.

                          For example, the main list in the file is a list of names of Tolkien characters. Based on these, the code comes up with random names that also sound plausibly Tolkien-ish.

                          If you put in a big list of English boys names, it would come up with random names that sound like they could be English boys names. If you put in Latin words, it would come up with words that sound Latin (as it does when choosing the text for scrolls).

                          So it does work, and is based on the names you give it. It just isn't as crude as picking a random one from the list. It's far less repetitive than that.

                          Comment

                          • Derakon
                            Prophet
                            • Dec 2009
                            • 9022

                            #14
                            Correct. If it simply pulled names directly from the list, then there'd be a much smaller name pool and you'd inevitably run into repeats. Zangband's random artifacts used to work like this, and I remember finding two random artifact armors named "Bubble" in the same vault once.

                            In short, there's no way to force the game to use certain names without changing how names are selected, which requires modifying the source code.

                            Comment

                            • fbas
                              Apprentice
                              • Oct 2010
                              • 59

                              #15
                              Originally posted by Derakon
                              Correct. If it simply pulled names directly from the list, then there'd be a much smaller name pool and you'd inevitably run into repeats. Zangband's random artifacts used to work like this, and I remember finding two random artifact armors named "Bubble" in the same vault once.

                              In short, there's no way to force the game to use certain names without changing how names are selected, which requires modifying the source code.
                              slight bummer, since I was altering it for a friend to include spoofed online names of various friends of ours. the suggested names lose that feeling, and many of the statistical rules are messy since the names were often several words concatenated together.

                              might get better results without the spoofed names, using their original online names, but will still have strange non-sensical randomized combinations.

                              however, this is not much of a problem, since I doubt he or anyone else will use the randomizer rather than create their own names.

                              Comment

                              Working...
                              😀
                              😂
                              🥰
                              😘
                              🤢
                              😎
                              😞
                              😡
                              👍
                              👎