X11 forwarding

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Gwarl
    Administrator
    • Jan 2017
    • 1025

    X11 forwarding

    One interesting possibility for network play is the fact that X11 is a network protocol. I've been experimenting with this, I managed to run xclock on my server from a window on my desktop, and as a further proof of concept installed the debian slashem-x11 package and managed to play that (it even spawned child windows). After compiling from source with the gcu and X11 frontends enabled, launching angband over ssh defaults to the X11 frontend - however nothing happens, just a black space in my terminal which I can exit with ctrl+C (i.e. not a crash). Running with -mgcu gets me the gcu frontend running normally.

    Since I could access the slashem X11 frontend without a problem I suspect this is something to do with angband rather than my setup. I noticed I needed client-side x11 libraries to compile - perhaps angband is only targetting a local display? I'm not very knowledgable here. If so, could piping the output or specifying a display be the required fix?

    I'm going to be recreating the server with a browser-based launcher/login system rather than the in-terminal solution dgamelaunch provides and there are x11 libraries available for node.js so if I can get the x11 frontend running over ssh I should be able to get it running in a browser, and we'll have graphical supprt.

    I don't want to touch any of the angband code just yet but if anyone can tell me what isn't working I'll keep it in mind.
  • fph
    Veteran
    • Apr 2009
    • 1030

    #2
    I just tried; I confirm the X11 frontend doesn't work, but (in case that helps) the SDL one (angband -msdl) does the job.
    --
    Dive fast, die young, leave a high-CHA corpse.

    Comment

    • takkaria
      Veteran
      • Apr 2007
      • 1951

      #3
      Originally posted by fph
      I just tried; I confirm the X11 frontend doesn't work, but (in case that helps) the SDL one (angband -msdl) does the job.
      IIRC Angband doesn't support graphics with X11 so you're better off with SDL anyway.
      takkaria whispers something about options. -more-

      Comment

      • t4nk
        Swordsman
        • May 2016
        • 336

        #4
        Hmmm. The command to start angband probably should be something like
        Code:
        angband -mx11 "-d$DISPLAY"
        if I understand main-x11.c correctly (I also forgot how ssh X forwarding works, I guess it should set up DISPLAY automatically?)

        Comment

        • t4nk
          Swordsman
          • May 2016
          • 336

          #5
          Hmmm. The command to start angband probably should be something like
          Code:
          angband -mx11 "-d$DISPLAY"
          if I understand main-x11.c correctly (I also forgot how ssh X forwarding works, I guess it should set up DISPLAY automatically?)

          IIRC Angband doesn't support graphics with X11 so you're better off with SDL anyway.
          And yes, this

          Comment

          • Gwarl
            Administrator
            • Jan 2017
            • 1025

            #6
            Once I'd gotten the correct libraries the sdl frontend worked, mouse inputs and graphics included. It's cool but it's incredibly slow.

            Once I'd figured out how to specify the -m subopt without getting it confused with the -d opts (it's angband "-mx11 -d$DISPLAY") I got the familar
            Code:
            ./angband: Unable to prepare any 'display module'!
            the -x<file> subopt looks interesting.

            Comment

            • t4nk
              Swordsman
              • May 2016
              • 336

              #7
              Ah, right, it should be "angband -mx11 -- -d$DISPLAY", and it should be the DISPLAY on your server... and anyway, I don't think X client (such as it is) is better than ncurses?

              edit: come to think of it, both should work... You know what, just replace line 2554 in main-x11.c with "const char *dpy_name = NULL;"

              Comment

              • Gwarl
                Administrator
                • Jan 2017
                • 1025

                #8
                Yeah, I'm going to go ahead and set things up with the gcu port for now but I thought the possibilities for x11 might be interesting.

                Ideally I'd probably want to slice things up to have a server component just sending data and then have that rendered on the client (I might even be able to compile an existing main-xxx file to run in a browser), but I don't know how that all fits together.

                Comment

                • t4nk
                  Swordsman
                  • May 2016
                  • 336

                  #9
                  You mean like Dungeon Crawl's webtiles?

                  Comment

                  • Gwarl
                    Administrator
                    • Jan 2017
                    • 1025

                    #10
                    Okay I changed that line and recompiled and keep getting the same thing.

                    The same error happens when I try to start with "-mcgu -n2" so I think it's something to do with spawning new windows. I'm going to stop worrying about it though.

                    Comment

                    • Gwarl
                      Administrator
                      • Jan 2017
                      • 1025

                      #11
                      Originally posted by t4nk
                      You mean like Dungeon Crawl's webtiles?
                      Ah, I already set up a service to play angband in a browser a while back, but I ran into difficulties getting all of the features from dgamelaunch working and inexplicable segfaults when trying to use anything but vanilla. I wiped it recently to start again, I'm asking about the x11 stuff because if it had worked and included graphics it would be a cheap way to add support for tiles.

                      Comment

                      • gameplay appreciator
                        Rookie
                        • Feb 2017
                        • 24

                        #12
                        It's not a good idea to allow public access to a X windows server.

                        Comment

                        • Pete Mack
                          Prophet
                          • Apr 2007
                          • 6883

                          #13
                          Originally posted by gameplay appreciator
                          It's not a good idea to allow public access to a X windows server.
                          No lie. They shouldn't even be visible outside a firewall, let alone accessible.

                          Comment

                          • Gwarl
                            Administrator
                            • Jan 2017
                            • 1025

                            #14
                            Looks like the x11 thing is a non-starter, but does anyone know what the problem might be with spawning extra terminals? All of the subopts for -mgcu (i.e. -B) give me the same error

                            unable to prepare any 'display module'

                            I have the gcu ports for angband and poschengband running nicely in the browser (But I'll have to implement a login system before I make it public) but the extra terminals are a massive QoL improvement to playing angband - it should be possible so I want to do it.

                            You can get 'virtual terminals' in V if the main terminal is large enough, but I'd rather have the seperate terminals individually if at all possible.

                            Comment

                            • takkaria
                              Veteran
                              • Apr 2007
                              • 1951

                              #15
                              Originally posted by Gwarl
                              You can get 'virtual terminals' in V if the main terminal is large enough, but I'd rather have the seperate terminals individually if at all possible.
                              If I understand you right, the virtual terminals are all the curses supports. There's no way from inside a piece of software using curses to open new windows - you're just given a single grid of cells to update.
                              takkaria whispers something about options. -more-

                              Comment

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