Jump to content


Photo

Qwinn is retire?


  • Please log in to reply
99 replies to this topic

#41 -i30817-

-i30817-
  • Guest

Posted 22 May 2011 - 09:33 AM

BTW, thanks to whoever mentioned emulating the sound drivers, to prevent all movies from hanging (it didn't always occur to me, but sometimes that was really annoying).
Anyway, I haven't found any explanation of wine audio hardware emulation. Can it have problems with other applications? Do you know if there's a way to set sound emulation in the wine command which calls a single program, instead of setting it for wine in general? I mean, I've seen that you can emulate a desktop by running, for instance,

wine explorer /desktop=Planescape:Torment,1280x943 torment.exe
Is there a way to change sound options for that particular program through command line?



Yes. I dont even install games anymore in wine. Most of them i have zipped on my harddrive. I delete the ~/.wine dir often.

Anyway the process i use is to have a shell (.sh) executable file putting in the commands i need to make it work. Sometimes i add some game specific registry settings like the game dir to morrowind (so it can be portable) or the resolution in vampire the masquerade bloodlines, etc).

I keep this file in a folder before the game itself so it's easy to find when i unzip the game. Like so:
-Torment
-Torment.sh (turn executable)
-Torment (real game folder, fully official patched with a no-cd too)
I keep the non-official patches outside to patch when i unzip (since they are always changing anyway)

In the case of torment the file is:

#!/bin/bash
GAME_PATH=$(dirname "$(readlink -f "$0")")
cd "$GAME_PATH/Torment"
#bug on wine sound with torment
wine reg add "HKCU\\Software\\Wine\\Appdefaults\\Torment.exe\\DirectSound" /v "HardwareAcceleration" /t REG_SZ /d "Emulation"
#bug with resolutions and movies on torment - only works on virtual desktop, but without the resolution mod, it won't fil
#the screen, so i change and restore the resolution - if you use the resolution mod to set it to your habitual desktop
#resolution you don't need to change the normal resolution.

#set normal resolution to game resolution
xrandr -s 640x480

#set a virtual destop for the game (only) on the game resolution
wine reg add "HKCU\\Software\\Wine\\Appdefaults\\Torment.exe\\Explorer" /v "Desktop" /t REG_SZ /d "Torment.exe"
wine reg add "HKCU\\Software\\Wine\\Explorer\\Desktops" /v "Torment.exe" /t REG_SZ /d "640x480"

#run the game and restore the normal resolution after
wine "Torment.exe" && xrandr -s 1024x768

As you can see, in Torment, it's a fiddly process.

Do you see that HKCU\\Software\\Wine\\Appdefaults\\Torment.exe\\ part? You can use that kind of structure to set up most normal wine specific registry keys that you find on the wine wiki, but specific to a exe name so it doesn't affect other games.

This is just how i do it, you may prefer to use different prefixes to play different games, etc.



BTW something i just thought. Can you check if the file after patching in 32 bits and 64 bits (in linux and windows i guess) is the same?

#42 Turambar

Turambar
  • Modder
  • 935 posts

Posted 22 May 2011 - 10:35 AM

Thanks for your tips, although the widescreen removes the need to change current resolution.

BTW something i just thought. Can you check if the file after patching in 32 bits and 64 bits (in linux and windows i guess) is the same?

My exe is different between win and linux, but, looking at backups, I noticed that the difference only comes from widescreen mod and ghostdog's ui (as I have different resolutions).
The fixpack directly applies a binary patch (actually, a series of patches, as it contains many different fixes) to the executable (it just replaces the first string listed here with the second one, without checking anything else), so, as the mod is the same, it will alter the bytes in the same way, on all OSs.

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#43 aqrit

aqrit
  • Member
  • 132 posts

Posted 23 May 2011 - 12:03 AM

Pst-Fix 4g. causes a crash when a movie plays with x64 wine
I'm fairly confident that just nopping the bad cmp statement will fix everything.
So do a search and replace in the file "PST-Fix\tph\EngineFixes.tph"
find all:          83 F8 02 3B C2 0F 84
replace all with:  83 F8 02 90 90 0F 84
save the file then (re)run Setup-PST-Fix.exe


I still don't have a test case...
What are good ways to modify the Current and Max Morales in-game?
I'm now guessing that my morale stayed at 10 after resting because its a new game and I haven't done any adventuring yet.

The current morale was hard coded to reset to 10 in the original version.

Have fun.

#44 -Felipe-

-Felipe-
  • Guest

Posted 23 May 2011 - 06:36 AM

aqrt, ever thought of being one of fixpack/UB/tweaks coders? :D

#45 Turambar

Turambar
  • Modder
  • 935 posts

Posted 23 May 2011 - 07:18 AM

Pst-Fix 4g. causes a crash when a movie plays with x64 wine

Not just playing the rest movie: it also happens when you travel through the worldmap, because the morale has to be set (as eight hours have passed). It does not happen with other videos, from what I've seen.
Examples: travelling to Baator from outlands-> the movie is shown; the game is regular afterwards.
Resting-> video plays; as soon as you end it or the video ends, hang
Travel through worldmap (which lasts 8 game hours)-> the area almost loads, then hangs
Resting in foundry: no movie shown; when you close the shop window, hang!
Disabling patch 4g removes hangs, but causes morale to be reset.

I'm fairly confident that just nopping the bad cmp statement will fix everything.
So do a search and replace in the file "PST-Fix\tph\EngineFixes.tph"

find all:          83 F8 02 3B C2 0F 84
replace all with:  83 F8 02 90 90 0F 84
save the file then (re)run Setup-PST-Fix.exe


I still don't have a test case...
What are good ways to modify the Current and Max Morales in-game?
I'm now guessing that my morale stayed at 10 after resting because its a new game and I haven't done any adventuring yet.

The current morale was hard coded to reset to 10 in the original version.

Have fun.

Actually, I think that the maximum morale (which is the one displayed on the character sheet, and depends on party interaction) should have been reset in the original version, and that's why the fix was written.
I will try that fix now; I'll tell you if I manage to rest.

edit: unfortunately, the problem appears to be somewhere else. The game still hangs after resting.

Edited by Turambar, 23 May 2011 - 07:37 AM.

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#46 aqrit

aqrit
  • Member
  • 132 posts

Posted 23 May 2011 - 08:17 AM

That change allows me to rest without the hang occurring.
Please double check to make sure that the patch was applied.
( there should be 2 instances to replace in EngineFixes.tph, the first instance is just a comment )
( you could check out the Exe file with a hex editor, if your ambitious. (4-cd) file offset 00337AD1 should be "90 90", not "3B C2" or "0D 6D")

Edited by aqrit, 23 May 2011 - 08:22 AM.


#47 Turambar

Turambar
  • Modder
  • 935 posts

Posted 23 May 2011 - 12:47 PM

That change allows me to rest without the hang occurring.
Please double check to make sure that the patch was applied.
( there should be 2 instances to replace in EngineFixes.tph, the first instance is just a comment )
( you could check out the Exe file with a hex editor, if your ambitious. (4-cd) file offset 00337AD1 should be "90 90", not "3B C2" or "0D 6D")

I have checked it with a hex editor. The patch has been applied, and the two offsets are both 90 (actually, 0x90, I guess? Anyway, 90=0x5A didn't work either).
But the game still hangs, whereas, as I said, Not applying the patch allows me to rest without hanging but resets the morale.

Anyway, (as I said, I don't know assembly or machine language, so I could just be talking nonsense, and I don't know how much can be understood from a binary code), can you see if there are references to some particular memory addresses, which are changed, in the original string or the fixpack string? do they refer to different addresses? The same variable shuld also be used in the "scale of souls" tweak, as that tweak displays the maximum morale on the character's sheet. Perhaps, could that allow us to discover where the morale is stored..?
Actually, I wonder wether this fix really corrected the variable which had to be modified, or wether it just 'jammed' the triggers for the reset, so that they always evaluated to false and the (wrong) reset could never occur (which could be the reason why there were those CMPs you mentioned, which could never evaluate to true)

BTW, if you need it, I'm using linux x86_64 (AMD64 architecture), with wine 1.3.20 (it should be the latest, from wine ppa) from ubuntu repositories

edit: the same issue is present on linux 32 bit, and unfortunately your patch does not work there either

Edited by Turambar, 24 May 2011 - 07:14 AM.

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#48 -i30817-

-i30817-
  • Guest

Posted 24 May 2011 - 07:17 AM

Check if the original file offsets are the same as the offsets he gave for the original file. Using a dissasembler sometimes, the offsets count not from the start of the file but some kind pointer because of the executable format launcher. As 90 assembly instruction is quite common ( it's NOP ), it might have already been 90.

#49 Turambar

Turambar
  • Modder
  • 935 posts

Posted 24 May 2011 - 07:41 AM

Check if the original file offsets are the same as the offsets he gave for the original file. Using a dissasembler sometimes, the offsets count not from the start of the file but some kind pointer because of the executable format launcher. As 90 assembly instruction is quite common ( it's NOP ), it might have already been 90.

I did check the string both in the tph, before applying it, and in the exe, after it was patched, with a hex editor.
All bytes around the two "90"s were those expected.

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#50 -i30817-

-i30817-
  • Guest

Posted 24 May 2011 - 11:27 AM

I sent contacted scient in the civilization gaming network forums. Here is what he said:

Quote:
Originally Posted by i30817
This thread: http://www.shsforums...winn-is-retire/ has detected a bug in the morale function in the bugfix patch that crashes the game in linux wine 64 bits.


Hmm ok, I guess I'd have to set up a VM of linux to test this out and track down problematic code. Also, I'd have to get in contact with Qwinn (I dunno if he's still around anymore) because I never dealt with installer stuff. This won't happen for a number of months, I'm caught up with working on SMAC/X stuff right now and my summer semester is going to be starting shortly. But I will make a note to myself as something to look into as well as read through SHS for any other problems that have risen since last patch release. Thank you for bring this to my attention.


If qwinn is MIA forever i guess some volunteer that knows WEIDU could volunteer to edit the installer.

#51 Turambar

Turambar
  • Modder
  • 935 posts

Posted 24 May 2011 - 01:10 PM

I sent contacted scient in the civilization gaming network forums. Here is what he said...

Thanks! It's such a pity, such a wonderful game, so beautiful mods, and just that nasty bug which makes it difficult to play it on linux...
Thanks for contacting him!

If qwinn is MIA forever i guess some volunteer that knows WEIDU could volunteer to edit the installer.

If you need it, I think I might be able to help with that

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#52 -i30817-

-i30817-
  • Guest

Posted 25 May 2011 - 04:15 PM

Guess now someone will have to.

I'm going to send another private message to scient about Qwinn.

#53 Turambar

Turambar
  • Modder
  • 935 posts

Posted 07 June 2011 - 05:05 AM

Guess now someone will have to.

I'm going to send another private message to scient about Qwinn.

Apparently, that message about Quinn was luckily only a troll.

Anyway, until it gets fixed, could someone please tell me if it's possible, and how, to compile a separate version of wine, without the optimizations which cause issues, to be only used with PS:T (I would just put it into my home folder; use a shell script to run that particular wine binary when I launch ps:t, and leave in the usr folder the wine version from wine ppa)? I'm using kubuntu natty AMD64.

Edited by Turambar, 07 June 2011 - 05:06 AM.

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#54 i30817

i30817
  • Member
  • 611 posts

Posted 20 June 2011 - 01:41 PM

Ĩ'm not sure it is the optimizations that cause the issue: it looks like they simply don't avoid it somehow.

If aqrit makes a patcher i guess we could check it.

#55 i30817

i30817
  • Member
  • 611 posts

Posted 23 June 2011 - 07:53 AM

Interresting.

The fix worked if i edited the exe after installing the fixpack.

Maybe one of the other tweakpack exe edits moves things around and interferes if i tried to install it after that.

Edit actually, i tested it now.

It has nothing to do with the other packs; the fix allows me to rest by using the rest button (first opportunnity is in the tomb where you escape from the mortuary if you take the portal), but still hangs if you use the dialog rest opportunities, like mcbeth or Arlo's inn in a adjacent map.

Edited by i30817, 23 June 2011 - 08:33 AM.


#56 -maluco-

-maluco-
  • Guest

Posted 23 June 2011 - 06:59 PM

Same bug for me, couldnt get it to work.
Tried to compile like paulo, without success, not with gcc4.5 nor 4.4.

When I remove the patches everything's fine. Sucks, just want to play the game :(

How can I delete the 4g patch?

#57 -maluco-

-maluco-
  • Guest

Posted 23 June 2011 - 08:20 PM

Tried to replace 83 F8 02 3B C2 0F 84 with 83 F8 02 90 90 0F 84, didnt worked either.

Still, resting only works without the patches.

#58 Turambar

Turambar
  • Modder
  • 935 posts

Posted 24 June 2011 - 06:51 AM

How can I delete the 4g patch?

You can remove that particular patch by editing [game folder]/pst-fix/tph/enginefixes.tph

Look for 4g. You will see a set of instructions, ending with
LAUNCH_PATCH_MACRO Q_Pattern_Maker
  LAUNCH_PATCH_MACRO Q_Engine_Patcher
Then, there's a space and a line which contains 4h...

Just encolse that code between /* and */ (like C comments):
/*  LAUNCH_PATCH_MACRO Q_Pattern_Maker
  LAUNCH_PATCH_MACRO Q_Engine_Patcher
*/
The effect will be: you will be able to rest. But the morale will be reset every time (so, eg, Da'kkon's blade will rarely improve,...), which was the original issue.
Anyway, all other patches will be installed.

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#59 -Felipe-

-Felipe-
  • Guest

Posted 24 June 2011 - 07:08 AM

The effect will be: you will be able to rest. But the morale will be reset every time (so, eg, Da'kkon's blade will rarely improve,...), which was the original issue.
Anyway, all other patches will be installed.


that's a bad problem, time to scient go back from the dead too. :P

(not wanting to low your esteem with my statement, i'm thankful for all your work here, i'm saying this because the dude is an engine guru of sorts, he knows how to use this http://ollydbg.de/ to improve Planescape, what i wish the fallout 2 unofficial patch guys had the same knowledge.) ;)

#60 -maluco-

-maluco-
  • Guest

Posted 24 June 2011 - 11:25 AM

I thought:
find all: 83 F8 02 3B C2 0F 84
replace all with: 83 F8 02 90 90 0F 84
would solve it?
Anyway, will try your solution.
Just for the records, uninstall current patch, edit the file, install the patch - right?


On a sidenote, how can Dakkon change his morale?
Adnd btw, THANK GOD this thread is still alive, I am trying to solve this riddle for 5 days. And all I want do to, is playing this game, since I never finished it when I got it years before.
If it wont solve now, I will reinstall Windows :(