Lil bug in sound processing?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • noone42
    Rookie
    • Oct 2011
    • 6

    Lil bug in sound processing?

    Hi there

    ( Please excuse my bad english )

    Since quite a while i don't check for new Angband versions.
    Now i got the newest and its still fun to play!
    But i think i discovered a lil bug in sound processing.
    In older versions the sound events in sound.cfg for a single event where chosen by random ( if there was more then one sound for one event )
    So for example in sound.cfg

    .....
    # You miss a melee attack against a monster.
    miss = miss.wav miss1.wav miss2.wav miss_a.wav miss_b.wav
    .....

    means that one of the 5 sounds

    miss.wav
    miss1.wav
    miss2.wav
    miss_a.wav
    miss_b.wav
    is played by random if the "miss" sound event occurs

    I checked this behavior with my sound.cfg and older versions of Angband

    3.0.9b works fine
    3.1.0 beta works fine
    3.1.1.1626 works fine
    3.1.2.v2 works fine
    3.2.0 ONLY PLAYS FIRST SOUND IN LIST ( NO RANDOM CHOICE )
    3.3.0 ONLY PLAYS FIRST SOUND IN LIST ( NO RANDOM CHOICE )

    so if i dont miss something new ( i read the changes.txt files and find nothing special ) this maybe is a lil bug since version 3.2.0 ??

    If i just have to change something in my sound.cfg so please let me know.

    Thanks and keep up this good work on this great game!
  • noone42
    Rookie
    • Oct 2011
    • 6

    #2
    Hi again!

    Meanwhile i found the reason. Up to version 3.1.2v2 in source file main-win.c
    the sound is prepared with

    /* Build the path */
    path_build(buf, sizeof(buf), ANGBAND_DIR_XTRA_SOUND, sound_file[v][Rand_simple(i)]);

    with function Rand_simple implemented in z-rand.c

    Since Version 3.2.0 you will find this line in main-win.c

    /* Build the path */
    path_build(buf, sizeof(buf), ANGBAND_DIR_XTRA_SOUND, sound_file[v][0]);

    and function Rand_simple is defined in z-rand.h but no longer implemented in z-rand.c

    so its obvious why only the first sound is played ...

    But i don't understand why Rand_simple is no longer implemented in z-rand.c ???
    Does it any harm to the gameplay?


    Any explaination is welcome

    Thanks!

    Comment

    • Magnate
      Angband Devteam member
      • May 2007
      • 5110

      #3
      This wasn't me, but I think it might be related to the switch to the WELL1024 RNG. I'm not certain about that - you'd need to do git blame to see when that line was changed and what that commit was about. I agree that this is a bug though - please open a ticket at trac.rephial.org (I am confident that it has not already been reported).
      "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

      Comment

      • Blue Baron
        Adept
        • Apr 2011
        • 103

        #4
        Originally posted by Magnate
        This wasn't me, but I think it might be related to the switch to the WELL1024 RNG. I'm not certain about that - you'd need to do git blame to see when that line was changed and what that commit was about. I agree that this is a bug though - please open a ticket at trac.rephial.org (I am confident that it has not already been reported).
        Rand_simple was reimplemented for the temporary save file names so fixing this would just be changing the line back?

        Comment

        • Magnate
          Angband Devteam member
          • May 2007
          • 5110

          #5
          Originally posted by Blue Baron
          Rand_simple was reimplemented for the temporary save file names so fixing this would just be changing the line back?
          Maybe, yes - if it does the same thing as before!
          "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

          Comment

          • noone42
            Rookie
            • Oct 2011
            • 6

            #6
            I checked with the source from 3.3.0 and Rand_simple is NOT implemented there. It is declared in z-rand.h but not implemented in z-rand.c.
            So compiling Angband with Bloodshed Dev-C++ 5.0 beta 9.2 (4.9.9.2)
            fail in the first place for me.

            ( I changed the line back to
            path_build(buf, sizeof(buf), ANGBAND_DIR_XTRA_SOUND, sound_file[v][Rand_simple(i)]); )

            Then i just copy and paste the Rand_simple function from z-rand.c of older Angband 3.1.2v2 source. Compile works fine with it. Sounds played by random choice again and gameplay seems normal to me. ( Windows )

            May i have to try it with the development version of Angband before opening a ticket? ( checking it out first with git or something? )

            Comment

            • Blue Baron
              Adept
              • Apr 2011
              • 103

              #7
              Originally posted by Magnate
              Maybe, yes - if it does the same thing as before!
              If you mean does it generate a random number without disturbing the state of the main RNG, then yes. but the internals are different.

              I don't know what V's Rand_simple did before, but Z+'s Rand_simple copies the state of the main RNG, replaces it with its own state, generates the number, then restores the main state. I felt this was too complicated, so the one I wrote calls time then blends it with a modified seed.

              noone42:
              It is in both the dev versions and the 3.3.2 RC, possibly 3.3.1 as well.

              Comment

              • noone42
                Rookie
                • Oct 2011
                • 6

                #8
                Thanks Blue Baron,

                i tested with source from download page version 3.3.0 August 1, 2011.
                No Rand_simple implemented in z-rand.c there but declared in z-rand.h.
                So if Rand_simple is implemented again now i am sure random sound works again.
                Only thing to do is to replace the line in main-win.c with the old version.
                ( Works fine here with 3.3.0 source and reimplemented old Rand_simple )

                Problem solved i guess

                Comment

                • takkaria
                  Veteran
                  • Apr 2007
                  • 1951

                  #9
                  Originally posted by noone42
                  I checked with the source from 3.3.0 and Rand_simple is NOT implemented there. It is declared in z-rand.h but not implemented in z-rand.c.
                  So compiling Angband with Bloodshed Dev-C++ 5.0 beta 9.2 (4.9.9.2)
                  fail in the first place for me.

                  ( I changed the line back to
                  path_build(buf, sizeof(buf), ANGBAND_DIR_XTRA_SOUND, sound_file[v][Rand_simple(i)]); )

                  Then i just copy and paste the Rand_simple function from z-rand.c of older Angband 3.1.2v2 source. Compile works fine with it. Sounds played by random choice again and gameplay seems normal to me. ( Windows )

                  May i have to try it with the development version of Angband before opening a ticket? ( checking it out first with git or something? )
                  This is fixed in the development version now, thanks.
                  takkaria whispers something about options. -more-

                  Comment

                  • noone42
                    Rookie
                    • Oct 2011
                    • 6

                    #10
                    Nice!

                    I cant compile the git version yet but i with the older source it works flawless for me.
                    Thanks for fixing it because i love to play Angband with my sounds
                    Now i cant wait for this great Angband 64 x 64 pixel tileset from Shockbolt to be finished.
                    This looks very good and it will be fun to play Angband again with this new tileset.

                    Comment

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