Some technical questions (sound/UI) from a beginner

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Tungwe
    Rookie
    • Jun 2020
    • 7

    Some technical questions (sound/UI) from a beginner

    Hi folks.

    I just started to play Angband. I'm wondering if:
    a) Is it possible to get sound in the terminal version on Linux?
    b) Is it possible to somehow resize the terminals (without opening the game as several separate windows)? I'm currently launching the game with `angband -mgcu -- -n4` so I can have inventory/equipment, messages and monster list open along with the main game. But the windows take a lot of space, so it would be nice to resize or merge them somehow.
  • fph
    Veteran
    • Apr 2009
    • 1030

    #2
    Originally posted by Tungwe
    Hi folks.

    I just started to play Angband. I'm wondering if:
    a) Is it possible to get sound in the terminal version on Linux?
    b) Is it possible to somehow resize the terminals (without opening the game as several separate windows)? I'm currently launching the game with `angband -mgcu -- -n4` so I can have inventory/equipment, messages and monster list open along with the main game. But the windows take a lot of space, so it would be nice to resize or merge them somehow.
    Welcome! Do you have the option to switch to the SDL2 frontend (with X11 or Wayland)? That would solve both of your problems and give you a more configurable experience. If it is compiled in, `angband -msdl2` is enough to start it. To compile it in, you will need a few extra packages (I am not sure if the compilation instructions include the up-to-date list, but in any case I can help here if you post error messages).
    --
    Dive fast, die young, leave a high-CHA corpse.

    Comment

    • moosferatu
      Apprentice
      • Feb 2020
      • 99

      #3
      It is possible to use sound with the GCU version. You'll need the SDL devel libraries and sox (for converting the mp3 files into oggs) installed, and then compile Angband as follows:

      Code:
      cd angband
      ./autogen.sh
      ./configure --with-no-install --enable-sdl --enable-sdl-mixer
      make
      cp src/angband .
      cd lib/sounds
      for f in *.mp3 ; do sox -v `sox "$f" -n stat -v 2>&1` "$f" `basename "$f" .mp3`.ogg; done
      sed -i -- 's/.mp3/.ogg/g' sound.cfg
      cd ../../
      Once compiled, run Angband like so:

      Code:
      ./angband -ssdl -mgcu -- -n4
      And then, in the game, hit "=", "a" to open the options menu and enable sound (option "b").

      As far as I can tell, it is not possible to resize the sub windows in GCU. That said, I don't think there's a reason that these windows couldn't be sized manually (with environment variables like the X11 port), other than someone would have to add the code to main-gcu.c to do it.
      Last edited by moosferatu; June 9, 2020, 13:43.

      Comment

      • Nick
        Vanilla maintainer
        • Apr 2007
        • 9648

        #4
        I have not used this - and certainly didn't write it, Gwarl did - but you can adjust subwindows in the gcu port (as of 4.2.0). Here is Gwarl's comment in full:
        Code:
        /* Parse Args and Prepare the Terminals. Rectangles are specified
              as Width x Height, right? The game will allow you to have two
              strips of extra terminals, one on the right and one on the bottom.
              The map terminal will than fit in as big as possible in the remaining
              space.
        
              Examples:
                angband -mgcu -- -right 30x27,* -bottom *x7 will layout as
        
                Term-0: Map (COLS-30)x(LINES-7) | Term-1: 30x27
                --------------------------------|----------------------
                <----Term-3: (COLS-30)x7------->| Term-2: 30x(LINES-27)
        
                composband -mgcu -- -bottom *x7 -right 30x27,* will layout as
        
                Term-0: Map (COLS-30)x(LINES-7) | Term-2: 30x27
                                                |------------------------------
                                                | Term-3: 30x(LINES-27)
                ---------------------------------------------------------------
                <----------Term-1: (COLS)x7----------------------------------->
        
                Notice the effect on the bottom terminal by specifying its argument
                second or first. Notice the sequence numbers for the various terminals
                as you will have to blindly configure them in the window setup screen.
        
                EDIT: Added support for -left and -top.
            */
        I hope this helps
        One for the Dark Lord on his dark throne
        In the Land of Mordor where the Shadows lie.

        Comment

        • moosferatu
          Apprentice
          • Feb 2020
          • 99

          #5
          Cool! I completely missed that when I checked the code...

          [Edit] Oh, note that "-- -n" must NOT be specified. Otherwise, it will use the auto-configure behavior.

          Comment

          • moosferatu
            Apprentice
            • Feb 2020
            • 99

            #6
            I just played around with it. I don't think I fully understand how it's configured yet, but here's an example large screen (based on a 24" monitor at 1920x1080) setup that has columns on the left and right and a row on the bottom.

            Code:
            ./angband -ssdl -mgcu -- -right 40x27,* -left 40x27,* -bottom *x10
            And the window configuration:

            Code:
            #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=# begin Dump window settings
            # *Warning!*  The lines below are an automatic dump.
            # Don't edit them; changes will be deleted and replaced automatically.
            
            # Options
            
            # Window 'Term-1', Flag 'Display monster list'
            window:1:10:1
            
            # Window 'Term-2', Flag 'Display item list'
            window:2:12:1
            
            # Window 'Term-3', Flag 'Display inven/equip'
            window:3:0:1
            
            # Window 'Term-4', Flag 'Display equip/inven'
            window:4:1:1
            
            # Window 'Term-5', Flag 'Display messages'
            window:5:6:1
            
            
            # *Warning!*  The lines above are an automatic dump.
            # Don't edit them; changes will be deleted and replaced automatically.
            #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=# end Dump window settings

            Comment

            • Tungwe
              Rookie
              • Jun 2020
              • 7

              #7
              Thanks everyone for the advice!

              I tried the SDL2 frontend, but couldn't get any sound there. Also I have a strange issue with the SDL2 frontend where the game window is very small, and the rest of the screen is covered by some placeholder images (see attached image).

              Regarding the sound in SDL2, it seems that there is a bug in the package in Gentoo (which is how I installed Angband). When I compile it with `sdl2` enabled and run `angband --help` there is no sound module listed under the line "-s<mod> Use sound module <sys>:". Stange since the package installs dependencies for sound such as sdl2-mixer. Will see if I can find the issue in the build file and report the bug to Gentoo maintainers.

              I tried to recompile it without `sdl2` enabled, but with `sdl` enabled, and `angband --help` now outputs:

              Code:
                -s<mod>        Use sound module <sys>:
                   sdl   SDL_mixer sound module
              and sound works in regular SDL mode, but still a strange resolution.

              Would definitely prefer SDL2 over SDL if I could get these issues fixed since the GUI seems nicer. The terminal mode was used primarily because the resolution worked out of the box and it was simple to change the font/font size, but definitely open to using the SDL(2) version if I can get the resolution (and sound) to work.

              @moosferatu Seems like a good approach. I would really prefer using the package manager for the installation if at all possible though.

              Also will try the -right and -left flags for the terminal version for now and hope someone has hints on how to get a sensible resolution in the SDL/SDL2 version.
              Attached Files

              Comment

              • fph
                Veteran
                • Apr 2009
                • 1030

                #8
                What you see is just a pre-configured default window size that is too small. That pattern is the background of a "virtual desktop" in which you can display terminal subwindows. You can move and resize the main window with the buttons in the top-right corner + your mouse, and display more terms with the buttons in the top-left one. The interface takes a minute to get used to, but anyway you are not going to resize windows too often.

                I'm not sure about what is happening with the sound and I can't help with that, sorry.
                --
                Dive fast, die young, leave a high-CHA corpse.

                Comment

                • moosferatu
                  Apprentice
                  • Feb 2020
                  • 99

                  #9
                  Tungwe, I agree with you, and think the GCU version looks the best. Personally, I use the GCU port without subwindows (also without sound...). All of the content can be accessed within the main window, and I don't like the "clutter" of having the subwindows always visible.

                  I don't know what's going on with your sound. Here's an old thread that I lifted the commands I suggested from:



                  Additionally, here's the development thread for the SDL2 port, which includes some discussion about getting the sound working, but, after a brief skim, it wasn't immediately clear to me if the problems were ever satisfactorily resolved.

                  Comment

                  • Tungwe
                    Rookie
                    • Jun 2020
                    • 7

                    #10
                    Managed to resize the window in SDL the way you suggested fph, thanks!

                    Thank you for the references moosferatu. I read through all the comments related to sound, as well as all commits I could find on the GitHub repo, but wasn't able to find out if they decided sound was working correctly in the SDL2 release... If someone has sound working in SDL2 it would be great to see the output of `angband --help` (in particular the sound module info).

                    Also, I went back to try moosferatu's approach with using the `-ssdl` flag together with the `-mgcu` flag and sounds worked correctly this way! Didn't need to manually convert the files or anything either, just using the default install. This approach should be good enough for me for now!

                    Comment

                    • moosferatu
                      Apprentice
                      • Feb 2020
                      • 99

                      #11
                      @Tungwe, you can use the SDL sound mixer with the SDL2 frontend, if you want.

                      Comment

                      • Tungwe
                        Rookie
                        • Jun 2020
                        • 7

                        #12
                        Thanks for the tip. I guess that confirms there is no sound support in pure SDL2 yet.

                        Unfortunately at the moment the Gentoo package disables the regular SDL version when SDL2 is enabled. Will report it as a bug to them when I get the time.

                        Comment

                        • Nick
                          Vanilla maintainer
                          • Apr 2007
                          • 9648

                          #13
                          Originally posted by Tungwe
                          Unfortunately at the moment the Gentoo package disables the regular SDL version when SDL2 is enabled. Will report it as a bug to them when I get the time.
                          This happens to me in OpenSUSE as well.
                          One for the Dark Lord on his dark throne
                          In the Land of Mordor where the Shadows lie.

                          Comment

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