Compiling and playing the ASCII console version in Windows through Cygwin

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • smbhax
    Swordsman
    • Oct 2021
    • 340

    Compiling and playing the ASCII console version in Windows through Cygwin


    Based on reading the official manual https://angband.readthedocs.io/en/la...#native-builds and help on the forum from backwardsEric and Nick : )

    Please note:
    • The steps given here do NOT make a Windows executable of Angband; rather, they make a Cygwin-specific executable of Angband that can only be run through Cygwin: in Windows, you first run Cygwin, then you run this Angband executable through Cygwin
    • The steps below only make the single-window, ncurses ASCII console version of Angband, with its optional integrated "subwindow" terminal areas
    • This process will take at least about 1.2 GB of drive space
    • You can play the latest console versions of Angband and a bunch of variants, without all this bother, right through your web browser at https://angband.live


    1) Cygwin
    1. Download the Cygwin set-up utility: https://www.cygwin.com/setup-x86_64.exe
    2. Run it
      (I installed under a directory of my own (c:\downloaded\cygwin) rather than under Program Files or other Windows dir); I don't know what download "site" is best to select during set-up; I used https://mirrors.sonic.net because it sounded fast 'p', and actually was faster than the two others I tried)
    3. In Setup, get these nine additional packages: clang, make, libncurses++w10, libncurses-devel, automake, autoconf, m4, libtool, git


    2) Angband

    Either
    1. Run Cygwin
    2. In the Cygwin terminal window, enter:

      git clone https://github.com/angband/angband.git

      (That command pulls down the full Angband source code and assets from the Angband source repository into a folder in your Cygwin install directory, /home/angband/ . Now that you've done that, whenever you want to update to the latest code again in the future, you can just enter: "cd angband" followed by "git pull")
    3. (Optional) If you have git installed, Angband will generate the latest version number into a text file named "version" in the root angband folder (where README.md is located) when you compile--but you can edit a custom version number directly into the title screen file /lib/screens/news.txt ; colors for the markup ("Magenta-pink" doesn't work) are listed in /lib/customize/message.prf ; here's an edited example, for instance--I used the most recent Angband daily release number and the full hash of the last commit made for the code from which I compiled (you can get those with "git log -n1" while in /angband/*, or just the former with "git describe"; note that the commit Id is so long if used in the "version" file that it will squeeze out text on the ? and V screens), lowered the tail on the "g" in "Angband" to fit that long version number in, and changed some colors and things (can't change the color of the version number if leaving it as a variable name, you have to hard-code it, it seems):


      As always when customizing files locally, it's advisable to save backup copies. ("git status" from ./angband/src/ will show you all the files in your Angband directories that differ from the repository.)


    3) Compile
    1. Run Cygwin
    2. In the Cygwin terminal window, enter:
      cd angband
    3. If you downloaded the latest Angband source files rather than a tagged release, enter:
      ./autogen.sh
      and wait for it to finish
    4. Enter:
      ./configure --with-no-install
    5. After that finishes, enter:
      make


    4) Set
    1. Click the green/black Cygwin icon in the upper left window corner and select "Options..."
    2. Under "Terminal," set "Type" to "xterm-256color"
    3. Set other settings as you like; I like
      Looks: Cursor: Block; [ ] Blinking (unchecked)
      Text: Font: Consolas, 19pt
      Window: Default size: Columns: 60; Rows: 30; Scrollbar None
    4. After make finishes, exit Cygwin to reset the terminal type by entering:
      exit


    5) Run
    1. Run Cygwin
    2. If necessary for your terminal font and/or window size settings, press Alt+Enter to toggle to full-screen
    3. If you don't use the game's subwindows, run the angband.exe game executable you compiled by entering:
      ./angband/src/angband
    4. For subwindows, run the game by specifying the number of subwindows in the command line, where the -n digit is from 2 to
    5. subwindow count + 1 for main display; I use 3 subwindows, so I do:
      ./angband/src/angband -- -n4
    6. Hopefully, Angband runs!


    Notes:
    • Backspace didn't work for me in-game until I checked the Cygwin terminal's "Backarrow sends ^H" box under "Keys"--and then, since I use the roguelike character set, I had to macro Backspace to do +4, because ^H is Angband's keyboard command for tunnel west http://angband.oook.cz/forum/showthread.php?t=11053
    • If you ran with the subwindow command line option, once you can see your @ character in the game, you can set up the subwindows by pressing = for options, then w (and you can save them for all users by =, s, "user.prf"--thanks Nick)
    • For an even nicer-looking font for Angband, try "Droid Sans Mono"--free download, for instance here https://www.fontsquirrel.com/fonts/droid-sans-mono . It's the default font angband.live uses.
    • The game stores settings in the directory where you installed Cygwin, under /home/[username]/.angband/Angband , and save files in the game folder, under /lib/save/
    • Running from the command line with -? (ie "./angband/src/angband -?") will show you the available command-line options
    • Again, in Windows, you have to run the compiled ./angband/src/angband.exe through Cygwin--if you try to run the angband.exe directly from Windows--by double-clicking it in a Windows Explorer window, for instance--rather than through Cygwin, Angband will abort, with Windows popping up System Error windows saying it couldn't find Cygwin dll files
    • Cygwin setup stores temp files in folders per download site URL in Windows' Downloads folder; these may make later set-up with the same packages faster, but they can also be deleted
    • Angband's last native Windows console version released was 2008's 3.0.9b https://rephial.org/release/3.0.9b , I think
    • In addition to the "-- -n" type command-line suboption to specify subwindow count, Angband also supports PosChengband-style command-line parameters for configuring subwindows; documentation on these can be found in the bottom half of the FrogComposband readme: https://github.com/sulkasormi/frogcomposband#readme ; for instance, to approximate the -- -n4 look but with the subwindow I'll set to messages above the main window rather than below it, I run with "./angband/src/angband -- -right 46x24,* -top *x12"


    For a Cygwin-compiled GCU (ASCII) front end with sound:

    Use Cygwin Setup to get the following additional packages:

    libSDL2-devel
    libSDL2_mixer-devel
    libSDL2_ttf-devel

    cd angband
    ./autogen.sh
    ./configure --with-no-install --enable-sdl2
    make
    cd ..

    If you don't also have the libSDL2_image-devel package installed, you can then simply the game run with

    ./angband/src/angband

    If you do have libSDL2_image-devel installed, Angband's SDL2 front end will be enabled as the default, so you'll need to specify the GCU front end with the -mgcu parameter when running the game, ie

    ./angband/src/angband -mgcu

    (-mgcu comes before "--" parameters, so for instance for my usual subwindows I would do

    ./angband/src/angband -mgcu -- -right 46x24,* -top *x12

    )

    In the game, you'll need "Options Menu > a) User interface options > b) Use sound" set to "yes"; you can do that from the dungeon screen by entering "=aby" --and you may also want to hit "s" to save after that.
    Last edited by smbhax; November 21, 2022, 09:16.
    My Angband videos
  • Pete Mack
    Prophet
    • Apr 2007
    • 6883

    #2
    I just use minGW and curses on Windows. I did not like the X11 port.

    Comment

    • smbhax
      Swordsman
      • Oct 2021
      • 340

      #3
      Originally posted by Pete Mack
      I just use minGW and curses on Windows. I did not like the X11 port.
      I'd shied away from building for Windows because I thought that would only build the graphical stuff (I'd overlooked the ncurses part of the Windows - MSYS2 section in the Angband manual page on compiling), so I'm glad you pointed this out! I was able to compile a Windows console version through MSYS2:
      - MSYS2 download and setup instructions here: https://www.msys2.org/
      - Angband compiling instructions here: https://angband.readthedocs.io/en/la...2-with-mingw64
      - Doesn't load character by default, so run angband.exe with "-uPLAYER" option

      It runs by default in the standard Windows terminal. I really like Cygwin's mintty terminal, for Angband anyway, so I guess I'll just keep using that. (Also, MSYS2 takes about 3.5 times the drive space of Cygwin.)
      Last edited by smbhax; December 25, 2021, 21:32.
      My Angband videos

      Comment

      • smbhax
        Swordsman
        • Oct 2021
        • 340

        #4
        Added an optional step (2d) on setting a custom version number:

        (Optional) If you want to have a custom version number showing on the title screen, put it in a text file named "version" in the root angband folder (where README.md is located)
        My Angband videos

        Comment

        • smbhax
          Swordsman
          • Oct 2021
          • 340

          #5
          Expanded on 2d to include editing the version number directly into the title screen file--because mine was long, and I wanted to change the color. : D

          (And added a note to 4c about hiding the terminal window's scrollbar.)
          Last edited by smbhax; December 20, 2021, 21:37.
          My Angband videos

          Comment

          • smbhax
            Swordsman
            • Oct 2021
            • 340

            #6
            Updated the steps to using the "git" package to pull down and keep up to date the latest source code (vs downloading it manually).
            My Angband videos

            Comment

            • smbhax
              Swordsman
              • Oct 2021
              • 340

              #7
              For a Cygwin-compiled GCU (ASCII) front end with sound:

              Use Cygwin Setup to get the following additional packages:

              libSDL2-devel
              libSDL2_mixer-devel
              libSDL2_ttf-devel

              cd angband
              ./autogen.sh
              ./configure --with-no-install --enable-sdl2
              make
              cd ..

              If you don't also have the libSDL2_image-devel package installed, you can then simply the game run with

              ./angband/src/angband

              If you do have libSDL2_image-devel installed, Angband's SDL2 front end will be enabled as the default, so you'll need to specify the GCU front end with the -mgcu parameter when running the game, ie

              ./angband/src/angband -mgcu

              (-mgcu comes before "--" parameters, so for instance for my usual subwindows I would do

              ./angband/src/angband -mgcu -- -right 46x24,* -top *x12

              )

              In the game, you'll need "Options Menu > a) User interface options > b) Use sound" set to "yes"; you can do that from the dungeon screen by entering "=aby" --and you may also want to hit "s" to save after that.
              Last edited by smbhax; November 21, 2022, 09:16.
              My Angband videos

              Comment

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