Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: linux experiment - MW 3e  (Read 2093 times)

urmane

  • Bay Watcher
    • View Profile
linux experiment - MW 3e
« on: August 07, 2013, 11:00:23 am »

(I thought it would be less confusing to start a new thread, as this is not connected to jellsprout's 3a3 linux version)

I tried an experiment, thought you all might find it useful.

I'm excited by 3e, and I thought to myself, maybe I can make MW work on linux by overlaying in the linux libs and executables.  And, you know, it almost works.

I extracted MW, then extracted (without overwriting) the linux DF and dfhack packages to get the libs/executables:

tar --strip-components 1 -xjkf ../../df_34_11_linux.tar.bz2
tar xkzf ../../dfhack-0.34.11-r3-Linux.tar.gz

(the strip-components is so everything isn't written into a df_linux subdirectory, and the "k" prevents overwriting.  I also copied buildingplan.so from my 3a3 hack directory, but don't remember if I put that in or if it was included.)

It starts up with TTF (yay, TTF works!), and I was able to gen a world and embark.  It crashes when trying to "b"uild, but turning off TTF in Settings.exe gets around that (boo, TTF not works!).  There are only two errors that appear on the console or stderr.log:

Code: [Select]
[...]/MW3e/Dwarf Fortress/libs/libstdc++.so.6: version `GLIBCXX_3.4.18' not found (required by [...]/MW3e/Dwarf Fortress/hack/plugins/diggingInvaders.plug.so)
Can't load plugin [...]/MW3e/Dwarf Fortress/hack/plugins/diggingInvaders.plug.so

That one might just be my system (fairly up to date Gentoo).

Code: [Select]
.../MW3e/Dwarf Fortress/hack/scripts/dwarfnameadvanced.lua:82: bad argument #1 to 'randomseed' (number expected, got nil)
stack traceback:
        [C]: in function 'randomseed'
        .../MW3e/Dwarf Fortress/hack/scripts/dwarfnameadvanced.lua:82: in main chunk
        (...tail calls...)
.../MW3e/Dwarf Fortress/hack/scripts/makeworshipper.lua:16: attempt to index global 'args' (a nil value)
stack traceback:
        .../MW3e/Dwarf Fortress/hack/scripts/makeworshipper.lua:16: in main chunk
        (...tail calls...)

That looks like a bug, not sure.

Aside from that, it almost works - I can embark, but most of the hills are composed of grand gems and I think the trees are wonky (looking at them shows a name changing so fast it's unreadable).  Alas, it's not stable and soon crashes.  I suspect MW has updated dfhack libraries ...
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: linux experiment - MW 3e
« Reply #1 on: August 07, 2013, 11:09:01 am »

Open dfhack init, delete makeworshipper. The second error about dwarfnames can be ignored, it doesnt do any harm.

Edit: Oh, and good work. ^^ As soon as you get some positive feedback and it works for other people, I'll add this to the mainpage. :)

I dont know whats up with your trees, but you probably have duplicate raws. Thats easy to fix, check your errorlog.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

urmane

  • Bay Watcher
    • View Profile
Re: linux experiment - MW 3e
« Reply #2 on: August 07, 2013, 12:12:19 pm »

Duplicate raws, that was it - they came with the original.

I have it working now, will run a fort for a bit to see how it goes.  This, in essence, what I did:

mkdir MW3e
cd MW3e
unrar x ../MasterworkDF\ v3e.rar
cd Dwarf\ Fortress
tar --strip-components 1 -xjkf ../../df_34_11_linux.tar.bz2 --exclude raw
tar xkzf ../../dfhack-0.34.11-r3-Linux.tar.gz
cp ../../MasterworkDF_linux\ v3a3/Dwarf\ Fortress/hack/plugins/dwarfmonitor.plug.so ./hack/plugins/

That last to get the dwarfmonitor plugin from my already-installed 3a3 version by jellsprout.

Other linux specifics still apply - I need to copy in an old libpng and libjpeg into stonesense/deplibs, disable TTF, etc.

So far, so good ...
Logged

urmane

  • Bay Watcher
    • View Profile
Re: linux experiment - MW 3e
« Reply #3 on: August 09, 2013, 07:52:47 am »

Status report - it appears to be working well enough per se, although I'm also getting a lot of random crashes.

This is the last backtrace (reformatted spacing from wonky terminal output):

Code: [Select]
*** glibc detected ***
./libs/Dwarf_Fortress: double free or corruption (!prev): 0x8a2c49f8 ***
======= Backtrace: =========
/lib/libc.so.6(+0x73d11)[0xb73b6d11]
/home/urmane/games/Dwarf Fortress/MW3e/Dwarf Fortress/libs/libstdc++.so.6(_ZdlPv+0x21)[0xb75b4061]
./hack/libdfhack.so(_ZN6DFHack3Job15deleteJobStructEPN2df3jobE+0x193)[0xb7e07a73]
./hack/libdfhack.so(+0x39c114)[0xb7dfa114]
./hack/libdfhack.so(_ZN6DFHack4Core8onUpdateERNS_13color_ostreamE+0x22)[0xb7bfef52]
./hack/libdfhack.so(_ZN6DFHack4Core8doUpdateERNS_13color_ostreamEb+0x18f)[0xb7bff4ef]
./hack/libdfhack.so(_ZN6DFHack4Core6UpdateEv+0x186)[0xb7c092d6]
./hack/libdfhack.so(SDL_NumJoysticks+0x33)[0xb7e2e863]
/home/urmane/games/Dwarf Fortress/MW3e/Dwarf Fortress/libs/libgraphics.so(_ZN9enablerst10async_loopEv+0xe1)[0xb76222e1]

Maybe that "DFHack Job deleteJobStruct" ?

Nothing useful in errorlog or stderr.log, or any other log :(
Logged

hickop

  • Escaped Lunatic
    • View Profile
Re: linux experiment - MW 3e
« Reply #4 on: August 14, 2013, 04:15:48 am »

I tried your setup, game seams to work with old font (truetype) but new one will crash on "b"uild, even on vanilla df.
Also I can't see any of the standard animals at embark (dogs, cats, etc).
I'm running on Archlinux.
I removed all libs and linked only /opt/df_linux/libs/libgraphics.so (provided by dwarffortress package) and /usr/lib32/libpng.so.
This looks promising, and I hope we could play latest Masterwork DF on linux someday. Windows version on wine freeze when generating world :/
Logged

lechium

  • Bay Watcher
    • View Profile
Re: linux experiment - MW 3e
« Reply #5 on: August 21, 2013, 06:58:01 pm »

Any updates?
Logged

urmane

  • Bay Watcher
    • View Profile
Re: linux experiment - MW 3e
« Reply #6 on: August 22, 2013, 09:44:40 am »

Yes, 3f appears to work with the same process.  I'm able to play just fine but still have the same random crashes everyone else does with 3f.

Summary - do this:

Put 3f, original linux DF, and linux dfhack tarballs into one directory
mkdir MW3f
cd MW3f
unrar x ../MasterworkDF\ v3f.rar
cd Dwarf\ Fortress
tar --strip-components 1 -xjkf ../../df_34_11_linux.tar.bz2 --exclude raw
tar xkzf ../../dfhack-0.34.11-r3-Linux.tar.gz
cp ../../MasterworkDF_linux\ v3a3/Dwarf\ Fortress/hack/plugins/dwarfmonitor.plug.so ./hack/plugins/

(That last to get the dwarfmonitor plugin from my already-installed 3a3 version by jellsprout.)

Copy old libjpeg and libpng into stonesense/deplibs
Change dfhack: export LD_LIBRARY_PATH="./stonesense/deplibs":"./hack":$LD_LIBRARY_PATH
cd ..
wine Settings.exe
Turn off full screen, turn off TTF, change font to Old Font, change Tileset to Phoebus
(Those are all required for me - TTF crashes in many places, the MW font/tileset has lots of bad sprites on linux)
Optional: turn off harder farming/smelting/etc.  Do this *after* changing the Tileset!
Control-C or Control-Z out of wine
cd Dwarf\ Fortress
./dfhack
run Dwarf Therapist from jellsprout's 3a3 directory
Logged

jellsprout

  • Bay Watcher
    • View Profile
Re: linux experiment - MW 3e
« Reply #7 on: August 25, 2013, 09:00:46 am »

I have been busy with finishing my Bachelor's degree these past months, so I haven't really had time to update the Linux Masterwork version. And the one time I did assemble a new Linux version, Meph released a new MW version just when I was about to test it.
If you are able to take this over, it would be great.

To make sure you won't have to find out all the old bugs over again, here are the problems I had when porting over MW to Linux:

1. Reagent quantities in reactions work differently in Windows and Linux. One metal bar has a quantity of 150. In Windows if you do a reaction which uses a metal bar of quantity 1, the reaction consumes the entire bar. In Linux, it consumes only 1/150th of the bar.
This is seen in the crate and slag reactions. All these reactions need to be run 150 times before the crate/slag is fully consumed, while it still creates the product every time you run the reaction. The crate reactions are easily fixed. Simply multiply the reagent quantity by 150.
The slag reactions are not so easily fixed. Metal slag bars are created in the vanilla smelting reactions, while tool slag bars are created in all custom metal reactions. The first need the quantity to be multiplied by 150 to work properly, the second needs the quantity to remain as it is. How I fixed this was by doubling the number of slag reactions: one for metal slag bars, the second for the massive tool slag bars.

2. The files in the "./hack/ruby/" folder are slightly different between Windows and Linux versions of DFHack. So while you need the Masterwork scripts for most of DFHack, you will need to keep the Linux version of this folder. If you don't the game could crash at times. One situation we found was when building a windmill and then saving/exiting the game. The game would crash when loading the map.

3. TTF crashes Linux. But I see you've already realized that. Just don't use it ever.

There are also some problems with the utilities. Most of them work fine with Wine or have a Linux version already packed in. The main exception is Dwarf Therapist, which you will need to download or build yourself.

I think those are all the problems. Everything else is the same under Windows or has already been fixed in the standard download.
Logged
"Having been equipped with tracking collars so their migration and survival in the wild can be measured, the young Sea Serpent is released into the wild.  It is hoped that this captive breeding program will boost their terribly low population numbers and eventually see them removed from the endangered species list..."

urmane

  • Bay Watcher
    • View Profile
Re: linux experiment - MW 3e
« Reply #8 on: August 26, 2013, 07:03:20 am »

Concentrate on your degree - that's far more important.  We'll stumble along :)

Not sure I have the skillset you do with all of this, but I will do what I can.  The dfhack comment is very good - I'm still getting crashes in 3g, so I'll look there.

[DFHack]# *** glibc detected *** ./libs/Dwarf_Fortress: corrupted double-linked list: 0x9852a7c0 ***

Logged

jellsprout

  • Bay Watcher
    • View Profile
Re: linux experiment - MW 3e
« Reply #9 on: August 27, 2013, 06:14:42 am »

I tried assembling my own Masterwork 3g version for Linux in pretty much the same way you've done. Basically I took the v3g Windows download, replaced the Dwarf Fortress directory with the v3a3 directory, then replaced the raws, data, hack and soundsense directories back in, replaced the ./hack/ruby from v3a3 again back in, made a few quantity changes to the raws and replaced the Windows Dwarf Therapist with the Linux Therapist.

Code: [Select]
[...]/MW3e/Dwarf Fortress/libs/libstdc++.so.6: version `GLIBCXX_3.4.18' not found (required by [...]/MW3e/Dwarf Fortress/hack/plugins/diggingInvaders.plug.so)
Can't load plugin [...]/MW3e/Dwarf Fortress/hack/plugins/diggingInvaders.plug.so

That one might just be my system (fairly up to date Gentoo).

I got this exact same error on Ubuntu 13.04 32-bit, so I think it is a problem with DFHack. I'll try to assemble a fresh DFHack folder from this forum containing the same scripts and see if it still gives the same problems.

I also tried to gen two worlds. The first I accidentally generated without DFHack. This one generated fine, but about one month after embark the game crashed. It would always keep crashing around this time.
The second world I tried to generate with DFHack on, but this one crashed before I completed the gen. Neither gave any errors in any console or errorlog.
I'll download the DFHack scripts separately and try again.
Logged
"Having been equipped with tracking collars so their migration and survival in the wild can be measured, the young Sea Serpent is released into the wild.  It is hoped that this captive breeding program will boost their terribly low population numbers and eventually see them removed from the endangered species list..."

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: linux experiment - MW 3e
« Reply #10 on: August 27, 2013, 06:32:16 am »

diggingInvaders.plug.so is in beta states and done by expwnent. Its not intended for mac/linux use and unfinished. Its not even enabled by default, its just included for people that want to try it out.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

urmane

  • Bay Watcher
    • View Profile
Re: linux experiment - MW 3e
« Reply #11 on: August 29, 2013, 10:36:34 am »

Excitedly, I'm running the 3g-Patched version ... but still seeing crashes :(   I have a save that crashes as soon as it's unpaused:
*** glibc detected *** ./libs/Dwarf_Fortress: corrupted double-linked list: 0x986e8b20 ***

One thing I can see that looks odd is that the Carpenter's Workshop has my woodworker working on "Construct unknown material Bin/R", but view job says "wood logs" ....
Logged

jellsprout

  • Bay Watcher
    • View Profile
Re: linux experiment - MW 3e
« Reply #12 on: August 29, 2013, 12:38:01 pm »

Try removing half the DFHack scripts and see if the crash still occurs. If it does, continue removing half of the remaining scripts, if it doesn't, put back half the removed scripts. Repeat this until you figure out which script(s) cause the crash.
If you can upload the save I can help you with that.
Logged
"Having been equipped with tracking collars so their migration and survival in the wild can be measured, the young Sea Serpent is released into the wild.  It is hoped that this captive breeding program will boost their terribly low population numbers and eventually see them removed from the endangered species list..."