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
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