Truncation of monster names

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • half
    Knight
    • Jan 2009
    • 910

    Truncation of monster names

    In my proto-variant, I have had a longstanding bug with monsters' names being truncated. For example, at one point

    White worm mass

    appeared as:

    Wh

    and now the white worm masses were fine but

    Metallic green centipede

    appears as

    Me

    I'm pretty sure it has also happened with more than two characters in the string before getting cut off.

    Has anyone had this happen to them before? It strikes me that somehow a NULL character is getting written into the text descriptions or something like that. It mainly happens on my Windows build (the same creature getting mangled for each playtester in a given development version), but I have had the problem once on my Mac build.

    Any ideas?
  • zaimoni
    Knight
    • Apr 2007
    • 590

    #2
    Yes, there's a fairly awful hack in data loading dating back to the initial conversion to data files: all of the strings for monster names are stuffed into a single long C array containing the NUL-terminated representation of the strings in sequence. There's a few other instances. Look for ?_name and ?_text global variables for the large arrays, and name and text fields within *_type structs for offsets into these arrays.

    It sounds like the construction and/or offsets into these arrays isn't going perfectly.
    Zaiband: end the "I shouldn't have survived that" experience. V3.0.6 fork on Hg.
    Zaiband 3.0.10 ETA Mar. 7 2011 (Yes, schedule slipped. Latest testing indicates not enough assert() calls to allow release.)
    Z.C++: pre-alpha C/C++ compiler system (usable preprocessor). Also on Hg. Z.C++ 0.0.10 ETA December 31 2011

    Comment

    • Twilight
      Apprentice
      • Jan 2009
      • 58

      #3
      Originally posted by half
      In my proto-variant, I have had a longstanding bug with monsters' names being truncated. For example, at one point

      White worm mass

      appeared as:

      Wh

      and now the white worm masses were fine but

      Metallic green centipede

      appears as

      Me

      I'm pretty sure it has also happened with more than two characters in the string before getting cut off.

      Has anyone had this happen to them before? It strikes me that somehow a NULL character is getting written into the text descriptions or something like that. It mainly happens on my Windows build (the same creature getting mangled for each playtester in a given development version), but I have had the problem once on my Mac build.

      Any ideas?
      This seems like it might be the old "Blu" bug. The thread:

      gives a fix - at least for NPP. Hopefully it's the same bug and this helps.
      It's better to burn out than to fade away!

      Comment

      • half
        Knight
        • Jan 2009
        • 910

        #4
        Originally posted by Twilight
        This seems like it might be the old "Blu" bug. The thread:

        gives a fix - at least for NPP. Hopefully it's the same bug and this helps.
        Thanks Twilight. You have saved me a lot of array out of bounds debugging. That is almost certainly the same bug. It looks like my code forked off from NPP between the fix to load.c and the fix to birth.c. I've now removed the troublesome line, and all should be fine (I can't check without a windows box, but will do so in a week or so).

        Comment

        • Twilight
          Apprentice
          • Jan 2009
          • 58

          #5
          Originally posted by half
          Thanks Twilight. You have saved me a lot of array out of bounds debugging. That is almost certainly the same bug. It looks like my code forked off from NPP between the fix to load.c and the fix to birth.c. I've now removed the troublesome line, and all should be fine (I can't check without a windows box, but will do so in a week or so).
          Luckily I just started playing *bands again and checking the angband forums/r.g.r.a etc after years away in time to recognize this one. Glad to have been of help.
          It's better to burn out than to fade away!

          Comment

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