[Gensouband] Terminal size problem on .live server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Cryomaniac
    Swordsman
    • Jan 2022
    • 283

    [Gensouband] Terminal size problem on .live server

    Not sure if I'm posting this in the correct forum, but I don't see any .live specific discussion areas.

    Gensouband on .live is running in a terminal window a bit too small for it; if you pick 'a known resident of Gensoukyou' upon character creation, you'll get prompted to pick the work your character debuted into, but the list gets cut off; the full list goes up to q), the terminal on .live gets cut off at l) (Hidden Star in Four Seasons). On my computer, I'm running it in a 120x38 terminal; would it be possible to make .live output in a larger terminal area as well? Frogcomposband on .live displays in a far bigger columns x rows resolution than this variant.
  • backwardsEric
    Knight
    • Aug 2019
    • 526

    #2
    Angband.live is likely using Gensouband's main-gcu.c as it is, and that fixes the size of the main window at 80 x 24. Changing the sizes in main-gcu.c lines 1317 - 1337 (and also the required minimum size for the terminal window at lines 1208 - 1209) and recompiling on Angband.live would fix that. If you wanted to default the size to 100 x 30 the changed lines for 1317 - 1337 would look like:

    Code:
             case 0: rows = 30;
                cols = 100;
                y = x = 0;
                break;
    
             /* Lower left */
             case 1: rows = LINES - 31;
                cols = 100;
                y = 30;
                x = 0;
                break;
    
             /* Upper right */
    
             case 2: rows = 30;
                cols = COLS - 101;
                y = 0;
                x = 101;
                break;
    
             /* Lower right */
             case 3: rows = LINES - 31;
                cols = COLS - 101;
                y = 30;
                x = 101;
    and those at 1208 - 1209 would look like:

    Code:
       i = ((LINES < 30) || (COLS < 100));
       if (i) quit("Angband needs an 100x30 'curses' screen");
    The other alternative would be to port the terminal layout code from frogcomposband's main-gcu.c to Gensouband.

    Comment

    • Cryomaniac
      Swordsman
      • Jan 2022
      • 283

      #3
      Thanks, got it; I never directly worked with the ported .live version, so this kind of layout quirk would go unnoticed for me

      Comment

      • Cryomaniac
        Swordsman
        • Jan 2022
        • 283

        #4
        Changed gcu terminal resolution to 120x38 (it's the default one for this variant), made the commit with the changes to my git project

        Comment

        • Gwarl
          Administrator
          • Jan 2017
          • 1025

          #5
          Originally posted by backwardsEric
          The other alternative would be to port the terminal layout code from frogcomposband's main-gcu.c to Gensouband.
          This is more or less what I do in most cases although I still think of it as poschengband's main-gcu.c. Especially old variants need more extensive work to go beyond 80x24 but I *think* old Hengband didn't need all that and it should just be main-gcu.c

          Terminal size on .live is calculated based on font size and screen resolution.

          The more pressing issue with Gensouband is the way -uSavefileName behaviour seems to be changed. Angband.live relies on that switch loading a savefile of the given name.

          I should probably take it down for a while until these things can be fixed

          Comment

          • Cryomaniac
            Swordsman
            • Jan 2022
            • 283

            #6
            Understood, I'll try looking into how it works; is it related to how Gensouband now no longer links character name to savefile name?

            Comment

            • Gwarl
              Administrator
              • Jan 2017
              • 1025

              #7
              I don't think so. In most other bands I can have a savefile named Gwarl that I created with '-uGwarl' and access with -'uGwarl' and still name the character Mithrandir.

              -u need to create a savefile if no savefile of that name exists, and load an existing savefile if it does, and that's all it should do.

              Comment

              • Cryomaniac
                Swordsman
                • Jan 2022
                • 283

                #8
                What does it do for you right now in this variant?

                Comment

                • Gwarl
                  Administrator
                  • Jan 2017
                  • 1025

                  #9
                  Asks me to specify a savefile name using the savefile name I already specified on the command line as a default value and if it exists offers me the option to overwrite it with a new one.

                  Comment

                  • Cryomaniac
                    Swordsman
                    • Jan 2022
                    • 283

                    #10
                    Does Windows version support command line arguments? It seems to treat any command line arguments ('-u' and anything similar) as the full savefile name to load, and complains 'Cannot find required file: -uCryomaniac'. Other Angband variants exhibit similar behaviour.

                    Comment

                    • Gwarl
                      Administrator
                      • Jan 2017
                      • 1025

                      #11
                      That's what it's supposed to do but on .live it doesn't. Ubuntu 22.04

                      I can try to fix it myself but I can't say when.

                      Comment

                      • Cryomaniac
                        Swordsman
                        • Jan 2022
                        • 283

                        #12
                        On my Windows build, it tries to directly load the savefile '-uCryomaniac' (-u part treated as a part of the savefile name); I think it's not treating the command line argument the same way as it does for your build.

                        I did look around a bit on my own - it has to do with the part how you're asked to input a savefile name upon character creation being completed, since several characters have fixed initial names you might not want to be automatically used for savefile name. I think -u argument runs into the same logic, which fits with the behaviour you're describing.

                        How does the .live version for other variants choose the character name upon character creation? Is it determined by your username?

                        Comment

                        • Gwarl
                          Administrator
                          • Jan 2017
                          • 1025

                          #13
                          '-u' is for Username but functionally it simply specifies the name of the savefile to either load or create if it does not exist. It's then used as a default placeholder value for character creation but can be changed during the creation process. Angband variants are pretty consistent about this without me having to do anything, which is how angband.live was possible.

                          Comment

                          • Cryomaniac
                            Swordsman
                            • Jan 2022
                            • 283

                            #14
                            The code that asks for savefile name is in the process_player_name function in files.c; as I said, its logic was changed in this variant to accomodate for unique classes with fixed character names. Would adding a precompiler option to restore old behaviour work?

                            Comment

                            • Gwarl
                              Administrator
                              • Jan 2017
                              • 1025

                              #15
                              The last variant to have similar issues was Sil-Q. The solution we came to was to make a new makefile named Makefile.nfe to use on angband.live instead of Makefile.std. A compile flag for autoconf would also work and might be neater.

                              Comment

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