calref / cboe

Classic Blades of Exile
http://spiderwebforums.ipbhost.com/index.php?/forum/12-blades-of-exile/
Other
173 stars 42 forks source link

No mouse/keyboard inputs accepted under native Linux build, hangs X11. #183

Open seisatsu opened 6 years ago

seisatsu commented 6 years ago

Hey, so I'm not sure about the general state of Linux support, but I got cboe to compile and run under Linux and X11 on the first try. Unfortunately, once starts it won't accept any mouse clicks or keyboard inputs, including window manager keybinds; since it is fullscreen it essentially hangs X11 at the main menu and I have to switch virtual terminals to kill it.

CelticMinstrel commented 6 years ago

Thinking about it, it's possible this is actually the "dialog appears behind main window" bug... when I first tried it on Linux, I manually forced it to windowed mode by editing the preferences file.

murlock commented 6 years ago

What is your distro please ?

With Xubuntu 17.10, I don't encountered any issue with X11, keyboard or mouse (but I suspect it was false fullscreen as taskbar was still shown)

CelticMinstrel commented 6 years ago

It is indeed false fullscreen (a borderless screen-filling window).

seisatsu commented 6 years ago

@CelticMinstrel Where is the preferences file? I searched but couldn't find such a thing in the build directory. If I put this in windowed mode I might be able to learn some things.

@murlock Woe is you, I am running Void Linux with the i3 window manager. Not a common case to be sure. BoE is capturing keybinds that should be reserved for the window manager (such as the fullscreen switch keybind and the quit keybind), but I don't know the mechanisms behind that. For me it eats my taskbar, though it may be that my window manager has a different mechanism for the kind of fullscreen BoE is putting on.

CelticMinstrel commented 6 years ago

I think the window manager would need to be able to report a false screen size value in order to not cover the taskbar? Not sure.

Linux (and Windows) versions store preferences ~/.oboe/blades prefs.ini if I recall correctly. I think the pref you'd need is something like DisplayMode=6 but I can't quite remember (the value is almost certainly correct, key might be wrong).

The prefs file may also not exist if the game has not yet been run and shut down gracefully. Just create it in this case.

seisatsu commented 6 years ago

@CelticMinstrel the prefs file did not exist, and creating it and adding the line did not work. Can you please confirm the name and contents of your prefs file? I am confused whether you meant to type ~/.oboe/bladesprefs.ini, ~/.oboe/blades/prefs.ini, or if there is literally a space between blades and prefs.ini in the filename, which would be most unfortunate.

If it's in ini format, maybe there is also a section the option needs to go under in the file.

CelticMinstrel commented 6 years ago

Apologies for the misinformation; I was attempting to look through the source on my phone to remind myself of the correct information, and ended up getting confused in part due to the difficulty of viewing source code on the phone. Even the value, the one thing I was so sure about, was incorrect (but the key was correct).

The file is not a true ini format, just hand-rolled key=value data, so there are no sections. So all you need to do is add the line DisplayMode=5 to .oboe/blades/bladesprefs.ini and that should enable windowed mode.

(I don't remember why I had that nested blades directory in there, it seems a bit weird now. Maybe something like just in case some other program decided to use .oboe for something? I dunno.)

seisatsu commented 6 years ago

Results in a window opening with the Spiderweb Software splash for a fraction of a second followed by a crash:

[seisatsu@voidstar Blades of Exile]$ ./Blades\ of\ Exile
"/home/seisatsu/Source/cboe/build.bk/Blades of Exile"
XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":0"
      after 703 requests (703 known processed) with 0 events remaining.
CelticMinstrel commented 6 years ago

*blink* Uhh, I have no clue what that even means... o.o

seisatsu commented 6 years ago

Well, I ran it again and now everything works! The dialog box appeared on top of the main window like it is supposed to, and I was able to close it and open the party creation menu. Unfortunately, after choosing prefab, the Instant Help dialog that popped over the party dialog froze everything. After dragging the windows around a bit, the Instant Help dialog started working again and I was able to click through it, create a party, and start a scenario successfully.

So, it looks like there are still some issues in windowed mode, including crash conditions which occur only some of the time, and temporary freezes on some dialog boxes.

akien-mga commented 6 years ago

I'm having a similar issue on Mageia 6 x86_64, running KDE Plasma 5.12.2 (KWin as window manager), and compiling with clang 3.9.1.

I've seen different things when running the compiled binary several times, as @seisatsu mentions there are occasional crashes on start, or freezes.

Without DisplayMode=5, most of the time I get either this crash:

$ ./Blades\ of\ Exile
"/home/akien/tmp/cboe/build/Blades of Exile"
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
AL lib: (WW) ALCjackBackendFactory_init: jack_client_open() failed, 0x11
AL lib: (WW) alc_initconfig: Failed to initialize backend "jack"
[xcb] Unknown request in queue while dequeuing
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
Blades of Exile: xcb_io.c:165: dequeue_pending_request: Assertion `!xcb_xlib_unknown_req_in_deq' failed.
Abandon (core dumped)

Or the game starts but gets stuck on the splash screen: screenshot_20180405_100050

I couldn't get a stacktrace of the crash yet because when I run it through gdb, it always goes to the splash screen.

Once I got it past the splash screen and to the main menu, and it even managed to popup the info box.

In windowed mode, it seems to work more reliably, I can access the main menu, create a party and start a scenario.

The multi window gameplay will likely be difficult to make convenient on Linux with its wide variety of window managers though (especially on tiling WMs), so it could be nice to have those dialogs kept in the main window as modal dialogs, but I guess the engine might not support that yet, so it would be more a long term improvement.

clort81 commented 4 years ago

Modal dialogs within main window would avoid some windowmanager / xcb / threading / xorg issues. They could improve portability to handhelds as well. But it's not a faithful implementation of Jeff Vogel's original game.

Try the new builds and stop by #openboe on freenode if it's still giving you problems.

clort81 commented 4 years ago

I also get segfaults at the splash screen shown above, approcimately one out of 5 times i run the program on the jetson nano.

clort81 commented 4 years ago

Setting default window mode to 5 in bladesprefs.ini , along with a warning text that fullscreenmode is broken for x,y,z unusual WMs is advised.

CelticMinstrel commented 4 years ago

Default window mode shouldn't be 5 in general, but maybe we can make an exception for Linux…

retropipes commented 4 years ago

We could use simulated full screen mode and disable the WM decorations, by instructing SDL to make a window as big as the monitor it’s on, and setting it on top. Then the WM quirkinesses don’t get in the way... we would need to add custom code for window management, but it would be identical across platforms and thus easier to maintain. Whether this is extended to close and minimize controls is at our discretion.

CelticMinstrel commented 4 years ago

We could use simulated full screen mode and disable the WM decorations

This is exactly what we're doing. I think that mode was necessary in order for the menubar to remain visible on the Mac, though I can't remember; I might've just done it that way because I don't like how going true fullscreen on older computers (ie, current computers of the time) messes with your desktop.