Author Topic: Avoid the Crashes using WINE  (Read 4450 times)

firiban

  • Traveller
  • *
  • Posts: 27
    • View Profile
Avoid the Crashes using WINE
« on: December 22, 2008, 04:15:24 pm »
Scroll down to the post starting with "Update!" please!



Hi,
as i had a lot of these random client crashes since 0.4.03, i tried to run the windows version of planeshift using wine on top of linux. and it worked! Here are the step by step instructions on how to install it:

If you already have wine installed, you can skip the steps 1-3.

1. Install the latest stable version of WINE using your distro's package manager
2. Install the package cabextract
3. Run WINE's configuration utility 'winecfg', it will create the directory ~/.wine/
4. Go into this directory and execute 'wget http://www.kegel.com/wine/winetricks'
5. Run the command 'sh winetricks vcrun6 vcrun2005 corefonts'. I'm not sure if you need a license of Windows to do this legally! I'm neither sure what exactly the winetricks script does; i didn't write it :P
6. Download and install the Windows version of PlaneShift into wine. To run the installer type 'wine name_of_the_installer.exe' in the directory where you downloaded it.
7. Run your new PlaneShift client: Go to '~./wine/drive_c/Programs/PlaneShift' (or however these directories are called on your PC) and execute 'wine psclient.exe'

You can even symlink your ~/.PlaneShift directory to the Windows version's PlaneShift directory to use the same settings and logs with both clients.

The WINE client runs stable for me, Thob from my guild uses it too. However, we both have a completely transparent GUI under wine. That means, you can't see any window backgrounds and buttons without text. But it doesn't crash ;)

I don't know if that works for everyone, try it ON YOUR OWN RISK!



Firiban
« Last Edit: March 10, 2009, 01:21:00 pm by firiban »
Code: [Select]
    if (brain)
    {
        delete brain;
    }
From PlaneShift's npcclient code.

Pizik

  • Hydlaa Citizen
  • *
  • Posts: 235
    • View Profile
Re: Avoid the Crashes using WINE
« Reply #1 on: December 22, 2008, 05:58:04 pm »
To get yourself a GUI you can give this a go: create a directory under wine_c called something like app_data\planeshift\ and then in psclient.cfg in your root PS directory add the line

Code: [Select]
PlaneShift.UserConfigPath = C:\app_data\planeshift\
Save that file then try running wine pssetup.exe and change the GUI skin from default to something else. I haven't tested this, but give it a try, it may work ;o)
Proceeding through life like a cat without whiskers, perpetually stuck behind the refrigerator.

firiban

  • Traveller
  • *
  • Posts: 27
    • View Profile
Re: Avoid the Crashes using WINE
« Reply #2 on: December 23, 2008, 03:52:27 am »
hm, doesnt work for me. GUI is still transparent, except for the window borders and the text, so it is relatively useable (->better than a crashing client).

pssetup doesn't even display the styles when i select them, so this is propably some kind of "bug" ;)

this just makes planeshift create a new configuration dir, doesn't it?
i already symliked ~/.wine/drive_c/windows/profiles/myuser/Anwendungsdaten/PlaneShift with my ~/.PlaneShift directory, so i can use my linux logs, shortcuts, settings etc.
("Anwendungsdaten" may have a different name depending on your system language)

But thanks anyway Pizik!


Firiban
Code: [Select]
    if (brain)
    {
        delete brain;
    }
From PlaneShift's npcclient code.

Vonor

  • Hydlaa Resident
  • *
  • Posts: 132
  • Languages: English / German
    • View Profile
Re: Avoid the Crashes using WINE
« Reply #3 on: December 23, 2008, 04:30:42 am »
I haven't tested this, but it sounds pretty cool, nice try Firiban :)
Although, you say the linux client crashes for you all the time. I only had this problem with the release client, but since I compiled PS myself (with custom optimization instead of the packages optimization) I hardly have any crashes anymore. You might want to give this a try, it's not that hard :) - but it's something for another topic :P
Quote from: Mordraugion
Quote from: zanzibar
::|  What just happened?

you got Caarried

weltall

  • Moderator
  • Veteran
  • *
  • Posts: 1671
    • View Profile
    • http://weltall.heliohost.org
Re: Avoid the Crashes using WINE
« Reply #4 on: December 23, 2008, 04:52:08 am »
I haven't tested this, but it sounds pretty cool, nice try Firiban :)
Although, you say the linux client crashes for you all the time. I only had this problem with the release client, but since I compiled PS myself (with custom optimization instead of the packages optimization) I hardly have any crashes anymore. You might want to give this a try, it's not that hard :) - but it's something for another topic :P

It seems different gcc versions lead to different results (eg: 4.3.2 never crashes) while the map stuck problem is resolved only with clients built with no optimizations

Vonor

  • Hydlaa Resident
  • *
  • Posts: 132
  • Languages: English / German
    • View Profile
Re: Avoid the Crashes using WINE
« Reply #5 on: December 23, 2008, 06:04:25 am »
It seems different gcc versions lead to different results (eg: 4.3.2 never crashes) while the map stuck problem is resolved only with clients built with no optimizations
I'm using gcc version 4.3.2 (Gentoo 4.3.2 p1.1), tho I have the map stuck issue with my custom optimization too. I kinda don't think it's a PS issue but a CS one

Haven't tried building without any cflags at all, but I might give it a try :)
Quote from: Mordraugion
Quote from: zanzibar
::|  What just happened?

you got Caarried

weltall

  • Moderator
  • Veteran
  • *
  • Posts: 1671
    • View Profile
    • http://weltall.heliohost.org
Re: Avoid the Crashes using WINE
« Reply #6 on: December 23, 2008, 06:07:40 am »
build following the same indications for development build and you will fine for stuck issues

firiban

  • Traveller
  • *
  • Posts: 27
    • View Profile
Re: Avoid the Crashes using WINE
« Reply #7 on: January 02, 2009, 05:54:30 am »
Update!

Yesterday, Fettbemm and I wrote a bash script that installs a perfect PlaneShift client into wine's fake windows. Fettbemm fixed the GUI bug by extracting the skin zip-files into directories with their names, changing/adding some options in the psclient.cfg.

Here is what the script can do for you:
  • Install PlaneShift into WINE
  • Fix the Linux bugs like the gaps between map changes
  • Fix the !leaf-bug that makes many clients crash in random situations
  • Fix the bug that causes you to get stuck in the ojaroad and bdroad maps

The bad things:
  • The script installs some original Microsoft libraries. You need to have a valid license of Windows in order to run the script legally.
  • As emulated applications run slower than native ones, WINE-PlaneShift might run a little slower on your PC than the Linux client.



So, here is how to install it: (on your own risk of cause!)
  • If not already done, install WINE on your system (preferably using your distro's package manager)
  • If you already have a ~/.wine directory, rename it so we can create a new one for PlaneShift.
  • Go to the directory where your Linux PlaneShift client is installed. It should contain for example "psclient" "psupdater" and some folders such as "art".
  • Open a terminal in that directory.
  • Download our script by executing
    wget http://mirror.psde.de/util/psclient_wine/megascript.sh
  • Run it!
    sh ./megascript.sh
  • The script should now start the winecfg configuration panel. Just click "Ok" to proceed.
  • Now, all the art files, i.e. the maps are copied to your WINE PlaneShift client.
  • During the installation you will be prompted whether you want to accept the licenses for vcrun2005 and OpenAL. Of cause you need to accept them in order to install a working WINE client. To be able to see the OpenAL license, you may have to scroll up and down a bit.
  • After the script is finished running, go to ~/.wine/drive_c/Games/PlaneShift and run the command
    wine ./psclient.exe
    to start PlaneShift!
  • You also may want to symlink the directory ~/.wine/drive_c/windows/profiles/yourname/AppData/PlaneShift to ~/.PlaneShift to use the same options and logs with both clients (WINE & native).


Please report any bugs in the script here, or ask for help here if you encounter any problems.
If you don't: Have fun playing!

Thanks to peeg and Sajut from psde.de for uploading our stuff to their mirror!

Firiban
Code: [Select]
    if (brain)
    {
        delete brain;
    }
From PlaneShift's npcclient code.

Elvors

  • Hydlaa Resident
  • *
  • Posts: 53
    • View Profile
Re: Avoid the Crashes using WINE
« Reply #8 on: January 07, 2009, 02:49:35 pm »
Nice work :)

However:

The bad things:
  • The script installs some original Microsoft libraries. You need to have a valid license of Windows in order to run the script legally.

It would be nice to have a list of the libraries, what they are, and a link to their licensing conditions so everybody can check by himself or herself whether a download is legal or not.
I have a strong feeling that these libraries come bundled with many Microsoft applications, so you might be clear if you legally own a copy of, say, MS Word. Or even MS Word Viewer, which comes for free.

The bad things:
  • As emulated applications run slower than native ones, WINE-PlaneShift might run a little slower on your PC than the Linux client.

For OpenGL applications such as PlaneShift, this is usually a non-issue.

Loote

  • Wayfarer
  • *
  • Posts: 2
    • View Profile
Re: Avoid the Crashes using WINE
« Reply #9 on: January 10, 2009, 07:45:22 pm »
Hi there! First, I would like to thank you very much for you work on the script! It makes things much much easier!

Although, I couldn't get it to work properly. I get an error when running the psclient.exe. I've attached a screenshot of the error. It seems like the script finished without a problem though.



Any ideas on what I can do? :)

Loote

  • Wayfarer
  • *
  • Posts: 2
    • View Profile
Re: Avoid the Crashes using WINE
« Reply #10 on: January 10, 2009, 09:12:02 pm »
Okay - I figured out the problem and got it all fixed!

I didn't have cabextract installed, and for some reason the script wasn't working for it. But I downloaded the winetricks shell script and ran that to download the cab's that I needed to successfully run PS in WINE!

Thanks for the guides! I would have gone crazy having to live with all that crashing!

nerdful1

  • Traveller
  • *
  • Posts: 20
    • View Profile
WINE allows perfect play on PCLinux PCLOS system!
« Reply #11 on: January 22, 2009, 10:46:02 am »
First, thanks to the thread creator/s to allow me to finally play PS on my  good Linux systems. NOTE 5.


Here is my realtime breadcrumb trail for PCLOS2007 in an AMD 3.2G athlon64 box and Nvidia video 1G memory. NOTE 4
Installed WINE using synaptic, my package manager. Less than 30 seconds. NOTE 7
Open Yakuake terminal window, getting $ user prompt.
1-21-09 8:33 Navigate to my PS folder where psclient, etc are resident. In my case /opt/PlaneShift.
paste in the script: ($prompt)
wget http://mirror.psde.de/util/psclient_wine/megascript.sh
8:36 run the script: ($ prompt)
sh ./megascript.sh
8:39 (my delay, coffee) selected xp in the popup window.
8:41 accept VCRedist visual c++, openAL. Note 6.

8:43 says completed.
I take a break to type,
Errors in term, etc. see NOTE 1.

Next: Here is where I run into my problem. Not sure if it's the hierarchy of my PCLOS distro, or is common to all Linux.

[After the script is finished running, go to ~/.wine/drive_c/Games/PlaneShift and run the command
wine ./psclient.exe]

I cannot go to ~/.wine/drive_c/Games/PlaneShift. Why? .wine is a HIDDEN folder. As a normal user at a $ prompt, I cannot list, get to, or find the .wine folder. So using what I learned recently in attempting to build PS, and that is changing the ownership of files and folders so a mortal user can get at them. In this case:
continue at 9:10AM.
at the $ prompt: su ENTER, enter my root password
at the # prompt: running as substitute user with root privileges:

chown -R mythtv:mythtv /home/mythtv/.wine

change mythtv to your user name and box name to fit your purpose, or just in some way change your ownership of the .wine folder from owned by root to owned by your user. NOTE 2.
type 'exit' to get back to $ user prompt.
Navigate to  ~/.wine/drive_c/Games/PlaneShift and ENJOY! NOTE 3.
end at 9:11AM.

NOTE 1:
These errors showed up in my terminal window while the script was running the sound is ok and I don't know what the Mozilla error is, but the game runs ok:

 ALSA lib seq_hw.c:457:(snd_seq_hw_open) open /dev/snd/seq failed: No such file or directory
Could not load Mozilla. HTML rendering will be disabled.
wine: '/home/mythtv/.wine' created successfully.
ALSA lib seq_hw.c:457:(snd_seq_hw_open) open /dev/snd/seq failed: No such file or directory

Note 2: I don't know if this compromises security, this box is inside  a local protected network, or if changing ownership of the .wine folder will affect other wine applications.

Note 3. My first step in the wine folder was not to run the game, but right away did: wine ./psupdater.exe
 It then updated itself.

Note 4: Exact box is a virgin Mythic Dragon HTPC V1.0. Innards listed at StormLogic site.

Note 5: Literally years were spent to get my distro to update the repository to 4.0x version, to have it broken almost right away by the CS leaf bug, suffering under Vista just to play, raising fur in IRC chat etc.
     In a matter of minutes, one can have PS running under WINE on their Linux box.
It runs perfectly! Fast and snappy, no transparent window problems etc.
And all graphics look perfect. No white squares, invisible items like I got in Vista.
I tried running into walls, hanging around crowds, it is perfect, and now it seems I can automatically jump over tables and chairs, where I never could before, and no sticking on road to BD or Oja!.
You might even try installing PCLOS if your linux distro does not go as smoothly as mine did for this PS workaround.
I might now try to make a LiveCD of this. Stay tuned.

Note 6. Now, I own many legal windows OS's. I wonder what the minimum legal is. Just own a copy, does it have to be in same box? If so I could install one of my old say W98 pre sp1 licenses, and be perfectly legal.
Ah for the olden days of the Fair Use Act and Home Recording Act. Maybe our new leadership will listen to constituents and won't be run by media tycoons and repeal the DMCA.

Note 7. Don't quite get why the renaming. Is moot in my case I installed fresh WINE.

huop

  • Wayfarer
  • *
  • Posts: 1
    • View Profile
Re: Avoid the Crashes using WINE
« Reply #12 on: January 30, 2009, 10:52:56 pm »
Okay - I figured out the problem and got it all fixed!

I didn't have cabextract installed, and for some reason the script wasn't working for it. But I downloaded the winetricks shell script and ran that to download the cab's that I needed to successfully run PS in WINE!

Thanks for the guides! I would have gone crazy having to live with all that crashing!
It seems I'm getting the EXACT same error you were getting. I'm a bit new to linux, could you tell exactly what you did.
You can't possibly imagine how much this would help me out.  :D

citizen

  • Hydlaa Resident
  • *
  • Posts: 132
    • View Profile
Re: Avoid the Crashes using WINE
« Reply #13 on: February 03, 2009, 12:35:00 pm »
I also get only this runtime error, in the terminal:

fixme:actctx:parse_assembly_elem wrong version for assembly manifest
fixme:actctx:parse_manifest_buffer failed to parse manifest L"C:\\Program Files\\PlaneShift Steel Blue\\Microsoft.VC80.CRT.manifest"
fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.VC80.CRT"

And:
err:module:attach_process_dlls "MSVCR90.dll" failed to initialize, aborting
err:module:LdrInitializeThunk Main exe initialization for L"C:\\Program Files\\PlaneShift Steel Blue\\psclient.exe" failed, status c0000142

Edit: now i recompiled client from source, crashes became very rare, only moving problems remained between cities.
« Last Edit: February 10, 2009, 05:42:56 am by citizen »

bdjnk

  • Wayfarer
  • *
  • Posts: 3
  • Oh look, the underworld, again.
    • View Profile
Re: Avoid the Crashes using WINE
« Reply #14 on: February 09, 2009, 04:00:36 am »
A huge thank you to firiban. You are awesome! Thanks as well to nerdful1, I also run PCLinuxOS and your detailed step by step was very useful; and to Loote, I had the same problem you had and took care of it the way you described. Now I am almost one hundred percent crash free! \\o//

For houp. I can't speak for Loote, but what I did was install cabextract from the repository of my distribution. Then I looked into megascript.sh and manually downloaded winetricks to the pertinent directory made it executable and ran it. (I apologize if this is too cryptic, it is late and I am rushing). This is what megascript does but for some reason it wasn't working running automatically, even after cabextract was installed. Good luck. :)