Notes (: command) getting truncated in dump

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Tobias
    Adept
    • Dec 2009
    • 172

    Notes (: command) getting truncated in dump

    I tried to use the : command to document the progress through my first v4 game.
    But I noticed that the notes get truncated after a certain length.
    While I am writing them there is a different cutoff, which allows around 10 characters more than end up in the dump.

    So probably the cutoff while writing should be reduced to the cutoff used while dumping.

    Here is the diary itself:
    My Angband videos : http://www.youtube.com/view_play_lis...385E85F31166B2
  • Magnate
    Angband Devteam member
    • May 2007
    • 5110

    #2
    Originally posted by Tobias
    I tried to use the : command to document the progress through my first v4 game.
    But I noticed that the notes get truncated after a certain length.
    While I am writing them there is a different cutoff, which allows around 10 characters more than end up in the dump.

    So probably the cutoff while writing should be reduced to the cutoff used while dumping.
    This is harder than it sounds, because one includes the character's name, and the other doesn't. Since the code doesn't know the length of the character's name, it's impossible to get an exact match. But now I come to think of it, I don't really see why the name is in there at all. I'm not overly familiar with this piece of code and therefore reluctant to change it, but wonder if any other devs (or anyone else familiar with it, such as variant writers) think it could be dispensed with. Then we could use the same size limit for both buffers.
    "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

    Comment

    • d_m
      Angband Devteam member
      • Aug 2008
      • 1517

      #3
      I think this relates to a cute feature I added awhile back.

      I will try to fix it or revert.
      linux->xterm->screen->pmacs

      Comment

      • Magnate
        Angband Devteam member
        • May 2007
        • 5110

        #4
        Originally posted by d_m
        I think this relates to a cute feature I added awhile back.

        I will try to fix it or revert.
        Thanks d_m - opened as #1615.
        "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

        Comment

        • d_m
          Angband Devteam member
          • Aug 2008
          • 1517

          #5
          So looking at this it is a lot more complicated than I anticipated.

          Basically, here is the pipeline:

          1. Get the note from the user
          2. Do some cute processing on note to expand /me and /say
          3. Write note to log
          4. Save note to history
          5. Display history when writing character dump

          Each of these steps actually uses it's own buffer/buffer size. I can remove step #2 but that isn't actually the problem in this case (in fact I doubt many people even knew about it).

          The real issue is that #4 saves the first 80 characters of the note (i.e. all of it), but the way #5 works it ends up truncating the note (due to the way it formats those lines) to (I think) the first 63 characters. I think the original note is limited to 70 characters of input + 3 characters of prepended text.

          I guess what I am saying is that there isn't a lot of consistency in the way these things are handled and that I am not promising to come up with a "nice" fix for the problem.
          linux->xterm->screen->pmacs

          Comment

          • Magnate
            Angband Devteam member
            • May 2007
            • 5110

            #6
            Originally posted by d_m
            So looking at this it is a lot more complicated than I anticipated.

            Basically, here is the pipeline:

            1. Get the note from the user
            2. Do some cute processing on note to expand /me and /say
            3. Write note to log
            4. Save note to history
            5. Display history when writing character dump

            Each of these steps actually uses it's own buffer/buffer size. I can remove step #2 but that isn't actually the problem in this case (in fact I doubt many people even knew about it).

            The real issue is that #4 saves the first 80 characters of the note (i.e. all of it), but the way #5 works it ends up truncating the note (due to the way it formats those lines) to (I think) the first 63 characters. I think the original note is limited to 70 characters of input + 3 characters of prepended text.

            I guess what I am saying is that there isn't a lot of consistency in the way these things are handled and that I am not promising to come up with a "nice" fix for the problem.
            IMO the problem is at step 5. The history display is quite lazy, and assumes that every history item must fit onto one line. If history_display were re-written to spread history entries over two lines where necessary, this problem would go away without compromising the cuteness of the notes functionality ;-)
            "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
              • 9647

              #7
              Originally posted by Magnate
              IMO the problem is at step 5. The history display is quite lazy, and assumes that every history item must fit onto one line. If history_display were re-written to spread history entries over two lines where necessary, this problem would go away without compromising the cuteness of the notes functionality ;-)
              ...which ISTR NPP notes used to (and possibly still) do.
              One for the Dark Lord on his dark throne
              In the Land of Mordor where the Shadows lie.

              Comment

              • nppangband
                NPPAngband Maintainer
                • Dec 2008
                • 926

                #8
                Originally posted by Nick
                ...which ISTR NPP notes used to (and possibly still) do.
                Correct, NPP splits the note into multiple lines if necessary. The code that does this starts at line 3721 in cmd.4 inside the do_cmd_note function.
                NPPAngband current home page: http://nppangband.bitshepherd.net/
                Source code repository:
                https://github.com/nppangband/NPPAngband_QT
                Downloads:
                https://app.box.com/s/1x7k65ghsmc31usmj329pb8415n1ux57

                Comment

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