mifki / df-twbt

Text Will Be Text
192 stars 30 forks source link

Setting [PRINT_MODE:TWBT] simply causes silent failure #32

Open insanemal opened 9 years ago

insanemal commented 9 years ago

I have Linux. DF works df_hack works. Install TWBT into ./hack/plugins directory edit ./data/init/init.txt set Print mode as per instructions. run ./df_hack drops to console, no errors Reading strace output doesn't seem to reveal anything useful.

pronvit commented 9 years ago

It should log any errors (in fact, all messages) to stderr.log

paulbdavis commented 8 years ago

I am on Linux as well, and while it does not fail silently, I get the folowing on the console where dfhack was run

dfhack: line 43:   314 Segmentation fault      (core dumped) setarch i386 -R env LD_PRELOAD="$PRELOAD_LIB" ./libs/Dwarf_Fortress "$@"

And this in stderr.log

dfhack: hooking successful
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
The program 'Dwarf_Fortress' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
  (Details: serial 36 error_code 3 request_code 155 minor_code 4)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

This is on 64-bit Arch Linux (using the dwarffortress package from the multilib repository and dfhack from the AUR)

pronvit commented 8 years ago

@paulbdavis Does the normal [PRINT_MODE:STANDARD] work?

paulbdavis commented 8 years ago

@pronvit It does not, same error as with [PRINT_MODE:TWBT]

lethosor commented 8 years ago

What about PRINT_MODE:2D? (That's the default, by the way, not STANDARD)

pronvit commented 8 years ago

@paulbdavis Yep, if 2D works, but not STANDARD/TWBT, then it's something with your OpenGL drivers/configuration/etc.

alextes commented 8 years ago

Yea Arch gives a few issues. I figured it out and wrote down the steps somewhere. Let me know if you still need them. I'll need to do some digging. Main thing was removing a bunch of included libs so you end up using your Arch ones instead, and using the native libpng. I basically made the libs folder like it does when you install the package from multilib.

paulbdavis commented 8 years ago

See if you can find what you did. Maybe we can get some fixes into the AUR package for dfhack to enable this.

alextes commented 8 years ago

Right. Firstly I'll have to apologize for not reading more carefully. You are using the aur packages, I was not. Still I can perhaps offer some help since I can get the setup you're looking for working on my machine, and the aur dfhack package uses the repo as source just like I do.

I tried to use the packages, downgrading the dwarffortess package to 40_24, but the dfhack package complains about libs not being in order so I'd rather not spent a lot of time fighting the build system if it works fine using the same files, and doing things manually.

This is how I get things to work:

  1. Get the dwarffortress package from multilib (I'm quite sure 'dwarf_fortress_unfuck' would suffice too, as you only need the package for its libgraphics.so)
  2. Get:
  3. Extract the df package. Remove from the libs/ folder 'libstdc++.so.6', 'libgraphics.so', 'libgcc_s.so.1'.
  4. Copy the 'libgraphics.so' lib from the dwarffortress package (/opt/dwarffortress) or from dwarf_fortress_unfuck.
  5. Extract DFHack, extract TWBT plugins into the hack/plugins/ folder.

My output is

Gtk-Message: Failed to load module "canberra-gtk-module"
Sound devices available:
OpenAL Soft
Picking OpenAL Soft. If your desired device was missing, make sure you have the appropriate 32-bit libraries installed. If you wanted a different device, configure ~/.openalrc appropriately.
Initializing OpenAL failed, no sound will be played
Loading bindings from data/init/interface.txt
Resetting textures
Warning: Plugin mousequery compiled for DFHack 0.40.24-r4-55-g3330225, running DFHack v0.40.24-r5-0-g3330225
Warning: Plugin twbt compiled for DFHack 0.40.24-r4-55-g3330225, running DFHack v0.40.24-r5-0-g3330225
TWBT: version 5.50
TWBT: no display patch (not an error)
reshape_graphics
Warning: Plugin resume compiled for DFHack 0.40.24-r4-55-g3330225, running DFHack v0.40.24-r5-0-g3330225
Can't load plugin stonesense
Warning: Plugin automaterial compiled for DFHack 0.40.24-r4-55-g3330225, running DFHack v0.40.24-r5-0-g3330225

The dfhack.init configuration file is missing. To customize
your DFHack installation, rename the dfhack.init-example file
to dfhack.init and edit it to suit your needs.

For now, dfhack.init-example will be used instead.

reshape_graphics
DFHack is ready. Have a nice day!
DFHack version 0.40.24-r5 (release)
Type in '?' or 'help' for general help, 'ls' to see all commands.

And using the AutoReiv tileset everything works with graphics.

As a final note. The dwarffortress package does some weird things creating a local dir in your home directory that links back to /opt/dwarffortress for libs and raw. I thought I couldn't do the above whilst using the dwarffortress package as a base instead of df_40_24 directly from bay12games, but I just tried and it works just fine too! The only difference is that you extract everything but the 'raw' folder from the tileset into /home/user/.dwarffortress, and the tileset's 'raw' folder into /opt/dwarfortress. You can then both run the package or run dfhack from /home/user/.dwarffortress/dfhack.

So in conclusion, I think the only thing that's causing you trouble is something to do with the libs. Unfortunately I do not know what the dfhack package does exactly and have no time to go have fun with it. Hope all this helps someway!

igoralmeida commented 8 years ago

I had a similar problem as @paulbdavis ' initial comment, and stderr.log showed that libgl had a problem loading radeonsi_dri or something before mentioning the "BadWindow" part. It was enough to replace the original libstdc++.so.6 with a symlink to the one in /usr/lib32/. FYI, I'm on arch as well, and eventually gave up trying to get the /opt/+$HOME symlinking thing to work, and just ran dfhack straight from my extracted df_linux. While I had to install lib32-libpng and lib32-libjpeg6-turbo (for stonesense), there was no need to mess with anything else in df_linux/libs IIRC.