The forum

Beyond Good and Evil (GoG) [WIP]

Author Replies
petch Saturday 17 December 2011 at 17:39
petch

Hi all,
Here is the best I could do to get Beyond Good and Evil working.
First (fixed) problem is to make sure CPU runs at constant speed.
The main remaining problem is sound, without native DirectSound I get looping sounds, and with native dsound, video and audio get out of sync, sound dialogs are cropped,... WineHQ bug #13046
I'm running out of ideas to fix this perfectly, I could use some help... :sad:

https://raw.github.com/petchema/playonlinux/master/wip/beyond-good&evil-gog
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#!/bin/bash
# Date : (2011-12-14 23-58)
# Last revision : (2011-12-17 13-34)
# Wine version used : 1.3.23
# Distribution used to test : Debian Sid (Unstable)
# Author : Pierre Etchemaite petchema@concept-micro.com
# Script licence : GPL v.2
# Program licence : Retail
# Depend :
 
# Tested up to 1.3.35 without native DirectSound, and still looping sounds
 
[ -z "$PLAYONLINUX" ] && exit 0
source "$PLAYONLINUX/lib/sources"
 
check_install_archive () {
    FILE="$1"
    EXPECTED_NAME="$2"
    EXPECTED_SIZE="$3"
    EXPECTED_MD5="$4"
 
    POL_SetupWindow_wait "$(eval_gettext 'Checking install archive...')" "$TITLE"
    # Temporarily prevent word splitting
    OLDIFS="$IFS"
    IFS=''
    NAME="$(basename $FILE)"
    SIZE="$(stat -c%s $FILE)"
    MD5="$(POL_MD5_file $FILE)"
    IFS="$OLDIFS"
 
    if [ $SIZE -ne $EXPECTED_SIZE -o "$MD5" != "$EXPECTED_MD5" ]; then
        POL_Debug_Error "$(eval_gettext 'Install archive mismatch.\\nEither your install archive is corrupted, or is not the expected version.\\nThis script cannot guarantee that installation will work correctly. Please report success or failure to PlayOnLinux forums.')\\n$(eval_gettext 'Name:') $NAME ($(eval_gettext 'expected') $EXPECTED_NAME)\\n$(eval_gettext 'Size:') $SIZE ($(eval_gettext 'expected') $EXPECTED_SIZE)\\n$(eval_gettext 'MD5:') $MD5\\n     ($(eval_gettext 'expected') $EXPECTED_MD5)"
        POL_SetupWindow_question "$(eval_gettext 'Continue?')" "$TITLE"
        [ "$APP_ANSWER" != "TRUE" ] && POL_Debug_Fatal "$(eval_gettext 'Not the expected archive')"
    fi
}
 
 
PREFIX="BeyondGaE_gog"
WORKING_WINE_VERSION="1.3.23"
 
TITLE="$(eval_gettext 'Beyond Good and Evil (GoG release)')"
SHORTCUT_NAME="Beyond Good and Evil"
SHORTCUT_DOC="$SHORTCUT_NAME - $(eval_gettext 'User manual')"
SHORTCUT_README="$SHORTCUT_NAME - $(eval_gettext 'Readme')"
 
POL_SetupWindow_Init
POL_Debug_Init
 
POL_SetupWindow_presentation "$TITLE" "Ubisoft" "http://www.gog.com/en/gamecard/beyond_good_and_evil" "Pierre Etchemaite" "$PREFIX"
 
POL_Wine_SelectPrefix "$PREFIX"
POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"
 
cd $HOME
POL_SetupWindow_browse "$(eval_gettext 'Please select the setup file to run.')" "$TITLE"
ARCHIVE="$APP_ANSWER"
 
check_install_archive "$ARCHIVE" setup_beyond_good_and_evil.exe 1544566386 "75ccff61fc37b3b04245f094850dce88"
 
 
POL_SetupWindow_wait "$(eval_gettext 'Please wait while $TITLE is installed.')" "$TITLE"
 
# Associate .PDF with native app
# http://wiki.winehq.org/FAQ#head-91bf3f0a8ccbfab8dee96f82fae2f1a489e0d243
# Do it before installing the game, so you have the possibility to open
# PDFs with Win32 reader if you choose to install it
cat <<'_EOF_' > $REPERTOIRE/tmp/pdfnativereader.reg
[HKEY_CLASSES_ROOT\\.pdf]
@="PDFfile"
"Content Type"="application/pdf"
[HKEY_CLASSES_ROOT\\PDFfile\\Shell\\Open\\command]
@="winebrowser \\"%1\\""
_EOF_
POL_Wine regedit $REPERTOIRE/tmp/pdfnativereader.reg
 
POL_Wine start /unix "$ARCHIVE" || POL_Debug_Fatal "$(eval_gettext 'Error while installing archive')"
 
POL_Wine_WaitExit "$TITLE"
 
# Can only get lots of looping sounds (2s loops) without native DirectSound
# (and emulated sound outputs?)
POL_Call POL_install_dsound
 
# Sound output: default (emulated) [hopefully]
# Should avoid looping [has proven to shorten some samples instead?]
#cat <<_EOFINI_ > "$REPERTOIRE/tmp/dsoundbuiltinoutput.reg"
#REGEDIT4
#
#[HKEY_CURRENT_USER\\Software\\Ubisoft\\Beyond Good & Evil\\SettingsApplication.INI\\Sound]
#"Audio board GUID"=hex:00,18,ad,c2,43,b2,ce,11,a8,a4,00,aa,00,6c,45,00
#_EOFINI_
#POL_Wine regedit "$REPERTOIRE/tmp/dsoundbuiltinoutput.reg"
#rm "$REPERTOIRE/tmp/dsoundbuiltinoutput.reg"
 
# GoG work!
Set_OS winxp
 
# Has problems when unconstrained
Set_Desktop "On" "1024" "768"
 
POL_SetupWindow_VMS "32"
  
## PlayOnMac Section
[ -n "$PLAYONMAC" ] && Set_SoundDriver "alsa"
[ -n "$PLAYONMAC" ] || Set_Managed "Off"
## End Section
 
# Doesn't hurt ;)
POL_Wine_reboot
 
convert "$WINEPREFIX/drive_c/$PROGRAMFILES/GOG.com/Beyond Good and Evil/game.ico" "$REPERTOIRE/icones/32/$SHORTCUT_NAME"
POL_Shortcut "BGE.exe" "$SHORTCUT_NAME"
# Fixes a problem with CPU management on modern computers (specially laptops):
# BGE doesn't handle variable frequency, so make sure they stay at top frequency
# with a background busy loop (other means are less portable and/or require root privileges)
POL_Shortcut_InsertBeforeWine "$SHORTCUT_NAME" 'schedtool -a 0x1 $$'
POL_Shortcut_InsertBeforeWine "$SHORTCUT_NAME" 'nice -19 bash -c "while true; do let i=1; done" &'
POL_Shortcut_InsertBeforeWine "$SHORTCUT_NAME" 'BUSYLOOP_PID=$!'
POL_Shortcut_InsertBeforeWine "$SHORTCUT_NAME" 'trap "kill $BUSYLOOP_PID" EXIT'
 
POL_Shortcut "start.exe" "$SHORTCUT_DOC" "" "'C:/$PROGRAMFILES/GOG.com/Beyond Good and Evil/manual.pdf'"
POL_Shortcut "start.exe" "$SHORTCUT_README" "" "'C:/$PROGRAMFILES/GOG.com/Beyond Good and Evil/readme.txt'"
 
POL_SetupWindow_Close
 
cat <<_EOF_ > "$REPERTOIRE/configurations/configurators/$SHORTCUT_NAME"
#!/bin/bash
[ -z "\\$PLAYONLINUX" ] && exit 0
source "\\$PLAYONLINUX/lib/sources"
export WINEPREFIX="$REPERTOIRE/wineprefix/$PREFIX"
export WINEDEBUG=""
 
POL_LoadVar_PROGRAMFILES
 
cd "\\$WINEPREFIX/drive_c/\\$PROGRAMFILES/GOG.com/Beyond Good and Evil/" || exit 1
 
TITLE="$TITLE"
 
POL_Wine "SettingsApplication.exe"
 
exit
_EOF_
 
exit

Edited by petch

Dadu042 Saturday 20 April 2019 at 19:08
Dadu042

This site allows content generated by members, and we promptly remove any content that infringes copyright according to our Terms of Service. To report copyright infringement, please send a notice to dmca@playonlinux.com