Dynastic character numbering - r1433

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Magnate
    Angband Devteam member
    • May 2007
    • 5110

    Dynastic character numbering - r1433

    Evening all - with the help of a lurker I've implemented roman numeral name suffices, so those of us who die a lot can have automatic numbering for new characters if we want.

    So, if you give your character a name ending in " I" (that's a space and then a capital i), it will notice that, and put a counter in the savefile. All subsequent characters will default to the same name (even if you change the race/class) with the suffix properly incremented (up to 255). If you change the name to one that doesn't end in " I", it will turn off the numbering and all subsequent characters will get the same name.

    It does not work with any suffix other than the first - that would need an entire "de-romanify" function which we didn't write. This means that you cannot change the suffix of a dynasty once you've started (e.g. if one dies an embarrassing death) - you either have to carry on or restart at I.

    Please test and report any bugs in this thread. We used a spare byte in the savefile, so there should be no savefile compatibility issues.

    (Edit: do not forget the space. It won't work without a space as the penultimate character, and a capital i as the last.)
    Last edited by Magnate; June 8, 2009, 20:34.
    "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles
  • Atarlost
    Swordsman
    • Apr 2007
    • 441

    #2
    A number arabicizer wouldn't be too hard to write and if you cutoff at 255 you could just read look for a last word with nothing but CLXVI in it. No counter needed.
    One Ring to rule them all. One Ring to bind them.
    One Ring to bring them all and in the darkness interrupt the movie.

    Comment

    • Magnate
      Angband Devteam member
      • May 2007
      • 5110

      #3
      Originally posted by Atarlost
      A number arabicizer wouldn't be too hard to write and if you cutoff at 255 you could just read look for a last word with nothing but CLXVI in it. No counter needed.
      If you had an arabiciser/deromanify, you wouldn't need to stop at 255 (that's a limitation of the 1-byte counter). If anyone wants to write one and send it to me, I'll happily expand this functionality to accommodate changes to the suffices, starting at numbers other than I etc.
      "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

      Comment

      • Cauldron
        Apprentice
        • May 2009
        • 62

        #4
        Originally posted by Atarlost
        A number arabicizer wouldn't be too hard to write and if you cutoff at 255 you could just read look for a last word with nothing but CLXVI in it. No counter needed.
        I think you mean CCLV.

        Originally posted by Bart_Simpson
        Roman Numerals!? They never even *tried* to teach us that in school!
        I miss autoscum... but not that much.

        Comment

        • Marble Dice
          Swordsman
          • Jun 2008
          • 412

          #5
          CCLV is indeed 255, but when he said CLXVI he was referring to the set of characters necessary to recognize roman numerals no higher than 255 i.e. you wouldn't even need to look for the characters D or M. If fact, the set [IVXLC]+ would get you all the way up to 399 or CCCXCIX.

          Comment

          • Cauldron
            Apprentice
            • May 2009
            • 62

            #6
            Originally posted by Marble Dice
            CCLV is indeed 255, but when he said CLXVI he was referring to the set of characters necessary to recognize roman numerals no higher than 255 i.e. you wouldn't even need to look for the characters D or M. If fact, the set [IVXLC]+ would get you all the way up to 399 or CCCXCIX.
            OK that makes sense. I think 399 is properly CCCIC, though. Which is the problem with roman numerals. The problem is incrementing the roman numeral. Rather, converting from arabic to roman. Though someone has probably written a conversion function.
            I miss autoscum... but not that much.

            Comment

            • Marble Dice
              Swordsman
              • Jun 2008
              • 412

              #7
              Some sources consider it improper to prefix a larger roman numeral with a smaller one to indicate subtraction when the larger roman numeral is more than one order of magnitude larger than the smaller one. If you go by that rule, then IX (9) is the last time you can use I as a prefix, and the only prefix you would use on C would be XC (90).

              But there's tons of inconsistencies like that. Sometimes you see IIII instead of IV, sometimes you see IIX instead of VIII, and then sometimes people make an exception for numbers over 1000, since the characters after M (1000) have bars over them, which is difficult to render. So instead of M,V-bar for 4000, sometimes you'll see MMMM.

              Arabic to roman is significantly easier than roman to arabic, in my opinion, although you can find algorithms for either. If you're doing arabic-to-roman you can just pick a consistent set of rules and run with them, but when you're doing roman-to-arabic, you may want to accept multiple methods of writing the numbers, or you might want to exclude poorly-formed numerals.

              I'm glad I never had to do math with roman numerals.

              Comment

              • d_m
                Angband Devteam member
                • Aug 2008
                • 1517

                #8
                Originally posted by Marble Dice
                I'm glad I never had to do math with roman numerals.
                I remember hearing some opinion from a historian (or maybe some random wacko on the internet) that ultimately Roman engineering was limited by how hard doing arithmetic in Roman numerals was.
                linux->xterm->screen->pmacs

                Comment

                • Magnate
                  Angband Devteam member
                  • May 2007
                  • 5110

                  #9
                  Originally posted by d_m
                  I remember hearing some opinion from a historian (or maybe some random wacko on the internet) that ultimately Roman engineering was limited by how hard doing arithmetic in Roman numerals was.
                  I think the fact that they didn't have the number zero also made engineering pretty hard ...

                  ... and here's me thinking people would just say "Gee, I've wanted this functionality for ages - thanks"
                  "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

                  Comment

                  • Colbey
                    Apprentice
                    • Feb 2008
                    • 51

                    #10
                    I've hoped for this feature for a long time. I express my gratitude!

                    Comment

                    • Magnate
                      Angband Devteam member
                      • May 2007
                      • 5110

                      #11
                      Originally posted by Colbey
                      I've hoped for this feature for a long time. I express my gratitude!
                      Heh, thanks. eatomyx sent me a de-romanifier, so the next update will enable people to use suffices other than I, should they so wish. It could also dispense with the savefile byte, by parsing the suffix directly.
                      "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

                      Comment

                      • Nick
                        Vanilla maintainer
                        • Apr 2007
                        • 9637

                        #12
                        Originally posted by Magnate
                        ...to use suffices other than I
                        Suffixes suffices.
                        One for the Dark Lord on his dark throne
                        In the Land of Mordor where the Shadows lie.

                        Comment

                        • Magnate
                          Angband Devteam member
                          • May 2007
                          • 5110

                          #13
                          Originally posted by Nick
                          Suffixes suffices.
                          Yeah I wondered about that. I was assuming suffix is like index, where indeces suffices. But maybe it's more like prefix.
                          "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

                          Comment

                          • Magnate
                            Angband Devteam member
                            • May 2007
                            • 5110

                            #14
                            This functionality has been overhauled in r1512 (thanks to Marble Dice and Peter Denison). It should now increment pretty much any roman suffix, including insane ones like MMMDCCCLXXXVIII (which I've tested). Anyone who reaches 4000 consecutive characters should take a break from playing Angband and go and find a character set with the roman numeral for 5000 in it (M with a bar over the top).

                            If for any reason it can't deal with your suffix, it should print an error message. If you get this error, and think your roman numeral suffix is valid, let me know.

                            You still need the space before the suffix, in all cases.
                            "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

                            Comment

                            • myshkin
                              Angband Devteam member
                              • Apr 2007
                              • 334

                              #15
                              Originally posted by Magnate
                              Anyone who reaches 4000 consecutive characters should take a break from playing Angband and go and find a character set with the roman numeral for 5000 in it (M with a bar over the top).
                              Actually, that should be a V with a bar. Wikipedia also makes reference to a notation with parentheses, but I haven't seen that before.

                              Comment

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