The
OEM Version of Homeworld (known as Raider Retreat) was originally
released to pre-purchasers of Homeworld: Cataclysm in 2000.
Sierra also allowed unrestricted distribution of Homeworld Raider
Retreat at that time. This document describes the process of
converting the free Homeworld OEM version to Homeworld version 1.05
(last official version) using freely obtainable files.
Why do this? I wanted to install Homeworld in a virtualbox virtual machine, but my game CD
was at the back of a full storage unit. I wanted to see if it
would be possible to convert the Homeworld OEM version to the final
version.
Overview of steps:
1 - install homeworld oem
2 - go in to "C:\Sierra" and rename folder "Homeworld OEM" to
"Homeworld"
3 - use bigviewer on Update.big.
select SoundFX, file, save files recursive.
Close bigviewer.
Go in to "C:\Sierra\Homeworld\SoundFX" and rename
OEM_Music.wxh to HW_Music.wxh.
4 - install patch 1.05
5 - rename OEM_Music.wxd to HW_Music.wxd
6 - copy cmdline.dll to homeworld folder
7 - Add cmdline.dll to homeworld.exe
8 - Use ollydbg to add patches
I have gathered the files you will need here.
Download the file and unzip it to c:. Your folder should look
like the following picture (except for the screen_shots folder).
Do step #1:
1 - install homeworld oem
Go in to the folder C:\oem\HOMEWORLD_OEM\HOMEWORLDOEM and double-click on HWSetup.EXE
2 - go in to "C:\Sierra" and rename folder "Homeworld OEM" to
"Homeworld"
Change this:
To this:
3 - use bigviewer on Update.big.
select SoundFX, file, save files recursive.
Close bigviewer.
Go in to "C:\Sierra\Homeworld\SoundFX" and rename
OEM_Music.wxh to HW_Music.wxh.
4 - install patch 1.05
Double-click on C:\oem\homeworld105.exe.
Click on "No" because we don't want to run Homeworld yet.
5 - rename OEM_Music.wxd to HW_Music.wxd
6 - copy cmdline.dll to homeworld folder
Go in to the folder C:\oem\cmdline and copy cmdline.dll to C:\Sierra\Homeworld.
7 - Add cmdline.dll to homeworld.exe.
Go in to the tf23 folder C:\oem\tf23 and double-click on iidking-v2.01.exe.
Click the "Pick a file" button and select homeworld.exe. Then,
click on the "Click to pick DLL(s)..." button and select cmdline.dll.
Select the three above functions and click the "Add them!" button.
You should see this message:
Click "OK" and close IIDKing. You should see the file homeworld.exe.txt.
The contents of homeworld.exe.txt should look like this:
8 - Use ollydbg to add patches
Now we will load homeworld.exe in to ollydbg and add a few patches. These are the patches we will add:
(This looks a little scary. Don't be scared. It's not as bad as it looks.)
- ' STUFF that I did to homeworld.exe
- ' - remove cd check:
- '00409A69 . E9 F5030000 JMP homeworl.00409E63
- '
- ' - add hook to call LoadCommandLine()
- ' Instead of reading the commandline normally, the file called commandLine.txt is read.
- ' This is needed for Gameranger. (Gameranger calls homeworld.exe with /disableAVI only.)
- '00409A6E
FF15 3C819700 CALL DWORD
PTR
DS:[<&cmdline.LoadCommandLine>]
; cmdline.LoadCommandLine
- '00409A74 |. 83C4 FC ADD ESP,-4
- '00409A77 \.
C3
RETN
- '00409A78
90
NOP
- '
- '0040454B . E8 1E550000 CALL homeworl.00409A6E
- '
- ' - add minelayer fix
- ' There is a bug in Homeworld when watching recorded games. If someone force-attacks a mine during
- ' the game recording, then the recording gets a sync error when it's watched later. This patch fixes it.
- ' For anyone that cares, the offending line is in gun.c.
- ' in the function missileShoot() the line of:
- ' if (multiPlayerGame) IDToPtrTableAdd(&MissileIDToPtr,universe.missileNumber,(SpaceObj *)missile);
- ' should be instead:
- ' IDToPtrTableAdd(&MissileIDToPtr,universe.missileNumber,(SpaceObj *)missile);
- ' the same bug is also in the file univupdate.c in function univAddMissile()
- ' I haven't tested it in the single player campaign... maybe it's needed for that...
- ' in that case, maybe change it to: if (multiPlayerGame+playPackets) IDTo...
- ' for force-attacking mines:
- '0056D0A0 90 NOP
- '0056D0A1 90 NOP
- ' for force-attacking missiles (the above change takes care of this too it seems):
- '(The below two modifications were not made. They are just here for reference.)
- '(not made) 0059F2BD
90
NOP
- '(not made) 0059F2BE
90
NOP
- '
- ' - map background fix
- ' There's a bug in Homeworld when loading recorded games: if the
- ' map that the game was played on isn't installed on the computer, then
- ' Homeworld crashes (if the map has a BTG background file).
- ' This often happens when someone uploads a game-recording to the internet
- ' and doesn't include the map. This function
- ' fixes the problem by only calling btgLoadTextures() if the btg file exists.
- '00409A78 FF15 40819700 CALL DWORD
PTR
DS:[<&cmdline.InterceptLoadingBTGFiles>]
; cmdline.InterceptLoadingBTGFiles
- '00409A7E
C3
RETN
- '
- '0064693E E8 3531DCFF CALL homeworl.00409A78
- '
- ' opengl patch. in function glCapNT()
- ' This allows for you to select opengl as a renderer. It is useful for when you want to run Homeworld in virtualbox.
- 'old:
- '0045BD98 77
09
JA SHORT 0045BDA3
- 'new:
- '0045BD98 72
09
JB SHORT 0045BDA3
- '
- '
- ' add option to use OEM music instead of full-game music.
- '00409A7F FF15 44819700 CALL DWORD
PTR
DS:[<&cmdline.My_musictranslatetracknum>]
; cmdline.My_musictranslatetracknum
- '00409A85 83C4 FC ADD ESP,-4
- '00409A88 C3 RETN
- '0051A08C E8
EEF9EEFF
CALL 00409A7F
- '0051A386 E8
F4F6EEFF
CALL 00409A7F
- '0051A805 E8
75F2EEFF
CALL 00409A7F
- '0051A9FE E8
7CF0EEFF
CALL 00409A7F
Go in to C:\oem\odbg110 and double-click on OLLYDBG.EXE to start up ollydbg. You should see this:
Click "Yes". Then go to file, open and find homeworld.exe.
Once olly loads it, you should see something similar to this:
Now we will begin adding our patches. First, we will jump over the check for a Homeworld CD.
Open the file C:\oem\cmdline\cmdline.x with notepad. You should see this:
This is the xblite source code for cmdline.dll. We will be referencing the comments at the top of the file.
On the third line down, highlight the hex address 00409a69 and press control-c to copy it.
Now go in to ollydbg and right-click in the area where you see the grey
cursor bar. A menu should pop up. Go down to "Go to" and then
"Expression"
A window should pop up saying "Enter expression to follow".
Click the mouse in the box so you see the cursor then hit control-v to paste in the address from earlier.
Click ok and you should see this.
We are going to change the assembly instructions at that location to this:
Highlight the "JMP homeworl.00409E63" and press control-c to copy it. Then go back in to
ollydbg. Press the spacebar and a box should pop up. Press
the delete key to delete the current contents of the box, then press control-v
to paste in our new instructions.
Before you click the "Assemble" button, delete the part that says "homeworl." It should look like the below picture.
Click "Assemble", then click "Cancel" to close the box. You should see this:
The red text indicates that we made a change to what was originally there.
Now for the next patch. Right-click near the grey cursor line
again like we did for the first patch (or just press control-g).
We will be going to address 00409A74 this time.
Follow along with the pictures:
Copy the above text with control-c.
Then go to address 00409A6E in ollydbg.
Press the spacebar to bring up the "Assemble" window and control-v to paste the command.
Now for the next patch.
The above one was pretty simple. Now for the map background patch.
Now for the open-gl patch.
Now for the music patch. The music that comes with the OEM
version of Homeworld isn't really meant to be used with the final
version (1.05). This patch will select the right music from the
OEM music file that corresponds with the music from the final version.
Ok so we are done adding all of our patches. Now we need to save
our modified version of homeworld.exe. Right-click near the grey
line and go to "Copy to executable" then "All modifications".
Ollydbg will ask "Copy selection to executable file?". Click the "Copy all" button.
This will open a new window inside of ollydbg like below.
Right-click and select "Save file".
You can't save it as homeworld.exe because the file is loaded by
ollydbg. Name it homeworld2.exe like in the picture below then
click "Save". After you do that, quit ollydbg.
You should see homeworld2.exe in your homeworld folder.
Rename homeworld.exe to homeworld_backup.exe, then rename homeworld2.exe to homeworld.exe.
Now, if you double-click on homeworld.exe you should see this:
Shut down Homeworld. Copy commandLine.txt from C:\oem\cmdline in
to your homeworld folder. Edit the file to how you want it and
save it. For example:
A few notes about running homeworld in virtualbox:
On my version of virtualbox (4.2) the Caps-lock key doesn't work quite
right as the TACTICAL OVERLAY key within Homeworld. I changed it
to the "a" key.
I did this conversion project in a windows xp virtual machine (google microxp) running on top of linux mint.
If you decide to also run Homeworld in virtualbox, you will need to disable mouse integration like this:
If you don't disable mouse integration you will not be able to change
the view in a controlled fashion within Homeworld. Instead, the
camera will pan around wildly.
The end.