PDA

View Full Version : Playing Warcraft II for DOS on Fedora


doornail
2005-08-06, 06:41 PM CDT
Got an old CD for Warcraft II:Tide of Darkness? Want to play it on Linux?

In this document, I'm going to refer to the original Warcraft II:Tides of Darkness as WC2:ToD and the expansion pack Warcraft II:Beyond the Dark Portal as WC2:BtDP. These are the MS-DOS versions. If you have the newer, windows-based Battlenet version it wont work.

We're going to use two software packages today; Stratagus (http://stratagus.sourceforge.net) and Wargus (http://wargus.sourceforge.net) . These have to be two of the most painfully undocumented packages I've ever tried to work with. Hence, my attempt here to at least save you some time and effort. Stratagus is a tile-based, real-time strategy engine. Wargus is a utility to extract game data from the DOS version of Warcraft 2. Either the WC2:ToD or WC2:BtDP will work. I have both so I did some testing. Apparenly, Blizzard included all the game data for WC2:ToD on WC2:BtDP (I assume so you don't need to swap discs to play either), therefore if you extract from WC2:BtDP you can play both campaign sets.

You should be aware that we're only using the graphics, maps, and sounds from the CD. The authors of Stratagus and Wargus had to re-write the game logic and AI from scatch. It's an imitation, not a port, of Warcraft II; but a convincing one.

The Software:

Go to http://stratagus.sourceforge.net and download stratagus-2.1-linux.tar.gz.
Go to http://wargus.sourceforge.net and download wargus-2.1-linux.tar.gz.

Installation:

Extract them someplace. Since I don't share my PC with other accounts, I just tend to stick games in a ~/apps/games directory.

$ cd apps/games/
$ tar xvzf stratagus-2.1-linux.tar.gz
$ tar xvzf wargus-2.1-linux.tar.gz

$ cd wargus-2.1

At this point, stick in your old warcraft CD. My Fedora 4 mounts CD's at /media/recorder. Extract the game data with:

$ ./build.sh -p /media/cdrecorder/ -o ../stratagus-040702/data

There's a "-v" option to extract the videos also, but Stratagus does not seem to support them. You may get some warnings about not finding a couple files if you're using WC2:ToD. Don't sweat them. We're done with Wargus at this point. It extracted the game data and bundled it with custom game logic (written in Lua) into a data directory for Stratagus. So let's play:

$ cd ../stratatagus-040702
$ ./stratagus

Music:

We can rip the original music tracks into OGG Vorbis files and tell Stratagus to play them. I used Sound Juicer which comes with Fedora 4. Here's the tracks on the WC2:ToD CD and the filenames you could rip them to:

1 game data (don't rip this)
2 Human_Battle_1.ogg
3 Human_Battle_2.ogg
4 Human_Battle_3.ogg
5 Human_Battle_4.ogg
6 Human_Battle_5.ogg
7 Human_Briefing.ogg
8 Human_Victory.ogg
9 Human_Defeat.ogg
10 Orc_Battle_1.ogg
11 Orc_Battle_2.ogg
12 Orc_Battle_3.ogg
13 Orc_Battle_4.ogg
14 Orc_Battle_5.ogg
15 Orc_Briefing.ogg
16 Orc_Victory.ogg
17 Orc_Defeat.ogg

Place your OGG Vorbis sound files in data/music.

Next, edit data/scripts/sounds.lua and change this section like so (observe we're changing the cd-mode to "defined"):

------------------------------------------------------------------------------
-- (set-cd-mode!) set how your CD is played.
-- all plays all tracks
-- random plays random tracks
-- defined play according to playlist below
-- off turns cd player off
--SetCdMode("all")
--SetCdMode("random")
SetCdMode("defined")
--SetCdMode("off")

------------------------------------------------------------------------------

Then change the section below it to read:

------------------------------------------------------------------------------
-- (define-play-sections) set the playlist for different
-- sections of the game
--
DefinePlaySections("type", "main-menu", "no-cd", {"order", "all", "files", {"music/Human_Briefing.ogg"}})
DefinePlaySections("race", "human", "type", "game","no-cd", {"order", "all", "files", {"music/Human_Battle_1.ogg"}})
DefinePlaySections("race", "human", "type", "briefing","no-cd", {"order", "all", "files", {"music/Human_Briefing.ogg"}})
DefinePlaySections("race", "human", "type", "stats-victory","no-cd", {"order", "all", "files", {"music/Human_Victory.ogg"}})
DefinePlaySections("race", "human", "type", "stats-defeat","no-cd", {"order", "all", "files", {"music/Human_Defeat.ogg"}})
DefinePlaySections("race", "orc", "type", "game","no-cd", {"order", "all", "files", {"music/Orc_Battle_1.ogg"}})
DefinePlaySections("race", "orc", "type", "briefing","no-cd", {"order", "all", "files", {"music/Orc_Briefing.ogg"}})
DefinePlaySections("race", "orc", "type", "stats-victory","no-cd", {"order", "all", "files", {"music/Orc_Victory.ogg"}})
DefinePlaySections("race", "orc", "type", "stats-defeat","no-cd", {"order", "all", "files", {"music/Orc_Defeat.ogg"}})

------------------------------------------------------------------------------

I tried to set up a rotation of music files for human and orc "game", but Stratagus would crash if I did. So you may want to listen to [Human|Orc]_Battle_[1-5].ogg and pick your favorite.

Lastly, if you decide to compile Statagus from source and are missing any of the required libs, you can install them with:

$ su
# yum install SDL
# yum install libpng
# yum install zlib
# yum install libogg
# yum install libvorbis
# yum install libmad
# yum install bzip2-libs
# yum install lua
# yum install mikmod-devel
# yum install flac-devel

blittle
2008-01-22, 06:50 PM CST
doesn't work on F8 :-)

bob
2008-01-22, 06:55 PM CST
(moved to Gamers Lounge...although looks like it's not working...)

pete_1967
2008-01-22, 07:13 PM CST
(moved to Gamers Lounge...although looks like it's not working...)

Guess better late than never, op is almost 3 years old :D (Wasn't FC3 and 4 in 2005?)

bob
2008-01-22, 07:23 PM CST
Yeah, but we didn't have a Gamers Lounge in those days. We move 'em as we find 'em.

blittle
2008-01-22, 07:23 PM CST
lol yeah but google isn't being much help at the moment

pete_1967
2008-01-22, 07:27 PM CST
lol yeah but google isn't being much help at the moment

`yum install stratagus` (didn't check repo - could be in Livna). Wargus you have to sort out yourself, it's not in repos and I have no interest to find out what it is.

blittle
2008-01-22, 07:34 PM CST
installed those, wine and dosbox, none of them will launch.

pete_1967
2008-01-22, 07:42 PM CST
installed those, wine and dosbox, none of them will launch.

Ah, checked the SF site. Stratagus is actually a game engine (not a game) so no wonder you can't "launch" it.

If you read the op, you need to have original game CD to be able to install and run Wargus. Also it says so on the site:

You should be aware that we're only using the graphics, maps, and sounds from the CD.


Wargus uses the data from the warcraft CD's (DOS CD's only) and has similar gameplay.

blittle
2008-01-22, 07:44 PM CST
I do have the original CDs.


build.sh fails with this:

bash: ./build.sh: /bin/sh^M: bad interpreter: No such file or directory

after issuing this command: ./build.sh -p /media/WAR1/

pete_1967
2008-01-22, 07:52 PM CST
/bin/sh^M:


The files are in DOS format (with Windows line endings), run dos2unix on that build.sh and you'll be able to run it (you may need to run all of them files through dos2unix - keep eye on errors for that)

blittle
2008-01-22, 07:54 PM CST
forgive my ignorance, but what exactly are you saying to do?

copy these files to the hard drive and run some kind of conversion app on them? (dos2unix)

then try and reinstall?

blittle
2008-01-22, 07:56 PM CST
oh good tip :-)

now I'm getting

[root@id10t wargus-2.2.4]# ./build.sh -p /media/WAR1/
./build.sh: line 99: ./wartool: No such file or directory

pete_1967
2008-01-22, 07:58 PM CST
oh good tip :-)

Good :0


now I'm getting

[root@id10t wargus-2.2.4]# ./build.sh -p /media/WAR1/
./build.sh: line 99: ./wartool: No such file or directory
Sorry, that's where my help stops - not interested about the game in question.

What the error message is saying is that there is no such directory in where you extracted the files. Maybe those are stuff you need from the CD?

blittle
2008-01-22, 08:17 PM CST
well crap...

I actually didn't extract anything and the only war tool file I can find is in the stratagus and wargus directories.

I guess this just isn't maintained anymore which really sucks.

pete_1967
2008-01-22, 08:35 PM CST
well crap...

I actually didn't extract anything and the only war tool file I can find is in the stratagus and wargus directories.

I guess this just isn't maintained anymore which really sucks.

You did extract the tar file didn't you?

Did you copy the CD?

At this point, stick in your old warcraft CD. My Fedora 4 mounts CD's at /media/recorder. Extract the game data with:

$ ./build.sh -p /media/cdrecorder/ -o ../stratagus-040702/data


(You need to change the CD drive's path for your system).

blittle
2008-01-22, 08:43 PM CST
using wine and executing the autorun/autorun.exe

I get the install plash screen but once I try and install this happens

[root@id10t WAR1]# wine autorun/autorun.exe
Warning: unprotecting memory to allow real-mode calls.
NULL pointer accesses will no longer be caught.

^this happens on the wine autorun/autorune.exe


err:thunk:K32WOWCallback16Ex __wine_enter_vm86 failed (errno=38)

^this happens when I click on install, the odd thing is the map editor works lol

pete_1967
2008-01-22, 08:59 PM CST
What I understand from the op, you're not supposed to install anything from the CD nor go even near wine. You have to run the installation shell script on the cd mount directory (or did that start wine?)

blittle
2008-01-22, 09:05 PM CST
I've tried it multiple ways, but I think I'm making progress with the wargus/stratagus stuff thanks to your suggestions.

I think maybe I dont have this stuff compiled right, although that's not a step the op is stating.

I noticed a makefile and config (etc) in the stratagus directory so I'm guessing I need to make and install it, but now I"m tracking down dependencies...yay

now I'm hung on

checking bzlib.h usability... no
checking bzlib.h presence... no
checking for bzlib.h... no
configure: error: libbzip2 headers and/or libraries could not be found


Package bzip2 - 1.0.4-12.fc8.x86_64 is already installed.


I'm wondering if I'm shooting myself in the foot trying this on 64 bit lol

oh well it's frustrating as hell but I have plenty of beer so I'm ok so far...