You must be logged in to post messages.
Please login or register

AoW1 General Discussion & Strategies
Moderated by Enginerd

Hop to:    
Welcome! You are not logged in. Please Login or Register.17 replies
Age of Wonders 2 Heaven » Forums » AoW1 General Discussion & Strategies » HOWTO run AoW1 in Linux using Wine
Bottom
Topic Subject:HOWTO run AoW1 in Linux using Wine
int19h
Member
posted 10-30-05 00:43 AM EDT (US)         
Yes, I believe I managed to get it work. A rather nasty hack, to be honest - rather than trying to fix Wine itself, I messed with the game executables. But hey, at least it works!

What you need is to get a hex editor (e.g. BIEW), open

Ilpack.dpl
in it (don't forget to make a backup!), and find the following byte sequence:


66 8B 16 8D
74 16 03 81
E6 FC FF FF
0F 48 75 F0

Replace it with


90 90 90 90
90 90 90 90
90 90 90 90
90 90 90 90

Then do the same two more times - in all, there should be 3 such sequences in the file. Now save it and then simply run AoW.exe with Wine!

Here's a quick & dirty bash script if you don't want to deal with the hex editor. It'll make a backup copy of the file with ~ suffix as well.


#!/bin/bash
ORIG=$'\x66\x8B\x16\x8D\x74\x16\x03\x81\xE6\xFC\xFF\xFF\x0F\x48\x75 \xF0'
REPL=$'\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90 \x90'
sed -i~ s/$ORIG/$REPL/g Ilpack.dpl

(the forum screws the above code up by inserting random spaces inside the long binary strings near the end - remove them after pasting it).

This should be enough to get single-player working, both standalone maps and the campaign. There are a few very minor graphic glitches I've noticed, one to do with the topmost (half-visible) row of tiles on the global map, another with gold & mana counters on the status bar (they become garbled for a moment when they are updated), but nothing serious.

Multiplayer is a bit more tricky. AoW uses DirectPlay for it, and currently, Wine only has very basic support for it (only enough to prevent DP games from crashing). Thus, you'll need some native Windows DLL:


dplayx.dll - 218384 bytes
dpwsockx.dll - 17680 bytes

The ones from DirectX 9c installation did not work for me, but you can find the ones that do work by searching for the file names and sizes on Google. (I will not give direct links, as these DLLs are copyrighted and most likely cannot be redistributed legally). Copy them to AoW directory, and then make sure that Wine loads the native dplayx.dll you copied rather than its own builtin version. For me, this made the TCP/IP option in multiplayer menu to work again, and I was able to create a server. Whether it actually lets you play is yet to be seen: I do not have anyone around to test it, so if you can and it works (or doesn't), please share your experience!

The version of Wine I was using is the latest 0.9 beta release. I've also tried it with Cedega 4.4.1, and it does not seem to work with it.

[This message has been edited by int19h (edited 10-30-2005 @ 05:14 AM).]

AuthorReplies:
Dhuval
Member
posted 10-30-05 08:53 AM EDT (US)     1 / 17       
Impressive O.o
If only source code could be relesed..
SmurfHero
Member
posted 10-30-05 03:13 PM EDT (US)     2 / 17       
Hey, this looks good! Do you think it will work with WineX/Cedega as well?

Quoted from Dhuval:

If only source code could be relesed..


Yes ... Wouldn't that be great?

SmurfHero - Leader of the Smurf race
int19h
Member
posted 10-30-05 04:44 PM EDT (US)     3 / 17       

Quote:

Hey, this looks good! Do you think it will work with WineX/Cedega as well?


I do not think so. In case of Wine, it actually implements all APIs which the game requires; the reason why it displayed that annoying "Exception in MapViewer.ShowScene" message was because the game itself had a bug in it (trying to read from invalid pointer).

To be honest, I still don't know what the pointer was to, or what the NOP'd loop was supposed to do exactly, save that it is deep inside the engine rendering code. A wild guess is that it is meant to point to and read from a DirectX surface, and it goes outside its boundaries; it probably never got catched in Windows because of internal structure (padding?) of the surface there.

In Cedega, the game actually crashes with an exception right as it starts. Doesn't look very good...

But, since Wine is free under LGPL, why would anyone care? =)

Quote:

If only source code could be relesed..


IDA is your friend! =)

Seriously though, I'd very much like to get my hands on the code myself. Even in this case, it would've saved me a lot of trouble - disassembly of Delphi-compiled binaries is not particularly readable. But, as I understand, the answer from the publisher was a definite "no"?

[This message has been edited by int19h (edited 10-30-2005 @ 04:52 PM).]

A Qatigattuusara
Member
(id: Dvorak)
posted 01-08-06 11:12 AM EDT (US)     4 / 17       
Maybe this should be made sticky.
A Qatigattuusara
Member
(id: Dvorak)
posted 06-05-07 06:28 AM EDT (US)     5 / 17       
I said, maybe this should be made sticky.
Lord Naismith
Member
posted 06-05-07 06:39 PM EDT (US)     6 / 17       
--- Agrees
Deroman
Member
posted 06-06-07 06:23 AM EDT (US)     7 / 17       
Strauss, stop pinning dead topics or I issue official complain about your irresponsible behaviour!

-/X\(++)/X\-L.E.D. Frozen Warrior-/X\(++)/X\-

[This message has been edited by Deroman (edited 06-06-2007 @ 06:24 AM).]

Lorien Irmo
Member
posted 06-07-07 12:23 PM EDT (US)     8 / 17       
Quoted from Dhuval:
If only source code could be relesed..
Don't want to crush your dreams but....not gonna happen. heh


Truth is elusive to those who refuse to see with both eyes.
Deroman
Member
posted 06-08-07 09:45 AM EDT (US)     9 / 17       
Dhuval did make his post in 2005, I belive that he no longer has any of such dreams nor that he any longer is part of AoWH community.

Now would you and Strauss leave the dead lie.
(Sure, I stop doing the same thing.. just few more minutes... please?)

-/X\(++)/X\-L.E.D. Frozen Warrior-/X\(++)/X\-

[This message has been edited by Deroman (edited 06-08-2007 @ 09:49 AM).]

Dhuval
Member
posted 06-11-07 05:05 PM EDT (US)     10 / 17       
Sometimes I like to read what is happening here ;D
bye
A Qatigattuusara
Member
(id: Dvorak)
posted 06-11-07 06:19 PM EDT (US)     11 / 17       
I didn't top this to get more signatures for the source code petition. I bumped it because it has valuable information, ie. 'HOWTO run AoW1 in Linux using Wine'.
int19h
Member
posted 06-12-07 10:35 AM EDT (US)     12 / 17       
Don't bother. As of WINE 0.9.20 (and later), the patch is no longer needed. See here. The only info in my post that is probably still useful is the bit on DLLs required for multiplayer. Now that I actually have 2 machines, might as well test it...
A Qatigattuusara
Member
(id: Dvorak)
posted 06-12-07 01:17 PM EDT (US)     13 / 17       
Y-you're still here?
Welcome back!
int19h
Member
posted 06-12-07 02:38 PM EDT (US)     14 / 17       
We have always been here... seriously though, just lurking around, still waiting and hoping for AoW3

Something on a bright side: multiplayer works! I've tested TCP/IP so far, both hosting the game on Linux, and joining to a remote game hosted on WinXP - runs fine either way. For the record, it's Ubuntu Feisty & Wine 0.9.33, with the DirectPlay DLLs from here. AoWed runs great too, by the way. Gonna check PBEM tomorrow, though it's probably less tricky than DirectPlay, so should work just fine. If it works, then we're all set for AoW on Linux/FreeBSD. Could be Mac OS too, actually, what with Darwine and Crossover Mac.
Lord Naismith
Member
posted 06-13-07 03:10 AM EDT (US)     15 / 17       
Yay another face! Welcome back! O great lurker and fellow waiter of AoW 3 ^_^

Better close this tread before it gets offtopic eh? *hint hint*

^.~
Gandalf theWhite
Member
posted 06-16-07 01:04 PM EDT (US)     16 / 17       
Quoted from Dhuval:
If only source code could be relesed..
Don't want to crush your dreams but....not gonna happen. heh
Lorien that's funny but few days after your post, a interview with Lennart Sas (one of our dear devs) appeared here on AoWII Heaven, and actually, he says that's not impossible
int19h
Member
posted 02-09-19 07:52 PM EDT (US)     17 / 17       
So, ironically, this patch also happens to be a way to run AoW on Win10, if you're getting the "Exception during MapViewer.ShowScene error":

https://steamcommunity.com/app/61500/discussions/0/215439774855125498/

For those who are coming to this thread from Steam forums or Google, note that you do not need to muck around doing this manually on Windows. Just download and install the patch that I've made - it's the same exact thing, but it'll do everything for you as much as possible:

https://github.com/int19h/aow-patch/releases
You must be logged in to post messages.
Please login or register

Hop to:    

Age of Wonders 2 Heaven | HeavenGames