Running Borderlands in Linux!

1 reply [Last post]
rhoyerboat
Offline
Joined: 2009-11-24

/*
Hi Guys, most of you don't know me, I am a guy from G-town who knows Psychonitrous and insists on gaming on linux, (go openarena wooo!)

(what can I say, it keeps my play-to-learn time at a reasonable ratio)

Since Borderlands is SUCHASICKGAME I was inspired, to work out a list of requirements to get this game playable on linux.
Wine has mouse issues on most directx related games.
Wine psyhics are terrible.

This forum is as good as any. Special super-sick thanks to the guys who wrote the patch.
Pretty much all the disparit contributors are referenced at the end.
*/
Make Wine Run Borderlands, Make Wine Run Unreal

This is actually really easy.

First, get the latest development release sources for wine, atm, 1.1.33, DO NOT COMPILE.

Go here, http://www.codeweavers.com/compatibility/browse/name/?forum=1;app_id=652...
here,
http://bugs.winehq.org/show_bug.cgi?id=6971#c269
then finally, here,
http://bugs.winehq.org/attachment.cgi?id=24805

Read up, give props the heros, and get the patch. (or get the patch from this post, at the end.)

This is the problematic part, this guy's wine source-codes apparantly don't line up with mine, so it is a good thing I am not counting on software to apply it for me.

In all likelyhood, there are few wine installations outside of CVS (the developers shared source tree,) that would correctly apply this patch without someone editing it (ill do it tomorow i promise, then delete some of this post haha, if i can)

Fortunately, it is an extremely easy patch to apply by hand.
Find $winesources/dlls/dinput/mouse.c, find and delete the right lines according to the - (delete line)
or + (add line) indicators in the patch.

Compile/install wine:
./configure
./make depend && make && make install

I had some compiler errors that I waded through at this point, I am not sure if they are my sleep-deprived fault or if I had done further debugging when I was done, probably the former, but plz report problems if you have them.

Get cabextract (there are probably distribution packages for this.)

Now, winetricks, a bash script available from winehq, if you don't already have it.
(this site is awesome: http://wiki.jswindle.com/index.php/Winetricks)
Ubuntu might have all these installed already, someone can confirm this? or they may be installed from some other wine forgery, not sure how to test personally, so a-over-writing-we-will-go.
run these commands:
locate bin/winetricks (if its not there grab it fron winehq)
chmod u+x winetricks (in case you had to download it)
sh winetricks d3dx9
sh winetricks vcrun2005
sh winetricks vcrun2008

Assuming everything worked and winetricks installed everything, we move on.

wine regedit

Get into HKEY_CURRENT_USER/Software/Wine
Add the key "DirectInput"
Add to it the String Value "MouseWarpOverride"
Assign "MouseWarpOverride" the Value data, "force-box"

Now install Borderlands.
wine Borderlands.exe

If its jumpy, just turn down the physics in Engine/Config/BaseGame.ini, on line 58, from
MaxPhysicsSubsteps=5 to whatever you think is acceptable, I use 2, but hey, I'm on old hardware.
:)

Works for me on Zenwalk (is to Slackware as Ubuntu is to Debian).

The patched wine with the registry mod should honestly open up the door to a ton more games
being playable in wine, such as Unreal Tournament 2004 and anything else where the mouse was
hitting invisible walls. Hopefully the next wine release, this is all default. It might not go mainline until
the registry hack can be applied automatically, as it might break some other applications, or something. Again, if you see this kind of stuff, ("force-box" breaking something) Let someone know, winehq is a good place but I'm perfectly happy to be a proxy.

I think I got it all, I am going to enjoy a little borderlands or else tweak the unreal .ini files some more.

http://wiki.jswindle.com/index.php/Winetricks)
http://bugs.winehq.org/show_bug.cgi?id=6971#c269,
http://ubuntuforums.org/showthread.php?t=847535,
http://www.codeweavers.com/compatibility/browse/name/?forum=1;app_id=652...,
http://bugs.winehq.org/attachment.cgi?id=24805
(the patch:
--- dlls/dinput/mouse.c.orig 2009-11-17 15:47:35.000573211 +0200
+++ dlls/dinput/mouse.c 2009-11-17 15:53:05.590802272 +0200
@@ -55,7 +55,8 @@
{
WARP_DEFAULT,
WARP_DISABLE,
- WARP_FORCE_ON
+ WARP_FORCE_ON,
+ WARP_FORCEBOX_ON
} WARP_MOUSE;

struct SysMouseImpl
@@ -76,6 +77,8 @@
DIMOUSESTATE2 m_state;

WARP_MOUSE warp_override;
+ /* This defines the warp ``box'' */
+ DWORD warp_boxpixels;
};

static int dinput_mouse_hook( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM lparam );
@@ -185,6 +188,7 @@
LPDIDATAFORMAT df = NULL;
unsigned i;
char buffer[20];
+ char boxpixels[4];
HKEY hkey, appkey;

newDevice = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(SysMouseImpl));
@@ -205,6 +209,14 @@
newDevice->warp_override = WARP_DISABLE;
else if (!strcasecmp(buffer, "force"))
newDevice->warp_override = WARP_FORCE_ON;
+ else if (!strcasecmp(buffer, "force-box")) {
+ newDevice->warp_override = WARP_FORCEBOX_ON;
+ newDevice->warp_boxpixels = 10;
+ if (!get_config_key(hkey, appkey, "BoxPixels", boxpixels, sizeof(boxpixels)))
+ {
+ newDevice->warp_boxpixels = atoi(boxpixels);
+ }
+ }
}
if (appkey) RegCloseKey(appkey);
if (hkey) RegCloseKey(hkey);
@@ -331,8 +343,17 @@
}

This->need_warp = This->warp_override != WARP_DISABLE &&
- (pt.x || pt.y) &&
- (dwCoop & DISCL_EXCLUSIVE || This->warp_override == WARP_FORCE_ON);
+ (
+ (pt.x || pt.y) &&
+ (dwCoop & DISCL_EXCLUSIVE || This->warp_override == WARP_FORCE_ON)
+ ||
+ (
+ hook->pt.xwarp_boxpixels ||
+ hook->pt.ywarp_boxpixels ||
+ hook->pt.x>((2 * This->win_centerX)-This->warp_boxpixels) ||
+ hook->pt.y>((2 * This->win_centerY)-This->warp_boxpixels)
+ ) && This->warp_override == WARP_FORCEBOX_ON
+ );
break;
}
case WM_MOUSEWHEEL:
@@ -462,7 +483,7 @@
This->win_centerY = (rect.bottom - rect.top ) / 2;

/* Warp the mouse to the center of the window */
- if (This->base.dwCoopLevel & DISCL_EXCLUSIVE || This->warp_override == WARP_FORCE_ON)
+ if (This->base.dwCoopLevel & DISCL_EXCLUSIVE || This->warp_override == WARP_FORCE_ON || This->warp_override == WARP_FORCEBOX_ON)
{
This->mapped_center.x = This->win_centerX;
This->mapped_center.y = This->win_centerY;
@@ -496,7 +517,7 @@
}

/* And put the mouse cursor back where it was at acquire time */
- if (This->base.dwCoopLevel & DISCL_EXCLUSIVE || This->warp_override == WARP_FORCE_ON)
+ if (This->base.dwCoopLevel & DISCL_EXCLUSIVE || This->warp_override == WARP_FORCE_ON || This->warp_override == WARP_FORCEBOX_ON)
{
TRACE(" warping mouse back to (%d , %d)\n", This->org_coords.x, This->org_coords.y);
SetCursorPos(This->org_coords.x, This->org_coords.y);

: end patch)
fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.VC80.CRT" (8.0.50727.762)
fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.VC90.CRT"

fixme:d3d:IWineD3DSwapChainImpl_Present Unhandled present

DFragmentor
Offline
Joined: 2009-08-05
Moved

Awesome post!! I moved this from where you posted to here. This is a more appropriate location.

User login

Shopping Cart

View your shopping cart.

Advertisement

Sponsors

Steel Series

Twitter

Join our Groups!








Who's online

There are currently 0 users and 0 guests online.

Donations

Thermostat