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

AoW1 General Discussion & Strategies
Moderated by Enginerd, Ziggurat Mason

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: HOWTO run AoW1 in Linux using Wine
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).]

Replies:
posted 10-30-05 08:53 AM EDT (US)     1 / 19  
Impressive O.o
If only source code could be relesed..
posted 10-30-05 03:13 PM EDT (US)     2 / 19  
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
posted 10-30-05 04:44 PM EDT (US)     3 / 19  

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).]

posted 01-08-06 11:12 AM EDT (US)     4 / 19  
Maybe this should be made sticky.
posted 06-05-07 06:28 AM EDT (US)     5 / 19  
I said, maybe this should be made sticky.
posted 06-05-07 06:39 PM EDT (US)     6 / 19  
--- Agrees
posted 06-06-07 06:23 AM EDT (US)     7 / 19  
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).]

posted 06-07-07 12:23 PM EDT (US)     8 / 19  
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.
posted 06-08-07 09:45 AM EDT (US)     9 / 19  
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).]

posted 06-11-07 05:05 PM EDT (US)     10 / 19  
Sometimes I like to read what is happening here ;D
bye
posted 06-11-07 06:19 PM EDT (US)     11 / 19  
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'.
posted 06-12-07 10:35 AM EDT (US)     12 / 19  
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...
posted 06-12-07 01:17 PM EDT (US)     13 / 19  
Y-you're still here?
Welcome back!
posted 06-12-07 02:38 PM EDT (US)     14 / 19  
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.
posted 06-13-07 03:10 AM EDT (US)     15 / 19  
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*

^.~
posted 06-16-07 01:04 PM EDT (US)     16 / 19  
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
posted 02-09-19 07:52 PM EDT (US)     17 / 19  
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
posted 12-13-22 08:12 PM EDT (US)     18 / 19  
Less than 20 years later, we have a new version of the patch that doesn't introduce visual glitches! The original sequence you need to replace is the same, but instead of replacing it with 90 90 ..., you need to substitute the following sequence

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

Thanks to https://github.com/narzoul for the investigation.
posted 01-06-23 05:20 PM EDT (US)     19 / 19  
18 years of support! Can't beat that.
Age of Wonders 2 Heaven » Forums » AoW1 General Discussion & Strategies » HOWTO run AoW1 in Linux using Wine
Top
You must be logged in to post messages.
Please login or register
Hop to:    
Age of Wonders 2 Heaven | HeavenGames